dropbox / djinni

A tool for generating cross-language type declarations and interface bindings.
Apache License 2.0
2.88k stars 487 forks source link

Bug in jstr in production app #396

Closed paulocoutinhox closed 5 years ago

paulocoutinhox commented 6 years ago

Hi,

I put our first app using djinni in production and now im getting more than 500 errors about this:

image

Can anyone help me? I think it trying to start a string but something is wrong in this part. But it work in the most devices.

artwyman commented 6 years ago

What branch/version is your version of the support lib coming from? I looked at djinni_support.cpp:491 and it doesn't match up to an assert with that message. I'd guess it might be coming from something like this: https://github.com/dropbox/djinni/blob/master/support-lib/jni/djinni_support.cpp#L525

My first guess would be that you're passing a null String to a function which isn't expecting one (i.e. declared in Djinni to take string not optional). It would probably be clearer if those asserts could throw NullPointerException, but all the asserts in C++ code just throw a generic Error, with the message being the assert expression which was false.

paulocoutinhox commented 6 years ago

I using the version before the last merge with jni flags:

https://github.com/ezored/dependency-djinni-support/blob/1.0.0/build/support-lib/jni/djinni_support.cpp#L491

I dont upload the latest version with jni flags. I will do it in some days.

I want understand the problem only to fix it before send the new version.

artwyman commented 6 years ago

That's the same line I theorized, so I stand by my theory that somewhere up the callstack you're likely passing a null string.

paulocoutinhox commented 6 years ago

is the same thing I was thinking, but I do not have anything in the code that could return a null string at this point, so I thought it was strange. Anyway I will validate the Android functions that return things from the system to see.

I will post here the updates.