jatinps
asked on
JNI Problem - GetStringChars giving core dump after few repititve operation
jstring str;
char *value;
value = (char *) (*env)->GetStringUTFChars( env,str,NULL);
(*env)->ReleaseStringUTFCh ars(env,st r,value);
Above piece of code gets executed for each field of an Java object. It gives a core dump after executing successfully for some field at one specefic point.
Re-arranging the position of the field also gives the error after certain number of execution.
I don't do anything with the value as well, just retrieve it and then release it. It still gives an error.
Any pointer?????????????
char *value;
value = (char *) (*env)->GetStringUTFChars(
(*env)->ReleaseStringUTFCh
Above piece of code gets executed for each field of an Java object. It gives a core dump after executing successfully for some field at one specefic point.
Re-arranging the position of the field also gives the error after certain number of execution.
I don't do anything with the value as well, just retrieve it and then release it. It still gives an error.
Any pointer?????????????
Simply assigning finalValue to value just gives you two pointers to the SAME block of memory. Then in the next line you release this block of memory so finalValue is no longer pointing to a valid block of memory.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- points to objects
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
vemul
Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
- points to objects
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
vemul
Cleanup Volunteer
Finalized as proposed
modulo
Community Support Moderator
Experts Exchange
modulo
Community Support Moderator
Experts Exchange