Skip to content

Auto-port 4.1: Replace usage of strerror with thread-safe alternative#16555

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

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

Conversation

@netty-project-bot
Copy link
Copy Markdown
Contributor

Auto-port of #16547 to 4.1
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 merged commit cab4efd into 4.1 Mar 26, 2026
17 of 19 checks passed
@chrisvest chrisvest deleted the auto-port-pr-16547-to-4.1 branch March 26, 2026 22:50
@chrisvest chrisvest added this to the 4.1.133.Final milestone Mar 26, 2026
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