misterious SEGFAULT

This is a discussion on misterious SEGFAULT within the C Programming forums, part of the General Programming Boards category; Hi There, I just caught a SEGFAULTR with gdb: Code: Program received signal SIGSEGV, Segmentation fault. 0x0804cb4c in main (argc=1, ...

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

    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
    32

    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, 09: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, 05:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21