Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebird 5 crash on Android API level 34 #8110

Closed
hgourvest opened this issue May 9, 2024 · 15 comments
Closed

Firebird 5 crash on Android API level 34 #8110

hgourvest opened this issue May 9, 2024 · 15 comments

Comments

@hgourvest
Copy link

Steps to reproduce.

  1. Get Android sample app from here and open it with Android Studio.
  2. Install Android embedded version Firebird-5.0.0.1306-0-android-embedded.aar in the app/libs folder.
  3. Follow the instructions in the README file
  4. Create a virtual device using an API 34-level image.
  5. Run the application on the virtual device.
  6. It should crash on "attachDatabase"

The problem also occurs on a physical device. I have not been able to reproduce the problem on versions below 34.

Logcat

2024-05-09 19:02:46.690  7036-7036  libc                    com.example.firebirdandroidcpp       A  FORTIFY: fcntl(F_SETFD) passed non-FD_CLOEXEC flag: 0x80000
2024-05-09 19:02:46.690  7036-7036  libc                    com.example.firebirdandroidcpp       A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7036 (ebirdandroidcpp), pid 7036 (ebirdandroidcpp)
2024-05-09 19:02:46.697  7036-7058  libEGL                  com.example.firebirdandroidcpp       D  loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2024-05-09 19:02:46.703  7036-7058  libEGL                  com.example.firebirdandroidcpp       D  loaded /vendor/lib64/egl/libGLESv2_emulation.so
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A  Cmdline: com.example.firebirdandroidcpp
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A  pid: 7036, tid: 7036, name: ebirdandroidcpp  >>> com.example.firebirdandroidcpp <<<
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #03 pc 00000000002ce70d  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #04 pc 00000000002ce87b  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #05 pc 00000000002e6b9c  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #06 pc 00000000002e6ab6  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #07 pc 00000000002e5dc1  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #08 pc 00000000002e5c90  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #09 pc 00000000002e37f8  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #10 pc 00000000002e47cf  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #11 pc 00000000001cc638  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #12 pc 0000000000199b80  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #13 pc 000000000017cd55  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #14 pc 000000000013a3b5  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfbclient.so (offset 0x1c13000)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #15 pc 0000000000016072  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfirebirdandroidcpp.so (offset 0x16d4000) (Firebird::IAttachment* Firebird::IProvider::attachDatabase<Firebird::ThrowStatusWrapper>(Firebird::ThrowStatusWrapper*, char const*, unsigned int, unsigned char const*)+130) (BuildId: 327bca5327550877c0268fdff5881f1b0b0ff98c)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #16 pc 000000000001546c  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfirebirdandroidcpp.so (offset 0x16d4000) (BuildId: 327bca5327550877c0268fdff5881f1b0b0ff98c)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #17 pc 000000000001537f  /data/app/~~f4E1jxoFewkjflbT_SUu4Q==/com.example.firebirdandroidcpp-y7YDymswvBk_oO-hNZNNxQ==/base.apk!libfirebirdandroidcpp.so (offset 0x16d4000) (Java_com_example_firebirdandroidcpp_MainActivity_connect+63) (BuildId: 327bca5327550877c0268fdff5881f1b0b0ff98c)
2024-05-09 19:02:47.074  7062-7062  DEBUG                   pid-7062                             A        #24 pc 0000000000000598  <anonymous:794264600000> (com.example.firebirdandroidcpp.MainActivity.onCreate+0)
@hgourvest
Copy link
Author

hgourvest commented May 9, 2024

I think it's linked to this code in Firebird

the crash would be triggered by this change in Android AOSP

more info here

@hvlad
Copy link
Member

hvlad commented May 14, 2024

Could you try to build with change O_CLOEXEC by FD_CLOEXEC ?

@hgourvest
Copy link
Author

I've never compiled Firebird, so if you can point me in the right direction for Android, I'd like to give it a try.

@hvlad
Copy link
Member

hvlad commented May 14, 2024

Sorry, I was under impression that you build FB yourself.
Another idea - I can commit this change at separate branch and you should be able to use snapshot build of that branch.
Is it OK for you ?

@hgourvest
Copy link
Author

that would be perfect, I have a concurrent access test to the client library, that should allow me to validate this modification.

@AlexPeshkoff
Copy link
Member

AlexPeshkoff commented May 14, 2024 via email

@hvlad
Copy link
Member

hvlad commented May 14, 2024

Already pushed the branch with it :)
The build artifacts will be available here soon
https://github.com/FirebirdSQL/firebird/actions/runs/9081677086

@AlexPeshkoff
Copy link
Member

AlexPeshkoff commented May 14, 2024 via email

@hvlad
Copy link
Member

hvlad commented May 14, 2024

Android builds are ready.

@hgourvest
Copy link
Author

Thank you very much, I'll test this on as many architectures as possible and report back.

@hgourvest
Copy link
Author

As far as I can tell, it works on Linux (x86_64), Mac Os (x86_64, aarch64), Android (armv7, armv8, x86_64).

@hvlad
Copy link
Member

hvlad commented May 15, 2024

Thank you for investigating the problem and testing the fix

@ViktorVDev
Copy link

We have reproduced the issue in the release version of Firebird 4. We couldn't find a download link for Firebird snapshots for Android. If you can send us a download link when you fix the issue for Firebird 4 - we'll test it.

@StanTody
Copy link

StanTody commented May 29, 2024

We faced the same problem with FireBird client 3.0.11 for Android - will the fix be backported to FB 3 ?

@hvlad
Copy link
Member

hvlad commented May 29, 2024

Backported into 3.0.12 and 4.0.5

@mrotteveel mrotteveel changed the title Firebird 5 crash On Android API level 34 Firebird 5 crash on Android API level 34 Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment