jni error message interpretation

T

tupolev

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

Gordon Beaton

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
 
T

tupolev

Gordon Beaton said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top