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. Advertisements

  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. Advertisements

  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. Advertisements

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. jagbal
    Replies:
    1
    Views:
    503
    Craig Deelsnyder
    Jan 7, 2004
  2. hb
    Replies:
    4
    Views:
    2,161
    Steven Cheng[MSFT]
    Feb 18, 2004
  3. =?Utf-8?B?QmlsYWw=?=

    Urgent: Please need help badly

    =?Utf-8?B?QmlsYWw=?=, Feb 26, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    486
    =?Utf-8?B?QmlsYWw=?=
    Feb 28, 2004
  4. Mike

    Re: urgent question, need help

    Mike, Jul 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    393
  5. Tee

    Re: urgent question, need help

    Tee, Jul 18, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    418
  6. Yucky Corpulent
    Replies:
    5
    Views:
    599
  7. Rahul S.
    Replies:
    3
    Views:
    788
    Flash Gordon
    Nov 1, 2004
  8. Amar
    Replies:
    5
    Views:
    740
    David Carlisle
    Nov 30, 2007
Loading...