-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
🐞 bugSomething isn't workingSomething isn't working
Description
Found during #41. On Linux it causes a segfault if used by more than one callback:
Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
74 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory
AI explanation:
No, you cannot safely store a va_list in a structure to be reused by multiple callbacks in C++ (or C), because:
va_list is only valid during the lifetime of the original va_start/va_end block. Accessing it outside this scope leads to undefined behavior.
On some platforms, va_list is not just a pointer, but may involve internal state (e.g. stack frame information or special CPU registers), so copying or storing it across function boundaries can break.
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't workingSomething isn't working