https://tracker.crystax.net/https://tracker.crystax.net/favicon.ico?15359200272015-11-06T16:46:24ZIssue trackerCrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=24972015-11-06T16:46:24ZDmitry M.dm@crystax.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>In Progress</i></li></ul> CrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=24982015-11-06T16:46:47ZDmitry M.dm@crystax.net
<ul><li><strong>Is duplicate of</strong> <i><a class="issue tracker-1 status-41 priority-4 priority-high2" href="/issues/1107">Bug #1107</a>: Standalone executables built with CrystaX 10.2.1 crash on Marshmallow</i> added</li></ul> CrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=25772015-11-16T15:38:21ZDmitry M.dm@crystax.net
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Duplicated</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Closing as duplicate</p>
CrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=25792015-11-16T15:39:58ZDmitry M.dm@crystax.net
<ul><li><strong>Status</strong> changed from <i>Duplicated</i> to <i>Open</i></li><li><strong>Target version</strong> changed from <i>10.3.0</i> to <i>11.0.0</i></li><li><strong>% Done</strong> changed from <i>100</i> to <i>0</i></li></ul> CrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=25802015-11-16T15:51:24ZDmitry M.dm@crystax.net
<ul></ul><p>This crash happens because of hybrid libcrystax + libc scheme of linking in CrystaX NDK. Part of standard functions is implemented in libcrystax, and remaining part is in libc. In particular, whole stdio is implemented in libcrystax and is not binary compatible with Google's stdio implementation, where @FILE@ structure has different size and layout. On previous Android versions, it was working fine, but in Android 6.0, the following code was added to Bionic:</p>
<p>fclose(stdin);<br>
fclose(stdout);<br>
fclose(stderr);</p>
<p>This code is called inside finalization functions, and it call libcrystax's @fclose@ with Bionic's @stdin@, @stdout@ and @stderr@, which are binary incompatible with libcrystax's @FILE@.</p>
<p>The only way to fix it is to avoid usage of Google's libc at all, and provide full libc functionality in libcrystax. This work is in progress, but not yet done. However, this crash doesn't look very critical, since it happens only at normal exit, and this never happen for typical Android application, where native part is shared library, loaded by Dalvik (or ART). Taking this into account, moving this ticket to the next release (10.4.0).</p>
CrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=26032015-11-24T17:08:59ZDmitry M.dm@crystax.net
<ul><li><strong>Blocked by</strong> <i><a class="issue tracker-4 status-5 priority-4 priority-high2 closed" href="/issues/1165">Task #1165</a>: Get rid of libc.so and replace it completely by libcrystax.so</i> added</li></ul> CrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=32012016-05-06T17:40:22ZDmitry M.dm@crystax.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>In Progress</i></li></ul> CrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=32232016-05-18T18:08:28ZDmitry M.dm@crystax.net
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>CrystaX NDK Version</strong> set to <i>10.3.1</i></li></ul> CrystaX NDK - Bug #1108: Crash on Android 6.0https://tracker.crystax.net/issues/1108?journal_id=33622016-07-20T17:46:00ZRoman L.
<ul></ul><p>The libraries built with Crystax NDK still crash when used with Qt, so I guess using static <em>everything</em> is not a proper way to fix that.<br>
Actually, it doesn't matter whether you are linking to Qt libraries, or something else (like -llog or -landroid or -lexclusive_library_that_cannot_be_rebuilt_with_crystax), it will crash anyway.<br>
This bug should be probably reopened, if Crystax NDK is planned to be a drop in replacement for Android NDK, but I'm not sure if it is reasonable to fix that considering an amount of the work required.<br>
Overall, this bug makes Crystax NDK unusable at least for me.</p>