Need Urgent Help

Discussion in 'C Programming' started by pycraze, Aug 16, 2007.

  1. pycraze

    pycraze Guest

    Hello ,

    i am working on NetBSD 3.0.2 with gcc version 3.3.3 .


    While debugging with gdb, i am getting a segmentation fault with
    accept system call and gdb is showing following traceback.


    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread -1229071456 (LWP 8798)]
    0x00766402 in __kernel_vsyscall ()
    (gdb) bt
    #0 0x00766402 in __kernel_vsyscall ()
    #1 0x00df4d88 in accept () from /lib/libpthread.so.0
    #2 0x08057799 in run_server () at server.c:150
    #3 0x08057f82 in main (argc=1, argv=0xbfbf5064) at main.c:160

    Could anyone please suggest us what could have caused this
    segmentation fault.
     
    pycraze, Aug 16, 2007
    #1
    1. Advertising

  2. On Aug 16, 12:36 pm, pycraze <> wrote:
    > Hello ,
    >
    > i am working on NetBSD 3.0.2 with gcc version 3.3.3 .
    >
    > While debugging with gdb, i am getting a segmentation fault with
    > accept system call and gdb is showing following traceback.
    >
    > Program received signal SIGSEGV, Segmentation fault.
    > [Switching to Thread -1229071456 (LWP 8798)]
    > 0x00766402 in __kernel_vsyscall ()
    > (gdb) bt
    > #0 0x00766402 in __kernel_vsyscall ()
    > #1 0x00df4d88 in accept () from /lib/libpthread.so.0
    > #2 0x08057799 in run_server () at server.c:150
    > #3 0x08057f82 in main (argc=1, argv=0xbfbf5064) at main.c:160
    >
    > Could anyone please suggest us what could have caused this
    > segmentation fault.


    The same thing that always causes a segmentation fault: trying to use
    memory that isn't yours or in a way that isn't allowed. Without
    seeing the code it's impossible to give any more detail. Since you
    mentioned BSD and are using system-specific functions your question
    might be more appropriate for comp.unix.programmer where they
    specialize in such systems.

    Robert Gamble
     
    Robert Gamble, Aug 16, 2007
    #2
    1. Advertising

  3. pycraze wrote:

    > Hello ,
    >
    > i am working on NetBSD 3.0.2 with gcc version 3.3.3 .
    >
    >
    > While debugging with gdb, i am getting a segmentation fault with
    > accept system call and gdb is showing following traceback.
    >
    >
    > Program received signal SIGSEGV, Segmentation fault.
    > [Switching to Thread -1229071456 (LWP 8798)]
    > 0x00766402 in __kernel_vsyscall ()
    > (gdb) bt
    > #0 0x00766402 in __kernel_vsyscall ()
    > #1 0x00df4d88 in accept () from /lib/libpthread.so.0
    > #2 0x08057799 in run_server () at server.c:150
    > #3 0x08057f82 in main (argc=1, argv=0xbfbf5064) at main.c:160
    >
    > Could anyone please suggest us what could have caused this
    > segmentation fault.

    I think that you use not a thread-safe library.
    Please, provide more info.
     
    Ivan Gotovchits, Aug 17, 2007
    #3
  4. pycraze

    Guest

    On Aug 16, 9:36 pm, pycraze <> wrote:
    > Hello ,
    >
    > i am working on NetBSD 3.0.2 with gcc version 3.3.3 .
    >
    > While debugging with gdb, i am getting a segmentation fault with
    > accept system call and gdb is showing following traceback.
    >
    > Program received signal SIGSEGV, Segmentation fault.
    > [Switching to Thread -1229071456 (LWP 8798)]
    > 0x00766402 in __kernel_vsyscall ()
    > (gdb) bt
    > #0 0x00766402 in __kernel_vsyscall ()
    > #1 0x00df4d88 in accept () from /lib/libpthread.so.0
    > #2 0x08057799 in run_server () at server.c:150
    > #3 0x08057f82 in main (argc=1, argv=0xbfbf5064) at main.c:160
    >
    > Could anyone please suggest us what could have caused this
    > segmentation fault.


    Hi.

    (a) Could you send the complete command line options including flags,
    target, etc. what you are using to generate the exe.?

    OR

    Could you check (a) is being used properly with required library(s)
    calls and flags during compilation.

    I don't think you need to have any other big reasons of having SEGSEGV
    error message..relax!!!!

    BR
    Mukesh K Srivastava
     
    , Aug 17, 2007
    #4
  5. Ivan Gotovchits <> wrote:
    > pycraze wrote:
    > > i am working on NetBSD 3.0.2 with gcc version 3.3.3 .
    > >
    > > While debugging with gdb, i am getting a segmentation fault with
    > > accept system call and gdb is showing following traceback.
    > >
    > > Program received signal SIGSEGV, Segmentation fault.
    > > [Switching to Thread -1229071456 (LWP 8798)]
    > > 0x00766402 in __kernel_vsyscall ()
    > > (gdb) bt
    > > #0 0x00766402 in __kernel_vsyscall ()
    > > #1 0x00df4d88 in accept () from /lib/libpthread.so.0
    > > #2 0x08057799 in run_server () at server.c:150
    > > #3 0x08057f82 in main (argc=1, argv=0xbfbf5064) at main.c:160
    > >
    > > Could anyone please suggest us what could have caused this
    > > segmentation fault.

    > I think that you use not a thread-safe library.


    You don't need threads to get a segmentation fault (and there's
    nothing here to indicate that the OP uses threads at all), it's
    enough to have either memory corruption in your program or call
    some library functions with wrong arguments (e.g. in another
    thread somebody got a segmentation fault because he was passing
    a NULL pointer to fclose()).

    > Please, provide more info.


    That's definitely required to make any reasonable statements
    beyond listing the "usual suspects".
    Regards, Jens
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
     
    Jens Thoms Toerring, Aug 17, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yucky Corpulent
    Replies:
    5
    Views:
    419
  2. Sachin Jagtap

    URGENT !! QUEUE STL PROBLEM URGENT!!

    Sachin Jagtap, Apr 28, 2005, in forum: C++
    Replies:
    4
    Views:
    1,055
    Mark Stijnman
    Apr 29, 2005
  3. Rahul S.
    Replies:
    3
    Views:
    612
    Flash Gordon
    Nov 1, 2004
  4. Amar
    Replies:
    5
    Views:
    548
    David Carlisle
    Nov 30, 2007
  5. Rob
    Replies:
    3
    Views:
    452
Loading...

Share This Page