Skip to content

Auto-port 5.0: Replace usage of strerror with thread-safe alternative#16556

Merged
chrisvest merged 1 commit into
5.0from
auto-port-pr-16547-to-5.0
Mar 26, 2026
Merged

Auto-port 5.0: Replace usage of strerror with thread-safe alternative#16556
chrisvest merged 1 commit into
5.0from
auto-port-pr-16547-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #16547 to 5.0
Cherry-picked commit: cd92804


Motivation:

We used strerror(...) when generating the exception that was thrown via JNI. Unfortunally strerror(...) is not thread-safe as it uses a static buffer internally which could lead to corrupted exception messages.

Modifications:

  • strerror() is replaced with strerror_r_xsi() — the thread-safe wrapper already defined in this file

Result:

No more corrupted exception messages thrown by JNI

Motivation:

We used strerror(...) when generating the exception that was thrown via
JNI. Unfortunally strerror(...) is not thread-safe as it uses a static
buffer internally which could lead to corrupted exception messages.

Modifications:

- strerror() is replaced with strerror_r_xsi() — the thread-safe wrapper
already defined in this file

Result:

No more corrupted exception messages thrown by JNI

(cherry picked from commit cd92804)
@chrisvest chrisvest added this to the 5.0.0.Final milestone Mar 26, 2026
@chrisvest chrisvest merged commit 205d32d into 5.0 Mar 26, 2026
11 of 13 checks passed
@chrisvest chrisvest deleted the auto-port-pr-16547-to-5.0 branch March 26, 2026 22:51
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.

3 participants