`/usr/bin/java' 中的错误:munmap_chunk():无效指针:在 JNI 中
Error in `/usr/bin/java': munmap_chunk(): invalid pointer: in JNI
我正在通过 HTTP POST 请求获取数据包,使用 RESTful API.Then 使用 JNI 解析此数据包,并将结果 returns 结果为 java。
虽然它 运行,但在多次 HTTP POST 请求后 tomcat 服务器崩溃并显示错误 "Error in /usr/bin/java: munmap_chunk(): invalid pointer: 0x00007f40b40011d0"
。
我得到了这个 anyway.Its 的答案,因为你在分配之前释放内存 it.Thats 我的错误原因。
The free() function frees the memory space pointed to by ptr,
which must have been returned by a previous call to malloc(),
calloc() or realloc(). Otherwise, or if free(ptr) has already been
called before, undefined behavior occurs. If ptr is NULL, no
operation is performed.
我正在通过 HTTP POST 请求获取数据包,使用 RESTful API.Then 使用 JNI 解析此数据包,并将结果 returns 结果为 java。
虽然它 运行,但在多次 HTTP POST 请求后 tomcat 服务器崩溃并显示错误 "Error in /usr/bin/java: munmap_chunk(): invalid pointer: 0x00007f40b40011d0"
。
我得到了这个 anyway.Its 的答案,因为你在分配之前释放内存 it.Thats 我的错误原因。
The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behavior occurs. If ptr is NULL, no operation is performed.