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) while executing Couchbae Lite Query #1008

Closed
konbernu opened this issue Feb 6, 2017 · 2 comments

Comments

@konbernu
Copy link

konbernu commented Feb 6, 2017

I have a problem while i m executing a Couchbase Lite Query.

I m doing the following:

row_enumerator = request_query.run()
while row_enumerator.hasNext():
	row=row_enumerator.next()
	row_id=row.getDocumentId()
        row_key_raw = row.getKey()
        etc....

The Class of row is Couchbase QueryRow.

In each loop I transform the row value (HashMap/Map/ArrayList/LazyArrayList) to json string with jackson-databind.

This error comes in the while loop:

02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115] JNI ERROR (app bug): local reference table overflow (max=512)
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115] local reference table dump:
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]   Last 10 entries (of 512):
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       511: 0x7162ae98 java.lang.Class<java.lang.Class>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       510: 0x1311ff10 java.lang.Class<com.couchbase.lite.QueryRow>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       509: 0x7164dbb0 java.lang.Class<java.lang.Integer>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       508: 0x7164dbb0 java.lang.Class<java.lang.Integer>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       507: 0x7164dbb0 java.lang.Class<java.lang.Integer>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       506: 0x7164dbb0 java.lang.Class<java.lang.Integer>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       505: 0x7164dbb0 java.lang.Class<java.lang.Integer>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       504: 0x7164dbb0 java.lang.Class<java.lang.Integer>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       503: 0x7164dbb0 java.lang.Class<java.lang.Integer>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       502: 0x7164dbb0 java.lang.Class<java.lang.Integer>
02-06 15:57:04.933 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]   Summary:
02-06 15:57:04.943 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]         1 of com.couchbase.lite.QueryRow
02-06 15:57:04.943 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]       510 of java.lang.Class (56 unique instances)
02-06 15:57:04.943 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115]         1 of java.lang.Thread
02-06 15:57:04.943 30996-31045/org.example.myapp A/art: art/runtime/indirect_reference_table.cc:115] 
02-06 15:57:05.233 30996-31002/org.example.myapp W/art: Suspending all threads took: 296.012ms
02-06 15:57:05.263 30996-31045/org.example.myapp A/art: art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count
02-06 15:57:05.263 30996-31045/org.example.myapp A/art: art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail!
02-06 15:57:05.263 30996-31045/org.example.myapp A/art: art/runtime/runtime.cc:366] 
02-06 15:57:05.693 30996-31045/org.example.myapp W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
02-06 15:57:05.693 30996-31045/org.example.myapp W/google-breakpad: Chrome build fingerprint:
02-06 15:57:05.693 30996-31045/org.example.myapp W/google-breakpad: 147.5
02-06 15:57:05.693 30996-31045/org.example.myapp W/google-breakpad: 14705
02-06 15:57:05.693 30996-31045/org.example.myapp W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
02-06 15:57:05.693 30996-31045/org.example.myapp A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 31045 (PythonThread)

@inclement
Copy link
Member

inclement commented Feb 7, 2017

I think you're hitting the hard limit on the number of JNI references, which unfortunately we can't control. There's some discussion for how to work around this in various places - I found http://stackoverflow.com/a/20918022/2469283 which looks potentially useful.

Unfortunately this is a limitation of JNI and not something we can change, so I'm going to close this issue. It might be worth opening one about the problem in the Pyjnius repo though - even if we can't fix it in general, it might generate some useful discussion or at least an addition to the pyjnius docs about the problem.

@konbernu
Copy link
Author

I am sorry, i forgot to mention that I can run the Query multiple times correcty, before it crashes down. So the issue is probably in https://github.com/kivy/pyjnius/blob/master/jnius/jnius_conversion.pxi .

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

2 participants