0
我在運行時在Java本機中獲取了com.artifex.mupdf.MuPDFCore.getText2Internal(Native Method) 中的錯誤。這是日誌。我似乎無法確定問題。我正在嘗試在Mupdf上編寫一個封裝。如果你需要我顯示一些代碼,請讓我知道。Android中的Java本地錯誤
09-11 11:19:43.039: W/dalvikvm(3131): threadid=4: spin on suspend #1 threadid=10 (pcf=0)
09-11 11:19:43.789: W/dalvikvm(3131): threadid=4: spin on suspend #2 threadid=10 (pcf=3)
09-11 11:19:43.789: I/dalvikvm(3131): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
09-11 11:19:43.789: I/dalvikvm(3131): | group="system" sCount=0 dsCount=0 obj=0x40510b68 self=0x173a38
09-11 11:19:43.789: I/dalvikvm(3131): | sysTid=3136 nice=0 sched=0/0 cgrp=default handle=1207328
09-11 11:19:43.789: I/dalvikvm(3131): at dalvik.system.NativeStart.run(Native Method)
09-11 11:19:43.789: I/dalvikvm(3131): "AsyncTask #2" prio=5 tid=10 RUNNABLE
09-11 11:19:43.789: I/dalvikvm(3131): | group="main" sCount=1 dsCount=0 obj=0x40511508 self=0x1d3338
09-11 11:19:43.789: I/dalvikvm(3131): | sysTid=3207 nice=0 sched=0/0 cgrp=default handle=1913968
09-11 11:19:43.859: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2Internal(Native Method)
09-11 11:19:43.859: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2(MuPDFCore.java:155)
09-11 11:19:43.859: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.gotoPage(MuPDFCore.java:77)
09-11 11:19:43.859: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getPageSize(MuPDFCore.java:84)
09-11 11:19:43.859: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:54)
09-11 11:19:43.859: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:1)
09-11 11:19:43.859: I/dalvikvm(3131): at android.os.AsyncTask$2.call(AsyncTask.java:185)
09-11 11:19:43.859: I/dalvikvm(3131): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
09-11 11:19:43.859: I/dalvikvm(3131): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
09-11 11:19:43.859: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
09-11 11:19:43.869: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
09-11 11:19:43.869: I/dalvikvm(3131): at java.lang.Thread.run(Thread.java:1019)
09-11 11:19:44.619: W/dalvikvm(3131): threadid=4: spin on suspend #3 threadid=10 (pcf=3)
09-11 11:19:44.619: I/dalvikvm(3131): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
09-11 11:19:44.619: I/dalvikvm(3131): | group="system" sCount=0 dsCount=0 obj=0x40510b68 self=0x173a38
09-11 11:19:44.619: I/dalvikvm(3131): | sysTid=3136 nice=0 sched=0/0 cgrp=default handle=1207328
09-11 11:19:44.619: I/dalvikvm(3131): at dalvik.system.NativeStart.run(Native Method)
09-11 11:19:44.619: I/dalvikvm(3131): "AsyncTask #2" prio=5 tid=10 RUNNABLE
09-11 11:19:44.619: I/dalvikvm(3131): | group="main" sCount=1 dsCount=0 obj=0x40511508 self=0x1d3338
09-11 11:19:44.619: I/dalvikvm(3131): | sysTid=3207 nice=0 sched=0/0 cgrp=default handle=1913968
09-11 11:19:46.549: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2Internal(Native Method)
09-11 11:19:46.549: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2(MuPDFCore.java:155)
09-11 11:19:46.549: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.gotoPage(MuPDFCore.java:77)
09-11 11:19:46.549: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getPageSize(MuPDFCore.java:84)
09-11 11:19:46.549: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:54)
09-11 11:19:46.549: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:1)
09-11 11:19:46.549: I/dalvikvm(3131): at android.os.AsyncTask$2.call(AsyncTask.java:185)
09-11 11:19:46.549: I/dalvikvm(3131): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
09-11 11:19:46.549: I/dalvikvm(3131): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
09-11 11:19:46.549: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
09-11 11:19:46.549: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
09-11 11:19:46.549: I/dalvikvm(3131): at java.lang.Thread.run(Thread.java:1019)
09-11 11:19:47.299: W/dalvikvm(3131): threadid=4: spin on suspend #4 threadid=10 (pcf=3)
09-11 11:19:47.299: I/dalvikvm(3131): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
09-11 11:19:47.299: I/dalvikvm(3131): | group="system" sCount=0 dsCount=0 obj=0x40510b68 self=0x173a38
09-11 11:19:47.299: I/dalvikvm(3131): | sysTid=3136 nice=0 sched=0/0 cgrp=default handle=1207328
09-11 11:19:47.299: I/dalvikvm(3131): at dalvik.system.NativeStart.run(Native Method)
09-11 11:19:47.299: I/dalvikvm(3131): "AsyncTask #2" prio=5 tid=10 RUNNABLE
09-11 11:19:47.299: I/dalvikvm(3131): | group="main" sCount=1 dsCount=0 obj=0x40511508 self=0x1d3338
09-11 11:19:47.299: I/dalvikvm(3131): | sysTid=3207 nice=0 sched=0/0 cgrp=default handle=1913968
09-11 11:19:47.319: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2Internal(Native Method)
09-11 11:19:47.319: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2(MuPDFCore.java:155)
09-11 11:19:47.319: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.gotoPage(MuPDFCore.java:77)
09-11 11:19:47.319: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getPageSize(MuPDFCore.java:84)
09-11 11:19:47.319: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:54)
09-11 11:19:47.319: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:1)
09-11 11:19:47.319: I/dalvikvm(3131): at android.os.AsyncTask$2.call(AsyncTask.java:185)
09-11 11:19:47.319: I/dalvikvm(3131): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
09-11 11:19:47.319: I/dalvikvm(3131): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
09-11 11:19:47.319: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
09-11 11:19:47.319: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
09-11 11:19:47.319: I/dalvikvm(3131): at java.lang.Thread.run(Thread.java:1019)
09-11 11:19:48.069: W/dalvikvm(3131): threadid=4: spin on suspend #5 threadid=10 (pcf=3)
09-11 11:19:48.069: I/dalvikvm(3131): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
09-11 11:19:48.069: I/dalvikvm(3131): | group="system" sCount=0 dsCount=0 obj=0x40510b68 self=0x173a38
09-11 11:19:48.069: I/dalvikvm(3131): | sysTid=3136 nice=0 sched=0/0 cgrp=default handle=1207328
09-11 11:19:48.069: I/dalvikvm(3131): at dalvik.system.NativeStart.run(Native Method)
09-11 11:19:48.069: I/dalvikvm(3131): "AsyncTask #2" prio=5 tid=10 RUNNABLE
09-11 11:19:48.069: I/dalvikvm(3131): | group="main" sCount=1 dsCount=0 obj=0x40511508 self=0x1d3338
09-11 11:19:48.069: I/dalvikvm(3131): | sysTid=3207 nice=0 sched=0/0 cgrp=default handle=1913968
09-11 11:19:48.069: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2Internal(Native Method)
09-11 11:19:48.069: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2(MuPDFCore.java:155)
09-11 11:19:48.069: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.gotoPage(MuPDFCore.java:77)
09-11 11:19:48.069: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getPageSize(MuPDFCore.java:84)
09-11 11:19:48.069: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:54)
09-11 11:19:48.069: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:1)
09-11 11:19:48.069: I/dalvikvm(3131): at android.os.AsyncTask$2.call(AsyncTask.java:185)
09-11 11:19:48.069: I/dalvikvm(3131): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
09-11 11:19:48.069: I/dalvikvm(3131): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
09-11 11:19:48.069: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
09-11 11:19:48.069: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
09-11 11:19:48.069: I/dalvikvm(3131): at java.lang.Thread.run(Thread.java:1019)
09-11 11:19:48.819: W/dalvikvm(3131): threadid=4: spin on suspend #6 threadid=10 (pcf=3)
09-11 11:19:48.819: I/dalvikvm(3131): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
09-11 11:19:48.819: I/dalvikvm(3131): | group="system" sCount=0 dsCount=0 obj=0x40510b68 self=0x173a38
09-11 11:19:48.819: I/dalvikvm(3131): | sysTid=3136 nice=0 sched=0/0 cgrp=default handle=1207328
09-11 11:19:48.819: I/dalvikvm(3131): at dalvik.system.NativeStart.run(Native Method)
09-11 11:19:48.819: I/dalvikvm(3131): "AsyncTask #2" prio=5 tid=10 RUNNABLE
09-11 11:19:48.819: I/dalvikvm(3131): | group="main" sCount=1 dsCount=0 obj=0x40511508 self=0x1d3338
09-11 11:19:48.819: I/dalvikvm(3131): | sysTid=3207 nice=0 sched=0/0 cgrp=default handle=1913968
09-11 11:19:48.829: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2Internal(Native Method)
09-11 11:19:48.829: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getText2(MuPDFCore.java:155)
09-11 11:19:48.829: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.gotoPage(MuPDFCore.java:77)
09-11 11:19:48.829: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFCore.getPageSize(MuPDFCore.java:84)
09-11 11:19:48.829: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:54)
09-11 11:19:48.829: I/dalvikvm(3131): at com.artifex.mupdf.MuPDFPageAdapter$1.doInBackground(MuPDFPageAdapter.java:1)
09-11 11:19:48.829: I/dalvikvm(3131): at android.os.AsyncTask$2.call(AsyncTask.java:185)
09-11 11:19:48.829: I/dalvikvm(3131): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
09-11 11:19:48.829: I/dalvikvm(3131): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
09-11 11:19:48.829: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
09-11 11:19:48.829: I/dalvikvm(3131): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
09-11 11:19:48.829: I/dalvikvm(3131): at java.lang.Thread.run(Thread.java:1019)
我從這個異常中得到了眼睛傷害:) – CloudyMarble
我發現崩潰的原因,這是由於內存不好管理。我分配了大量的內存並且沒有分配任何內存。解決方法是簡單地使用方法將本地類型的值傳遞迴java,而不是在JNI中分配任何內存。 – asloob