From: <no...@so...> - 2001-08-18 04:48:47
|
Bugs item #418883, was opened at 2001-04-25 10:02 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=101176&aid=418883&group_id=1176 Category: Memory management Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Memory violation during evaluation Initial Comment: ++Memory violation occurred during evaluation. ++Please report this bug using the XSB bug tracking system: ++ http://sourceforge.net/bugs/?group_id=1176 ++and to xsb...@li.... ++Please supply the steps necessary to reproduce the bug. ! Aborting... System: Linux artemis 2.4.0-64GB-SMP #1 SMP Mon Jan 22 16:44:21 GMT 2001 i686 unknown XSB Version 2.2 (Tsingtao) of April 20, 2000 [i686-pc-linux-gnu; mode: optimal; engine: chat; scheduling: batched] The above listed error message is repeated endlessly. The mistake seems to be produced by xsb_init. I try to use this function from Java as a native method. So we have created a libxsb.so library and according Java files and a C wrapper file Xsb.c The corresponding part of that file is listed below. Maybe there is only something wrong with that code. I would appreciate any help. /* * Class: com_kb_xsb_Xsb * Method: xsb_next_string * Signature: (Ljava/lang/StringBuffer;Ljava/lang/String;)I */ JNIEXPORT jint JNICALL Java_com_kb_xsb_Xsb_xsb_1next_1string (JNIEnv *env, jobject me, jobject ans, jstring sep) { vstrDEFINE(buf); jstring ret; jclass cls; jmethodID mid; char *csep = (*env)->GetStringUTFChars(env, sep, 0); int b = xsb_next_string(&buf, csep); (*env)->ReleaseStringUTFChars(env, sep, csep); ret = (*env)->NewStringUTF(env, buf.string); cls = (*env)->GetObjectClass(env, ans); mid = (*env)->GetMethodID(env, cls, "append", "(Ljava/lang/String;)Ljava/lang/StringBuffer;"); if (mid == 0) { printf("No such method: append in StringBuffer"); } (*env)->CallObjectMethod(env, ans, mid, ret); vstrDESTROY(&buf); return b; } ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-04-30 09:32 Message: Logged In: NO Interestingly, the change to Suns JDK helps most of the time but in some cases the same memory allocation error occurs nvertheless. Thanks anyway! At least, it will help most of the time. ---------------------------------------------------------------------- Comment By: Michael Kifer (kifer) Date: 2001-04-26 22:14 Message: Logged In: YES user_id=12609 You should provide a complete test case (as small as possible). People have reported that there is a problem with IBM's JNI interface in JDK 1.3, but the same program would work under SUN's JDL 1.3 mk ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=101176&aid=418883&group_id=1176 |