Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNI ERROR (app bug): local reference table overflow (max=512) #41

Open
wmailn opened this issue Jul 12, 2023 · 1 comment
Open

JNI ERROR (app bug): local reference table overflow (max=512) #41

wmailn opened this issue Jul 12, 2023 · 1 comment

Comments

@wmailn
Copy link

wmailn commented Jul 12, 2023

Hi:
First of all, I am sorry that I did not give feedback according to the format requirements, because I used a mobile phone to edit, it is difficult to translate and edit according to the format at the same time.
I'm using the latest version at (5.2.0).
When I frequently switch between the preview window and the remote video window, I find that it crashes, and some error messages are as follows:

Line 33381: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Window released for windowId 0x0
Line 33383: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Surface released for windowId 0x0
Line 33385: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Surface destroyed for windowId 0x0
Line 33387: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Context destroyed for windowId 0x0
Line 33389: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863e08] Initializing context for windowId 0x200daa
Line 33391: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] New windowId jobject ptr is 0x100dda, current one is 0x0
Line 33393: 07-12 17:21:19.426 I/Linphone(14219): [TextureView Display][Filter=0xae863f58] Took global ref on 0x100dda, windowId is now 0x200dca, scheduling creation
Line 33395: 07-12 17:21:19.426 D/Linphone(14219): --caltta--lc---[M:setNativeVideoWindowId]: end ...
Line 33397: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] JNI ERROR (app bug): local reference table overflow (max=512)
Line 33399: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] local reference table dump:
Line 33401: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] Last 10 entries (of 512):
Line 33403: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 511: 0x714e6d88 java.lang.Class<android.view.Surface>
Line 33405: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 510: 0x12e202c0 android.view.Surface
Line 33407: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 509: 0x12ea6340 android.graphics.SurfaceTexture
Line 33409: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 508: 0x12e113c0 android.view.Surface
Line 33411: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 507: 0x12e0faf0 android.graphics.SurfaceTexture
Line 33413: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 506: 0x714e6d88 java.lang.Class<android.view.Surface>
Line 33415: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 505: 0x714e6d88 java.lang.Class<android.view.Surface>
Line 33417: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 504: 0x12eae080 android.view.Surface
Line 33419: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 503: 0x12f6f760 android.graphics.SurfaceTexture
Line 33421: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 502: 0x12eae040 android.view.Surface
Line 33423: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] Summary:
Line 33425: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 172 of java.lang.Class (2 unique instances)
Line 33427: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 170 of android.view.Surface (170 unique instances)
Line 33429: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98] 170 of android.graphics.SurfaceTexture (170 unique instances)
Line 33431: 07-12 17:21:19.426 F/art (14219): art/runtime/indirect_reference_table.cc:98]

@wmailn
Copy link
Author

wmailn commented Jul 12, 2023

I tried to fix the problem by adding the following method at the end of method "android_texture_display_set_window()" of file "android-texture-display.c":

(*env)->DeleteLocalRef(env, surfaceTextureClass);
(*env)->DeleteLocalRef(env, surfaceClass);
(*env)->DeleteLocalRef(env, textureViewClass);
(*env)->DeleteLocalRef(env, surface);
(*env)->DeleteLocalRef(env, windowId);

I don't know if there will be other exceptions with this modification, but this modification has solved my problem. If it is the correct solution, I hope you can fix it next time.

If this modification is wrong, I hope you can tell me the correct way to modify it.

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant