erthink / libmdbx

One of the fastest embeddable key-value ACID database without WAL. libmdbx surpasses the legendary LMDB in terms of reliability, features and performance.
https://erthink.github.io/libmdbx/
Other
1.16k stars 111 forks source link

mdbx_env_open returns error 22 (Invalid argument) on 32-bit Android devices #262

Closed simc closed 2 years ago

simc commented 2 years ago

I tried to open an environment (with and) without any options or flags (mode 0600) all 64-bit targets work without issues but on older 32-bit Android devices I get error 22 when opening an environment.

erthink commented 2 years ago

Presumably the problem is that 32-bit android kernels do not allow you to create large-size memory mappings. Please try create/open a small sized DB, about of 1 Mb.

simc commented 2 years ago

I tried not setting the geometry. Isn't the default size pretty small?

erthink commented 2 years ago

I tried not setting the geometry. Isn't the default size pretty small?

Should be.

Could you run your exe/application, or a minimal testcase, under the strace ?

simc commented 2 years ago

Unfortunately that doesn't work on Android. The debugging options for native code are very limited (non-existent?).

I hoped you might have an idea what could be wrong but I understand that it's difficult without more information.

erthink commented 2 years ago

I hoped you might have an idea what could be wrong but I understand that it's difficult without more information.

No ideas, except the mapping size may made behavior significantly difference under a 32- and 64-bit environments.

erthink commented 2 years ago

Please try this. There is no other reasonable way.

simc commented 2 years ago

Oh that's cool. But it requires a rooted 32-bit device. Will take me some time to get it. I'll post my findings here :+1:

erthink commented 2 years ago

Please write down what you got. Otherwise, there is a risk that I will significantly postpone fixing this issue, even if it will be confirmed.

simc commented 2 years ago

Sorry, I still don't have a 32-bit Android device. It's no problem if the fix takes a little longer 🙂

erthink commented 2 years ago

Sorry, I still don't have a 32-bit Android device. It's no problem if the fix takes a little longer slightly_smiling_face

Assume the AVD will enough, but not sure.