signal func test/debug

This is a discussion on signal func test/debug within the C Programming forums, part of the General Programming Boards category; I have programmed a signal routine to catch segmentation faults under windows. How can I test it? How can I ...

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    145

    signal func test/debug

    I have programmed a signal routine to catch segmentation faults under windows. How can I test it? How can I send a segsegv signal to my programm in run-time
    thx.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Try to access a random (or NULL) pointer, perhaps?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    145
    Quote Originally Posted by matsp View Post
    Try to access a random (or NULL) pointer, perhaps?

    --
    Mats
    It works great.
    Is there any way to know where line of code (or at lest any tip) from where the signal came from?

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Kempelen View Post
    It works great.
    Is there any way to know where line of code (or at lest any tip) from where the signal came from?
    Only by looking at the stack-trace, I think.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 07-07-2009, 10:05 AM
  2. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  3. Signal and exception handling
    By nts in forum C++ Programming
    Replies: 23
    Last Post: 11-15-2007, 01:36 PM
  4. signal handling
    By trekker in forum C Programming
    Replies: 2
    Last Post: 07-05-2002, 02:52 AM
  5. typedef a func
    By trekker in forum C Programming
    Replies: 4
    Last Post: 07-02-2002, 05:15 AM

Tags for this Thread


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