-
-
Notifications
You must be signed in to change notification settings - Fork 177
dlopen failed: cannot locate symbol "_Unwind_Resume" #705
Comments
Problem: When installing Leveldown on the Google Pixel XL I noticed that it's complaining that it cannot locate symbol "_Unwind_Resume". Solution: I don't know why this is happening, but I'm wondering whether a prebuild would solve the problem. This commit adds Android ARMv8 support, which I *think* should work as a prebuild on my device. I'm a bit out of my element and wouldn't be surprised if this is the wrong move. See: Level/leveldown#705
Problem: When installing Leveldown on the Google Pixel XL I noticed that it's complaining that it cannot locate symbol "_Unwind_Resume". Solution: I don't know why this is happening, but I'm wondering whether a prebuild would solve the problem. This commit adds Android ARMv8 support, which I *think* should work as a prebuild on my device. I'm a bit out of my element and wouldn't be surprised if this is the wrong move. See: Level/leveldown#705
I put together a PR for ARMv8 support, because I saw this:
But the more I think about it, I'm wondering whether I'm already covered because |
See prebuild/docker-images#14 (comment). Can you try building from source? It might be a gcc mismatch of some sort. |
Just built from source and I'm having the same problem, which is surprising. I was able to clone Level/level (e5f8e61) and $ npm ls leveldown
@fraction/oasis@2.13.1 /home/christianbundy/src/fraction/oasis
└─┬ @fraction/flotilla@4.0.0
└─┬ ssb-blobs@1.2.2
└─┬ level@5.0.1
└── leveldown@5.4.1 Here's the full log: There were some copy and paste problems toward the end, maybe from the escape codes used for colors in various postinstall text, so if anything looks funky that's why. I'm going to try downgrading to the Node.js LTS package and see if that helps at all. |
WAIT I'm a big dummy and I was running |
Can you summarize what works and what doesn't? |
When running My new confusion is that if I try to Note: in the interests of sanity, I've switched to Node.js LTS (12), but I've also cleaned my npm cache and removed all of my |
That is as expected:
Snappy is a git submodule. You may have to |
As for why the prebuild is broken, let's find out what /* Resume propagation of an existing exception. This is used after
e.g. executing cleanup code, and not to implement rethrowing. */
extern void LIBGCC2_UNWIND_ATTRIBUTE
_Unwind_Resume (struct _Unwind_Exception *); We disable exceptions though, so I would not expect Line 33 in 3e1177d
Maybe dockcross sets some flag that overrides this? Maybe we need to set additional flags like @ralphtheninja any clue? @christianbundy Can you send your
|
We could start by checking the verbose output during compile time, e.g. |
This line seems to indicate that we explicitly set exceptions for Android leveldown/deps/leveldb/leveldb.gyp Line 170 in 3e1177d
The |
Oh right, I forgot about that. What's the difference between |
@#$@#$% knows. We need to do some |
Output of Noteworthy:
Extract of one of the compiled leveldb files:
|
The "!" means: exclude |
So maybe then we should take care to link with whatever is needed. |
And add |
I'd like to explore the option of disabling exceptions for all platforms. As far as I can tell we don't need them (anymore?). |
Sweet. I assumed that it would either use a prebuild or compile from source, but didn't realize there was a smoke test going on.
Love it, thanks. I should've kept scrolling.
On it. Thanks for the instructions! |
Here's the difference in the symbol tables between your build (A) and the prebuild (B). In A, the In B, the
|
@christianbundy For further clues, can you provide the output of |
Maybe at this point we should just test a few different prebuilds. One without exceptions, one with a statically linked |
$ cc -v
clang version 9.0.1
Target: aarch64-unknown-linux-android
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
$ env
SHELL=/data/data/com.termux/files/usr/bin/bash
PREFIX=/data/data/com.termux/files/usr
PWD=/data/data/com.termux/files/home
EXTERNAL_STORAGE=/sdcard
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
HOME=/data/data/com.termux/files/home
LANG=en_US.UTF-8
ANDROID_RUNTIME_ROOT=/apex/com.android.runtime
TMPDIR=/data/data/com.termux/files/usr/tmp
ANDROID_DATA=/data
TERM=xterm-256color
SHLVL=1
ANDROID_ROOT=/system
BOOTCLASSPATH=/apex/com.android.runtime/javalib/core-oj.jar:/apex/com.android.runtime/javalib/core-libart.jar:/apex/com.android.runtime/javalib/okhttp.jar:/apex/com.android.runtime/javalib/bouncycastle.jar:/apex/com.android.runtime/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.test.base.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.media/javalib/updatable-media.jar
ANDROID_TZDATA_ROOT=/apex/com.android.tzdata
PATH=/data/data/com.termux/files/home/.npm-global/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
_=/data/data/com.termux/files/usr/bin/env |
I installed termux just now, with |
Hmm, interesting. Maybe try |
(termux is awesome, btw. first time i tried it) |
Same with node 13. So..
@christianbundy would you trust a binary I'd send, or do you want to compile it yourself? |
I'd trust a binary, but if it's easier for you I can also compile from source. Makes no difference to me. |
A build without exceptions (compiled on To test, run the following commands in an empty directory: npm i leveldown --ignore-scripts --no-save
curl -OL https://github.com/Level/leveldown/files/4238293/node.napi.armv8.tar.gz
tar -zxvf node.napi.armv8.tar.gz
# Make sure prebuilds are not loaded
rm -rf node_modules/leveldown/prebuilds
mkdir -p node_modules/leveldown/build/Release
mv node.napi.armv8.node node_modules/leveldown/build/Release/leveldown.node
node -e "require('leveldown')('db').open(console.log)" |
$ npm i leveldown --ignore-scripts --no-save
npm WARN npm npm does not support Node.js v13.0.0
npm WARN You should probably upgrade to a newer version of node as we
npm WARN can't make any promises that npm will work with this version.
npm WARN Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN You can find the latest version at https://nodejs.org/
npm WARN enoent ENOENT: no such file or directory, open '/data/data/com.termux/files/home/level-test/package.json'
npm WARN level-test No description
npm WARN level-test No repository field.
npm WARN level-test No README data
npm WARN level-test No license field.
+ leveldown@5.4.1
added 7 packages from 5 contributors in 3.16s
found 0 vulnerabilities
$ curl -OL https://github.com/Level/leveldown/files/4238293/node.napi.armv8.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:-100 147k 100 147k 0 0 82810 0 0:00:01 0:00:01 --:--:-- 216k
$ tar -zxvf node.napi.armv8.tar.gz
node.napi.armv8.node
$
$ # Make sure prebuilds are not loaded
$ rm -rf node_modules/leveldown/prebuilds
$
$ mkdir -p node_modules/leveldown/build/Release
$ mv node.napi.armv8.node node_modules/leveldown/build/Release/leveldown.node
$ node -e "require('leveldown')('db').open(console.log)" No output. That's good, right? 🙃 |
try |
$ ls
db node.api.armv8.tar.gz node_modules !!! You did it. Thanks so much for all the work you've put into this issue. |
Aye, I don't see why they should be enabled on Android but not on other platforms. |
Thanks again! |
Hi! I'm trying to use leveldown on my Android device via Termux, but I'm bumping into this error. Any chance someone knows what this problem might be? I'm using leveldown 5.4.1 on a Google Pixel XL.
The text was updated successfully, but these errors were encountered: