Thread: misterious SEGFAULT

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    42

    misterious SEGFAULT

    Hi There,

    I just caught a SEGFAULTR with gdb:
    Code:
    Program received signal SIGSEGV, Segmentation fault.
    0x0804cb4c in main (argc=1, argv=0xbf9f6894) at main.c:979
    979                     if (_check_prg != NULL
    (gdb)
    but i can't explain why, _check_prg is of type
    prg_t *_check_prg;
    and why would i run into a seg fault with following if statement?:
    Code:
                    if (_check_prg != NULL
                        && check_point >
                        (_check_prg->prg_bus.bus_timestamp + 120)) {
    Thanks for hints!
    Ron

  2. #2
    Registered User
    Join Date
    Dec 2009
    Posts
    42

    Lightbulb

    Quote Originally Posted by cerr View Post
    Hi There,

    I just caught a SEGFAULTR with gdb:
    Code:
    Program received signal SIGSEGV, Segmentation fault.
    0x0804cb4c in main (argc=1, argv=0xbf9f6894) at main.c:979
    979                     if (_check_prg != NULL
    (gdb)
    but i can't explain why, _check_prg is of type
    prg_t *_check_prg;
    and why would i run into a seg fault with following if statement?:
    Code:
                    if (_check_prg != NULL
                        && check_point >
                        (_check_prg->prg_bus.bus_timestamp + 120)) {
    Thanks for hints!
    Ron
    Hold-on. I just realized that I need to have two if statements, sorry, makes sense now...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Segfault for who knows what reason
    By phlook in forum C Programming
    Replies: 4
    Last Post: 03-14-2009, 11:31 PM
  2. Segfault with additional variable?
    By misterFry in forum C++ Programming
    Replies: 11
    Last Post: 11-12-2008, 10:55 AM
  3. malloc() resulting in a SegFault?!
    By cipher82 in forum C++ Programming
    Replies: 21
    Last Post: 09-18-2008, 11:24 AM
  4. use of printf prevents segfault!
    By MK27 in forum C Programming
    Replies: 31
    Last Post: 08-27-2008, 12:38 PM
  5. Other programming questions: segfault in free
    By Neeharika in forum C Programming
    Replies: 2
    Last Post: 02-21-2006, 06:35 AM