Skip to content

Commit

Permalink
lj_clib: specify a version of Android in the note
Browse files Browse the repository at this point in the history
where a crash was recognized for what workaround was developed
  • Loading branch information
Wohlstand committed Oct 24, 2019
1 parent 188ef59 commit c37be68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lj_clib.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ static void *clib_loadlib(lua_State *L, const char *name, int global)
RTLD_LAZY | (global?RTLD_GLOBAL:RTLD_LOCAL));
if (!h) {
const char *e, *err = dlerror();
/* Per the standard definition of `dlerror`, this should always be safe, but we have
* observed `dlerror()` returning NULL on Android 7.1.1 SDK 25 (Oculus Quest) anyway,
* which causes a crash. */
if (err && *err == '/' && (e = strchr(err, ':')) &&
(name = clib_resolve_lds(L, strdata(lj_str_new(L, err, e-err))))) {
h = dlopen(name, RTLD_LAZY | (global?RTLD_GLOBAL:RTLD_LOCAL));
Expand Down

0 comments on commit c37be68

Please sign in to comment.