Skip to content

Conversation

@yannrichet-asnr
Copy link

No description provided.

yannrichet and others added 7 commits October 17, 2025 11:18
Co-authored-by: yannrichet-asnr <148193180+yannrichet-asnr@users.noreply.github.com>
Fix LTO type mismatch warning for setulb_ function declaration
The f2c-translated C code had static local variables in multiple functions
(setulb_, mainlb_, and 18+ other subroutines), making them non-thread-safe.
Static variables are shared across all function calls, causing race conditions,
memory corruption, and segmentation faults in multi-threaded contexts.

This commit removes the static keyword from 202 local variable declarations,
making each function call have its own independent local state on the stack.
Only legitimate static uses (constant definitions and format strings) are
preserved.

This enables true thread-safety without requiring mutex serialization.
Fix thread-safety: remove static from local variables
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.

2 participants