Skip to content

Conversation

@aperezdc
Copy link
Member

@aperezdc aperezdc commented Apr 8, 2025

Web Inspector resources now being shipped as a .gresource file instead of a shared library, which needed changes in the bootstrap script and setting the relevant environment variable. For now the .gresource file is installed along the injected bundle, as the shared library was previously, but this may change in the future.


Note this is expected to fail CI until bootstrap packages for the corresponding release are available. Bootstrap packages for 2.48.2 are now available 😄

@aperezdc aperezdc requested a review from neodesys April 8, 2025 02:29
@aperezdc
Copy link
Member Author

aperezdc commented Apr 8, 2025

This is marked as draft because fdsan reports a file descriptor being wrongly closed and I have not been able to track this down yet. We do funny things with file descriptors in WebKit and also in WPEBackend-android, so this might be a false positive.

Here's the top of the traceback.

04-08 06:35:07.611 28334 28334 F DEBUG   : Cmdline: org.wpewebkit.tools.minibrowser
04-08 06:35:07.611 28334 28334 F DEBUG   : pid: 28307, tid: 28307, name: ols.minibrowser  >>> org.wpewebkit.tools.minibrowser <<<
04-08 06:35:07.611 28334 28334 F DEBUG   : uid: 10262
04-08 06:35:07.611 28334 28334 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
04-08 06:35:07.611 28334 28334 F DEBUG   : Abort message: 'fdsan: attempted to close file descriptor 111, expected to be unowned, actually owned by ParcelFileDescriptor 0xfb12179'
04-08 06:35:07.611 28334 28334 F DEBUG   :     x0  0000000000000000  x1  0000000000006e93  x2  0000000000000006  x3  0000007ff5415440
04-08 06:35:07.611 28334 28334 F DEBUG   :     x4  631f646b68651f64  x5  631f646b68651f64  x6  631f646b68651f64  x7  7f7f7f7f7f7f7f7f
04-08 06:35:07.611 28334 28334 F DEBUG   :     x8  00000000000000f0  x9  c3483964e88b357e  x10 0000000000000000  x11 000000003b9ac9ff
04-08 06:35:07.611 28334 28334 F DEBUG   :     x12 0000000000000018  x13 000000dcc85513e2  x14 0001d3d5112156e0  x15 0000000000502292
04-08 06:35:07.611 28334 28334 F DEBUG   :     x16 00000079e1d53048  x17 00000079e1d3f240  x18 0000007a11774000  x19 0000000000006e93
04-08 06:35:07.611 28334 28334 F DEBUG   :     x20 0000000000006e93  x21 0000007a1075ba80  x22 0000000000000003  x23 0000007ff5415238
04-08 06:35:07.611 28334 28334 F DEBUG   :     x24 0000007ff5415530  x25 0000007ff54151b0  x26 0000007ff5415170  x27 ffffff80ffffffc8
04-08 06:35:07.611 28334 28334 F DEBUG   :     x28 00000078884e07a0  x29 0000007ff54154d0
04-08 06:35:07.611 28334 28334 F DEBUG   :     lr  00000079e1ce3d98  sp  0000007ff54150f0  pc  00000079e1ce3dbc  pst 0000000000000000
04-08 06:35:07.611 28334 28334 F DEBUG   : 222 total frames
04-08 06:35:07.611 28334 28334 F DEBUG   : backtrace:
04-08 06:35:07.611 28334 28334 F DEBUG   :       #00 pc 0000000000060dbc  /apex/com.android.runtime/lib64/bionic/libc.so (fdsan_error(char const*, ...)+560) (BuildId: d2b63e277d4fb6976635d39171f71be5)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #01 pc 0000000000060ac8  /apex/com.android.runtime/lib64/bionic/libc.so (android_fdsan_close_with_tag+828) (BuildId: d2b63e277d4fb6976635d39171f71be5)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #02 pc 0000000000061254  /apex/com.android.runtime/lib64/bionic/libc.so (close+16) (BuildId: d2b63e277d4fb6976635d39171f71be5)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #03 pc 000000000230d2e8  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEWebKit-2.0.so (BuildId: 9cb944604208f215dcae9f25926f02a808a9532f)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #04 pc 000000000216a6b4  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEWebKit-2.0.so (BuildId: 9cb944604208f215dcae9f25926f02a808a9532f)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #05 pc 000000000230ec18  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEWebKit-2.0.so (BuildId: 9cb944604208f215dcae9f25926f02a808a9532f)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #06 pc 000000000230ddbc  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEWebKit-2.0.so (BuildId: 9cb944604208f215dcae9f25926f02a808a9532f)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #07 pc 00000000023339f0  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEWebKit-2.0.so (BuildId: 9cb944604208f215dcae9f25926f02a808a9532f)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #08 pc 0000000002348d18  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEWebKit-2.0.so (BuildId: 9cb944604208f215dcae9f25926f02a808a9532f)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #09 pc 0000000002289754  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEWebKit-2.0.so (BuildId: 9cb944604208f215dcae9f25926f02a808a9532f)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #10 pc 0000000000036034  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libgobject-2.0.so
04-08 06:35:07.611 28334 28334 F DEBUG   :       #11 pc 0000000000035e48  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libgobject-2.0.so (g_object_new_valist+864)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #12 pc 0000000000035974  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libgobject-2.0.so (g_object_new+100)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #13 pc 0000000000089c74  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEAndroidRuntime.so (WKNetworkSession::WKNetworkSession(_
JNIEnv*, _JNIWKNetworkSession*, WKWebContext*, bool, char const*, char const*)+284) (BuildId: 64f1f6627ef550a2abb2a77a07d6b981ab522aa4)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #14 pc 00000000000896cc  /data/app/~~rOAinululv7YamJVhf0YsA==/org.wpewebkit.tools.minibrowser-xq1Xch9I6w8tDGVR35zPvw==/lib/arm64/libWPEAndroidRuntime.so (JNIWKNetworkSessionCache::nativeInit(_JNIEnv*, _jobject*, long, unsigned char, _jstring*, _jstring*)+284) (BuildId: 64f1f6627ef550a2abb2a77a07d6b981ab522aa4)
04-08 06:35:07.611 28334 28334 F DEBUG   :       #15 pc 000000000040c900  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 834808097feb70e98ed7d66cc1b1be8a)

