Arrrgh... too fast, too furious... :)
- Fixed: manpage: CX_THROW_MAIN() and cx_test_sigexc() description.
- Fixed: CX_THROW_MAIN() and cx_test_sigexc() should have "artificial" attribute, for debugging.
Files for v1.7.0 removed.
Few small optimizations, which are improving the performance in common use cases.
Optimization: added aliases for some exported functions which are used internally. A bit faster code.
This version introduces a small optimisation:
cx_stk_t.sig_sa is now initialized once per thread - init code moved from CX_CATCH_SIGNAL() to CX_INIT().
(in fact this should be done long time ago :) )
BTW, for the first time I've checked how much time the test program takes to execute:
on my machine it's only 15 miliseconds...
In 15 miliseconds 11 threads are crashing (some of them several times and in different ways) and are overflowing the stacks and buffers... - and the program returns success, since every crash is catched ;)
During upgrade of one of existing projects to a new version of libcxc, it showed up that there is one more (minor) regression:
- Fixed: Some versions of gcc are refusing to inline CX_RESTART(), due to "noreturn" attribute -> now CX_RESTART is a macro.
This version introduces few important bug fixes, most important are:
- Fixed: (BUG) CX_BREAK must call cx_disconnect().
- Fixed: (BUG) CX_DESTROY() should check the cx_ret status.
- Fixed: CX_CATCH_SIGNAL() is now checking whether the handler is already installed.
- Fixed: (TEST) test_td_stack_ovf(): infinite loop in optimized builds: GCC can remove nested calls from level O2 up -> optimisations are now disabled for this test.... read more
The problem with v1.4.4 is in fact documented: pthreads(7):
"If two threads handle signals on their shared alternate signal stack at the same time, unpredictable program failures are likely to occur."
...even if the handler is fully re-entrant and there's enough space on the stack?
Files for v1.5.0 removed.
Known BUGS:
1. Test program randomly fails on a single-core x86/amd64 CPUs or when the affinity is set to a single core. It's really hard to trace programs which are changing the stacks, so currently this problem is not solved. However, at this moment it seems that the kernel and/or pthread implemetation has a bug. The test have never failed on a single-core ARM build - this is interesting... (GCC bug?). None of the real-life apps have exposed this problem (but that's obviously not an excuse - just a hint).... read more
Full list in ChgLog.
Bugfix release:
- Fixed: (Regression) CX_INIT() fails when non-default sig_stksz is used.
Such situation was not checked in a test program, and it was catched in a completely separate project.
Test program updated.
Files for v1.4.0 removed.
Most important changes:
1. cx_secured_buf() and cx_free_sec_buf() are far more easier to use now, since the user no longer needs to care about secm_t - in fact, this struct is now "private".
2. new funcion: CX_CATCH_SIG_MASK() allows to register several signal handlers in a single call.
Manpage updated and improved. See ChangeLog for full list of changes.
Two important changes have been introduced in this version:
handler for SIGSEGV is no longer installed by default: it was not so good idea, cause f.e. the app could need to allow segfaults in debug builds.
new CXF_SIG_NC action flag added. This allows user' sig handler to prevent catching the signal. Of course the same behaviour could be achieved by just registering custom sigaction, but this solution allows to use already existing code, and additionally it leaves a trace on the cx_stack.... read more
Fixed:
Registered signal triggered outside of top-level TRY-CATCH-END section can create infinite loop trough propagation. Now, the cx_sig_handler() is checking whether the cx_stack was destroyed or if the current stack offset is negative. In such case it will call exit(3).
(perhaps the lib should be moved to c99 and use _exit() ... )
Few non-critical fixes and some cleanups...
Bugfix release:
- Fixed: test prog: main td: updated unwound macro code : don't call cx_get_entry().
- Fixed: cx_propagate(cx_entry* ent) declared as cx_propagate()
- Fixed: (package) missing library header afer installation (makefile bug).
Exceptions and signal handler stacks are now mprotect()-ed buffers.
New functions for handling the protected buffers and new CX_MARK macro.
Few small bugfixes and optimisations.
Manpage updated.
Although this lib is dedicated for C language, it can be used as part of C++ programs - and the __THROW macro in returncode.h didn't work in C++ mode - Fixed.