Thread: Unable to get debugging info to track down a segfault

  1. #1
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,734

    Unable to get debugging info to track down a segfault

    I've uploaded my code to
    GitHub - awsdert/gasp at 53a48dbfab059b5b3bfb285ac18e3d1002de106e

    Someone mind taking a look to see if they can discern why I'm not getting debug info, if you're gonna run it yourself then type "make gede" into the terminal in root of the cloned project, that will first launch "gede gasp-d" which will then launch "pkexec gede deep-gasp-d" (refer to output for full details of the launch)

    As for the segfault I can hazard a guess to it being in proc_handle_bytescanner() but I'm not certain as it could also be the interaction with lua at the point it's supposed to hand over, the reason I think it is in bytescanner() is because I do boundary scans there, proc_handle_dump() doesn't care about boundaries cause it's just dumping to file.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,665
    Code:
    %.o: %
    	$(CC) $(CFLAGS) -o $@ -c $< $(LIBS)
    
    %-d.o: %
    	$(CC) $(DFLAGS) $(CFLAGS) -o $@ -c $< $(LIBS)
    Maybe because your .o rule lacks DFLAGS.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,734
    Quote Originally Posted by Salem View Post
    Code:
    %.o: %
    	$(CC) $(CFLAGS) -o $@ -c $< $(LIBS)
    
    %-d.o: %
    	$(CC) $(DFLAGS) $(CFLAGS) -o $@ -c $< $(LIBS)
    Maybe because your .o rule lacks DFLAGS.
    That's supposed to lack that, the "-d" is for distinguishing debug files from normal files

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Does the order in the makefile result "%.o: %" being used instead of "%-d.o: %"?
    I have no idea if order makes a different in makefiles.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  5. #5
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,734
    Quote Originally Posted by stahta01 View Post
    Does the order in the makefile result "%.o: %" being used instead of "%-d.o: %"?
    I have no idea if order makes a different in makefiles.

    Tim S.
    Only when I use normal targets, turned out there was a segfault in proc_handle_dump() though, forgot to convert a piece of code to no longer add to the base pointer, still seem to be getting a segfault elsewhere though (trying to catch it atm)

  6. #6
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,734
    Quote Originally Posted by awsdert View Post
    Only when I use normal targets, turned out there was a segfault in proc_handle_dump() though, forgot to convert a piece of code to no longer add to the base pointer, still seem to be getting a segfault elsewhere though (trying to catch it atm)
    Found it, turned out I had accidentally 0'd the swap pointers for mapped regions, now I just gotta find where I'm getting an infinite loop

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. On the right track?
    By JayCee++ in forum C++ Programming
    Replies: 17
    Last Post: 10-07-2011, 01:30 PM
  2. print to console or /dev/null for debugging info
    By jeanluca in forum C Programming
    Replies: 3
    Last Post: 04-21-2010, 01:54 AM
  3. removing debugging info with borland c++
    By silk.odyssey in forum C++ Programming
    Replies: 3
    Last Post: 12-10-2003, 04:24 PM
  4. debugging info
    By Cristian Negresco in forum C++ Programming
    Replies: 0
    Last Post: 05-27-2002, 02:04 AM
  5. not on right track
    By Dena in forum C++ Programming
    Replies: 1
    Last Post: 02-23-2002, 07:03 PM

Tags for this Thread