Copy link
Collaborator

@neodesys neodesys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is just a ParcelFile handle that is not released when shutting down the app this should not be a big issue. I think you can merge it as it is. Maybe open an issue with this bug to keep track of it. But normally it should be cleaned by the Android system when the app is shut down.

@aperezdc
Copy link
Member Author

If it is just a ParcelFile handle that is not released when shutting down the app this should not be a big issue. I think you can merge it as it is. Maybe open an issue with this bug to keep track of it. But normally it should be cleaned by the Android system when the app is shut down.

Unfortunately this happens during startup and we never get to see anything rendered before the crash. There are a few of the changes from Igalia/wpe-android-cerbero#57 which I should be able to do separately so I am going to try and split the big PR with the 2.48 update, maybe that helps isolate the change that brings in the issue.

As a separate, but complimentary thought, we may want to use the fdsan API to make it aware of what our code does with the file descriptors, in case it might help.

@janbajana
Copy link

Hi @aperezdc, I'm testing your PR on my Android device. I'm also encountering the same FD error after launching MiniBrowser. I've attached the trace for reference (missing symbols from libWPEWebKit-2.0.so):
webview-android-log.txt

I am running on: Android 14, SDK level 34, Samsung Galaxy S24+.
If someone gets it working, could you also test it further with HTTPS pages and verify the handling of TLS root certificates on Andorid?
Thank you.

Web Inspector resources now being shipped as a .gresource file instead
of a shared library, which needed changes in the bootstrap script and
setting the relevant environment variable. For now the .gresource file
is installed along the injected bundle, as the shared library was
previously, but this may change in the future.
@aperezdc aperezdc force-pushed the aperezdc/wpewebkit-2.48 branch from 10abc37 to 88b0908 Compare May 26, 2025 18:46
@aperezdc aperezdc changed the title [wpe] Update to WPE WebKit 2.48.1 [wpe] Update to WPE WebKit 2.48.2 May 26, 2025
@aperezdc aperezdc self-assigned this May 26, 2025
@aperezdc
Copy link
Member Author

We have workarounded solved the fdsan issue with a small revert added as part of Igalia/wpe-android-cerbero#67 I have updated this to use WPE WebKit 2.48.2 accordingly.

@aperezdc aperezdc marked this pull request as ready for review May 26, 2025 18:50
@aperezdc aperezdc merged commit dcb528e into main May 26, 2025
6 checks passed
@aperezdc aperezdc deleted the aperezdc/wpewebkit-2.48 branch May 26, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants