GDB says it happens at a class declaration

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Sep 2008
Posts: 31
Reputation: rmlopes is an unknown quantity at this point 
Solved Threads: 0
rmlopes rmlopes is offline Offline
Light Poster

GDB says it happens at a class declaration

 
0
  #1
Jun 18th, 2009
Hello,

I am developing a library, which untill a few days ago was working perfectly. With some changes I needed to perform I started having a segmentation fault. The problem is that I cannot understand why the fault is happening since the conclusion from gdb is the following:
  1. Program terminated with signal 11, Segmentation fault.
  2. [New process 31401]
  3. #0 0x0806a53a in Solution (this=0x9e1a8d0, copysol=@0x9e21908) at ../brickh-lib/Constraint.h:647
  4. 647 class SilvaConstraint{
So, I understand it all starts when there is a copy of a Solution, but then why is gdb saying it occurs at a class declaration? What does this mean? How can I get to the bottom of the problem?
(SilvaConstraint does not have a copy constructor defined, but if I define one the gdb gives the same output; I checked the copy constructor at Solution also and I couldn't find any sign of memory violation)

Thank you for your help
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 678
Reputation: Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold 
Solved Threads: 101
Sky Diploma's Avatar
Sky Diploma Sky Diploma is offline Offline
Practically a Master Poster

Re: GDB says it happens at a class declaration

 
0
  #2
Jun 18th, 2009
It is really hard for us to actually find the error without knowing what exactly your code is ,

Though You dont post the whole code, Post the Class And atleast 20 Lines Before and After the Class Definition,

Other-wise you can attach the whole file (donot forget to include tests in it) and post it up so someone can actually work on it.
1. Please Mark Your Thread as Solved After Getting Your Answers.
2. Please Use CODE TAGS .
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 109
Reputation: Stinomus is on a distinguished road 
Solved Threads: 16
Stinomus Stinomus is offline Offline
Junior Poster

Re: GDB says it happens at a class declaration

 
0
  #3
Jun 19th, 2009
post the output of 'where' in gdb, that will give us the whole stack.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 31
Reputation: rmlopes is an unknown quantity at this point 
Solved Threads: 0
rmlopes rmlopes is offline Offline
Light Poster

Re: GDB says it happens at a class declaration

 
0
  #4
Jun 19th, 2009
Hello

I am using meta-programming so posting evrything here will probably be useless adn confusing. What I am really looking for is maybe a hint of how to further debug this or what the meaning of gdb pointing to the class declaration is. I have tried a lot of things and I've googled a lot trying to find some explanation that would help me to do more... How can it be at the class declaration?! Shouldn't it at least be in the constructor, if it is at the time of creation?

Thank you
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 31
Reputation: rmlopes is an unknown quantity at this point 
Solved Threads: 0
rmlopes rmlopes is offline Offline
Light Poster

Re: GDB says it happens at a class declaration

 
0
  #5
Jun 19th, 2009
I tried with VC++ debugger and here I get a proper location to look for an inconsistency, not the class declaration anymore. Any hints on why this GDB behavior?
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 297 | Replies: 4
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC