Skip to content

fix thread unsafe call to localtime on linux#835

Open
aleksisch wants to merge 1 commit into
ithewei:masterfrom
aleksisch:make-linux-thread-safe
Open

fix thread unsafe call to localtime on linux#835
aleksisch wants to merge 1 commit into
ithewei:masterfrom
aleksisch:make-linux-thread-safe

Conversation

@aleksisch
Copy link
Copy Markdown

@aleksisch aleksisch commented May 18, 2026

On Windows GetLocalTime is thread-safe. On linux localtime_r is thread-safe, while localtime not. This commit replaces usage of localtime in places not under mutex (only one such place) to localtime_r.

This bug was detected in daScript CI:
https://github.com/GaijinEntertainment/daScript/actions/runs/25911600620/job/76157878377?pr=2668

On Windows GetLocalTime is thread-safe. On linux localtime_r
is thread-safe, while localtime not. This commit replaces usage of
localtime in places not under mutex (only one such place)
to localtime_r.
@aleksisch aleksisch force-pushed the make-linux-thread-safe branch from 938c564 to 343437b Compare May 18, 2026 08:17
aleksisch added a commit to GaijinEntertainment/daScript that referenced this pull request May 18, 2026
MCP requires HV. Let's enable HV by default so MCP server will
be available in default builds.

It requires fixing thread-safe bug in libHV:
ithewei/libhv#835

And fixing our CMakeLists for ASAN on linux.
aleksisch added a commit to GaijinEntertainment/daScript that referenced this pull request May 18, 2026
MCP requires HV. Let's enable HV by default so MCP server will
be available in default builds.

It requires fixing thread-safe bug in libHV:
ithewei/libhv#835

And fixing our CMakeLists for ASAN on linux.
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.

1 participant