Skip to content

Conversation

@jonahgraham
Copy link
Contributor

When a library function fails to load, the JNI wrapper returns 0 (or similar) for that function. There is no way to tell from the Java side that the function failed to work.

This change prints a g_critical error so that it is somewhat detectable, at least by SWT devs, that something has gone wrong in the implementation.

Ideally I would throw an unsatisfied link exception or something similar, but that would change a potentially minor error into a show stopper. For example, if we threw an exception the simple memory leak fixed in #2704 would have been throwing an exception all this time instead of silently not freeing the memory.

This change is especially useful as we work on GTK4 which includes lots of breaking API changes in webkit.

When a library function fails to load, the JNI wrapper returns 0 (or
similar) for that function. There is no way to tell from the Java
side that the function failed to work.

This change prints a g_critical error so that it is somewhat detectable,
at least by SWT devs, that something has gone wrong in the implementation.

Ideally I would throw an unsatisfied link exception or something similar,
but that would change a potentially minor error into a show stopper. For
example, if we threw an exception the simple memory leak fixed in
eclipse-platform#2704 would
have been throwing an exception all this time instead of silently not
freeing the memory.

This change is especially useful as we work on GTK4 which includes lots
of breaking API changes in webkit.
@akurtakov
Copy link
Member

Rebased on master for the sake of unbreaking verification build.

@github-actions
Copy link
Contributor

Test Results

  118 files  ±0    118 suites  ±0   17m 2s ⏱️ +49s
4 650 tests ±0  4 632 ✅  - 1  17 💤 ±0  1 ❌ +1 
  330 runs  ±0    326 ✅ ±0   4 💤 ±0  0 ❌ ±0 

For more details on these failures, see this check.

Results for commit 6bea783. ± Comparison against base commit 27f1d6c.

Copy link
Member

@akurtakov akurtakov left a comment

Choose a reason for hiding this comment

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

I like the approach.

@jonahgraham
Copy link
Contributor Author

Rebased on master for the sake of unbreaking verification build.

Oops I forgot to rebase this one. Thank you for handling that.

@jonahgraham jonahgraham merged commit 079d2a9 into eclipse-platform:master Oct 30, 2025
14 of 17 checks passed
@jonahgraham jonahgraham deleted the g-critical branch October 30, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants