LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-09-2009, 10:47 AM   #16
sahil.jammu
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15

Thnx for the reply.
----
As usual, I can't even guess what you are trying to ask or tell with some of the code you quoted
Code: wlfs_frame_rsp( (uint16*)lfs_msg_ptr, length )
----
// if i do a UP from the place where the debugger is complaining about the code, phch_last->next = phch_iter->next; it takes me to wlfs_frame_rsp( (uint16*)lfs_msg_ptr, length ) i modified this uint16* to uint*

Kindly refer to 11th post for data structure and code details, in my 14th post though even i feel its not very clear but thatz the only significant output which was available after comparing the 32 bit passing log with the 64 bit failing log.

If you want to continue posting code in forums, you should learn how to use code tags to make the code readable.
//Thanks for the suggestion, i will take care of this from now onwards.

-----------
//As per the discussion that was one of the pointers i got to proceed further to fix this issue. Since the uint16* is used and like you mentioned (uint*) in that code are casts of a type that is likely to be non portable when switching between a 32 bit and 64 bit architecture. So any construct like that might be the bug that is causing problem. I still want to understand little more on this as somewhere this can be the cause of problem.

Regards
Sahil
 
Old 07-09-2009, 11:56 AM   #17
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by sahil.jammu View Post
Kindly refer to 11th post for data structure and code details,
In the 11th post you have a lot of declarations and executable code. But obviously a lot of executable code in that function is missing from there. Otherwise, the executable code you showed uses all uninitialized variables and performs meaningless functions.

Also, those declarations do not include the data structures. For example you include the declarations of several pointers to a data structure named WCDSP_PHCH_STATUS_STR but you don't include the definition of that data structure.

Quote:
i modified this uint16* to uint*
WHY?

That seems to be a completely random change. You aren't going to fix bugs by making random changes. Random changes will just add more bugs.
 
Old 07-09-2009, 11:56 AM   #18
sahil.jammu
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
Quote:
i modified this uint16* to uint*

Yes right this was one of the random changes to check on the basis of something i read in some other post.
I am not convinced with this and i feel there is something certainly to do with data type here which is causing the problem. I didnt understand the behaviour of uint16* here , and what sud be the ideal repleacement if needed for 64bit data type.
Like you mentioned (uint*) in that code are casts of a type that is likely to be non portable when switching between a 32 bit and 64 bit architecture.

-------
But obviously a lot of executable code in that function is missing from there. Otherwise, the executable code you showed uses all uninitialized variables and performs meaningless functions.
-------
ya i could have added some more relevant info.......just that wasnt sure how much code sud i put as its huge and involves lotts of files with thousands of lines of code. I just posted the code of the area where debugger was complaing

Last edited by sahil.jammu; 07-09-2009 at 12:04 PM.
 
Old 07-10-2009, 03:19 AM   #19
sahil.jammu
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
Hi,

I build the testcase on 32 bit machine and executed the same on 64 bit machine. Its passing successfully. Seems like compilation on 64 bit is causing the problem and some data type compatibility issues is there.

-Thnx!
sahil
 
Old 07-22-2009, 02:47 AM   #20
sahil.jammu
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
phch_last->next = phch_iter->next;
phch_last = phch_iter;
free(phch_iter);

phch_iter->next
struct_WCDSP_PHCD_STATUS_STR *) 0*0

phch_last its (WCDSP_PHCH_STATUS_STR *) 0*20
It's not correct for a pointer in x86_64 to contain the value 0x20.

value assigned as Null.
-------
WCDSP_PHCH_STATUS_STR *phch_iter;
WCDSP_PHCH_STATUS_STR *phch_last = NULL ;
WCDSP_TRCH_STATUS_STR *trch_iter;
WCDSP_TRCH_STATUS_STR *trch_tmp1;
-------


Problem resolved with this fix.!!

------

Thanks Johnsfine for all the help .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation fault cybil001 Programming 39 02-19-2007 10:01 AM
segmentation fault Tavassoli Linux - Software 5 06-12-2006 09:48 AM
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
Memory fault(coredump) error Gigantor Programming 5 10-31-2005 03:11 AM
segmentation fault pippet Programming 4 01-24-2005 01:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration