Debug Segmention Fault, GCC compiled with --enable-checking?

  • greggg666
  • Born
  • Born
  • greggg666
  • Posts: 1

Post 3+ Months Ago

Hi!
I'm a newbie concerning Linux, but I have to write an C multithread application. Unfortunetly I have a Segmention Fault and I can't find the error. I tried with GDB to debug it, but I get always "Couldn't get registers: No such process" or "Cannot fetch general-purpose registers for thread 1074119840: generic error" if I try to use "backtrace" or "print".
I've read that gcc has to be compiled with an option --enable-checking to could use GDB and per default it isn't in distributions (I'm using Red Hat 9, gcc -v is confirming this [--disable-checking]).
How can I recompile gcc or downloading a rpm where --enable-checking is activated?
I don't want to use the method of gcc.gnu.org, I don't understand any thing!

Thanks a lot!

Greetz from Belgium
  • phpSelectah
  • Student
  • Student
  • User avatar
  • Posts: 97

Post 3+ Months Ago

quite possibly, this is a run time error.

If you are using shm, or accessing the parent script's pointers (like a shared emory violation) , you will run into problems in threading apps during run time AFAIK.

I don't think compilers are smart enough to check cross thread pointers, which IMO should not be used.

Also make sure you are using a threading model that GDB understands.(proper scheduling, etc).

Good luck. :D
  • phpSelectah
  • Student
  • Student
  • User avatar
  • Posts: 97

Post 3+ Months Ago

greggg666 wrote:
Hi!
I'm a newbie concerning Linux, but I have to write an C multithread application. Unfortunetly I have a Segmention Fault and I can't find the error. I tried with GDB to debug it, but I get always "Couldn't get registers: No such process" or "Cannot fetch general-purpose registers for thread 1074119840: generic error" if I try to use "backtrace" or "print".
I've read that gcc has to be compiled with an option --enable-checking to could use GDB and per default it isn't in distributions (I'm using Red Hat 9, gcc -v is confirming this [--disable-checking]).
How can I recompile gcc or downloading a rpm where --enable-checking is activated?
I don't want to use the method of gcc.gnu.org, I don't understand any thing!

Thanks a lot!

Greetz from Belgium


download the source RPM, set the necessary flags and recompile GCC !

quite possibly, a development version of Linux will have this option enabled.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.