943,866 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 440
  • C++ RSS
Jun 18th, 2009
0

GDB says it happens at a class declaration

Expand Post »
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:
C++ Syntax (Toggle Plain Text)
  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
Reputation Points: 10
Solved Threads: 0
Light Poster
rmlopes is offline Offline
31 posts
since Sep 2008
Jun 18th, 2009
0

Re: GDB says it happens at a class declaration

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.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Jun 19th, 2009
0

Re: GDB says it happens at a class declaration

post the output of 'where' in gdb, that will give us the whole stack.
Reputation Points: 58
Solved Threads: 17
Junior Poster
Stinomus is offline Offline
109 posts
since May 2009
Jun 19th, 2009
0

Re: GDB says it happens at a class declaration

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
Reputation Points: 10
Solved Threads: 0
Light Poster
rmlopes is offline Offline
31 posts
since Sep 2008
Jun 19th, 2009
0

Re: GDB says it happens at a class declaration

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?
Reputation Points: 10
Solved Threads: 0
Light Poster
rmlopes is offline Offline
31 posts
since Sep 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Power Test - Resolve/C++
Next Thread in C++ Forum Timeline: Windows Programing





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC