TomRoush / PdfBox-Android

The Apache PdfBox project ported to work on Android
Apache License 2.0
1.02k stars 263 forks source link

在Android 6设备中还是有StackOverflowError问题 #574

Open panyingdaoz opened 4 months ago

panyingdaoz commented 4 months ago

Describe the bug A clear and concise description of what the bug is.

To reproduce Code snippet to reproduce the behavior:

System.out.println("Hello world");

PDF example Link or attach a PDF demonstrating the issue

Expected behavior A clear and concise description of what you expected to happen.

Actual behavior A clear and concise description of what happened instead.

Environment details:

Additional context Add any other context about the problem here.

刚刚开始还正常,使用模版导出基础后就每次都会出现StackOverflowError错误

panyingdaoz commented 4 months ago

当前使用源码跑也一样,错误如下:2024-06-27 11:31:37.568 26762-26762 AndroidRuntime com.tom_roush.pdfbox.sample E FATAL EXCEPTION: main Process: com.tom_roush.pdfbox.sample, PID: 26762 java.lang.IllegalStateException: Could not execute method for android:onClick at android.view.View$DeclaredOnClickListener.onClick(View.java:4458) at android.view.View.performClick(View.java:5204) at android.view.View$PerformClick.run(View.java:21153) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at android.view.View$DeclaredOnClickListener.onClick(View.java:4453) at android.view.View.performClick(View.java:5204)  at android.view.View$PerformClick.run(View.java:21153)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632)  Caused by: java.lang.StackOverflowError: stack size 8MB at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFile.java:161) at java.io.RandomAccessFile.read(RandomAccessFile.java:272) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.fillBuffer(BufferedRandomAccessFile.java:115) at com.tom_roush.fontbox.ttf.BufferedRandomAccessFile.read(BufferedRandomAccessFi

Tlanglord commented 4 months ago

Describe the bug A clear and concise description of what the bug is.

To reproduce Code snippet to reproduce the behavior:

System.out.println("Hello world");

PDF example Link or attach a PDF demonstrating the issue

Expected behavior A clear and concise description of what you expected to happen.

Actual behavior A clear and concise description of what happened instead.

Environment details:

  • PdfBox-Android version: [e.g. 2.0.27.0]
  • Android API version: [e.g. API 23]

Additional context Add any other context about the problem here.

刚刚开始还正常,使用模版导出基础后就每次都会出现StackOverflowError错误

此项目貌似没人维护了

THausherr commented 2 months ago

Please add minimum code that reproduces the behaviour and the PDF file. I strongly believe that calling System.out.println("Hello world"); does not cause a stack overflow.