java - 错误 `/usr/bin/java' : munmap_chunk(): invalid pointer: in JNI

标签 java c post java-native-interface tomcat7

我使用 RESTful API 通过 HTTP POST 请求获取数据包。然后使用 JNI 解析该数据包,并将结果返回给 java。 当它运行时,在几次 HTTP POST 请求之后,tomcat 服务器崩溃并显示错误“/usr/bin/java 中的错误:munmap_chunk():无效指针:0x00007f40b40011d0”

最佳答案

无论如何,我得到了答案。这是因为您在分配内存之前释放了内存。这就是我的错误的原因。

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.

关于java - 错误 `/usr/bin/java' : munmap_chunk(): invalid pointer: in JNI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30886615/

相关文章:

javax.mail.internet.ParseException : In Content-Type string , 预期 '/',得到:

c - 波特率为 9600 的串行读写,无奇偶校验,数据位 8 和停止位 2。无法与设备通信

c++ - 为什么在 c/c++ 中,开关的优化方式与链式 if else 不同?

javascript - 寻找 AJAX get 和 post 使用的 Web 数据的绝对或可能估计?

Javascript 检索 json 和 POST

java - JList 上的 ListSelectionListener 不起作用

java - @Override 声称 Method 不会重写,但 method 说它与父方法冲突

java - 安卓图像按钮

c - 无法从链表中弹出顶部元素

java - 如何使用 Java Spring 将上传文件的多部分/表单数据表单重新发送到不同的服务器