jni error message interpretation

Discussion in 'Java' started by tupolev, Jun 30, 2003.

  1. tupolev

    tupolev Guest

    Hello all,
    I am using JNI and I am receiving an error here and there.
    I would like to interpret the message that JNI launches when this
    error happens. In particular it would be good to understand this part:

    An unexpected exception has been detected in native code outside the
    VM.
    Unexpected Signal : 11 occurred at PC=0x4D03B46E
    Function=_ZN7MyLibrary5mysock6SelectEiP6fd_setS2_S2_P7timeval+0x278

    1) What is the unexpected signal number 11?

    2) I have understood that the function that crashes is situated in
    MyLibrary, class mysock, function Select and that an object fd_set is
    crashing within the function. But where? and what are all those
    numbers in the function? and what does that timeval mean?

    Thank you for the help.
    tupolev, Jun 30, 2003
    #1
    1. Advertising

  2. On 30 Jun 2003 01:24:25 -0700, tupolev wrote:
    > I am using JNI and I am receiving an error here and there. I would
    > like to interpret the message that JNI launches when this error
    > happens. In particular it would be good to understand this part:
    >
    > An unexpected exception has been detected in native code outside the
    > VM.
    > Unexpected Signal : 11 occurred at PC=0x4D03B46E
    > Function=_ZN7MyLibrary5mysock6SelectEiP6fd_setS2_S2_P7timeval+0x278
    >
    > 1) What is the unexpected signal number 11?
    >
    > 2) I have understood that the function that crashes is situated in
    > MyLibrary, class mysock, function Select and that an object fd_set is
    > crashing within the function. But where? and what are all those
    > numbers in the function? and what does that timeval mean?


    The error is otherwise known as segmentation fault. It occurrs when
    you attempt to access (read or write) a memory location that you do
    not have permission for. The kernel has sent a signal (number 11) to
    kill the process.

    The PC number is the value of the program counter at the time the
    error occurred. The other thing is the name of the function that was
    executing and a byte offset (0x278) within the function.

    It indicates an error in your native code involving pointers. That
    could mean many different things, but here are some typical examples:

    - you have used the value of an uninitialized variable.
    - you have failed to check the return value of a function, and assumed
    that it succeeded.
    - you have written beyond the bounds of something, thereby changing
    the value of a neighbouring structure, which now contains nonsense.
    - you have used some type X as though it were some other type Y.

    There are tools like Mpatrol, Valgrind and Purify that can help you
    debug this.

    If you are new to JNI or C this kind of error is quite common. If
    there isn't very much code, post it here and someone might look
    through it for you.

    /gordon

    --
    [ do not send me private copies of your followups ]
    g o r d o n . b e a t o n @ e r i c s s o n . c o m
    Gordon Beaton, Jun 30, 2003
    #2
    1. Advertising

  3. tupolev

    tupolev Guest

    Gordon Beaton <> wrote in message news:<bdotcp$9a6$>...
    > On 30 Jun 2003 01:24:25 -0700, tupolev wrote:
    > > I am using JNI and I am receiving an error here and there. I would
    > > like to interpret the message that JNI launches when this error
    > > happens. In particular it would be good to understand this part:
    > >
    > > An unexpected exception has been detected in native code outside the
    > > VM.
    > > Unexpected Signal : 11 occurred at PC=0x4D03B46E
    > > Function=_ZN7MyLibrary5mysock6SelectEiP6fd_setS2_S2_P7timeval+0x278
    > >
    > > 1) What is the unexpected signal number 11?
    > >
    > > 2) I have understood that the function that crashes is situated in
    > > MyLibrary, class mysock, function Select and that an object fd_set is
    > > crashing within the function. But where? and what are all those
    > > numbers in the function? and what does that timeval mean?

    >
    > The error is otherwise known as segmentation fault. It occurrs when
    > you attempt to access (read or write) a memory location that you do
    > not have permission for. The kernel has sent a signal (number 11) to
    > kill the process.
    >
    > The PC number is the value of the program counter at the time the
    > error occurred. The other thing is the name of the function that was
    > executing and a byte offset (0x278) within the function.
    >
    > It indicates an error in your native code involving pointers. That
    > could mean many different things, but here are some typical examples:
    >
    > - you have used the value of an uninitialized variable.
    > - you have failed to check the return value of a function, and assumed
    > that it succeeded.
    > - you have written beyond the bounds of something, thereby changing
    > the value of a neighbouring structure, which now contains nonsense.
    > - you have used some type X as though it were some other type Y.
    >
    > There are tools like Mpatrol, Valgrind and Purify that can help you
    > debug this.
    >
    > If you are new to JNI or C this kind of error is quite common. If
    > there isn't very much code, post it here and someone might look
    > through it for you.
    >
    > /gordon


    Thank you very much Gordon for your help.
    tupolev, Jun 30, 2003
    #3
    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. Alex Hunsley

    IBM's JNI fails where Sun's JNI works

    Alex Hunsley, Nov 3, 2003, in forum: Java
    Replies:
    4
    Views:
    835
    Alex Hunsley
    Nov 4, 2003
  2. Pasturel Jean-Louis

    Porting JNI Windows under JNI LINUX + Wine ?

    Pasturel Jean-Louis, Feb 29, 2004, in forum: Java
    Replies:
    5
    Views:
    889
    Pasturel Jean-Louis
    Mar 3, 2004
  3. vasanth
    Replies:
    0
    Views:
    2,660
    vasanth
    Jan 25, 2005
  4. vasanth
    Replies:
    0
    Views:
    606
    vasanth
    Jan 25, 2005
  5. Tom Cloyd
    Replies:
    2
    Views:
    116
    Tom Cloyd
    May 20, 2008
Loading...

Share This Page