commit e5013562e2288992162f86a4f78b3145d2119c7f Author: Alberto Bertogli Date: Wed Sep 5 20:04:38 2012 +0100 libfiu 0.91 Signed-off-by: Alberto Bertogli commit 717fa76655f9b1a03305032781337481f97e7f4c Author: Alberto Bertogli Date: Wed Sep 5 19:55:35 2012 +0100 Make sure we clean the tests when cleaning from the top level Makefile This patch makes a top-level "make clean" also clean up the tests' binaries and temporary files. Signed-off-by: Alberto Bertogli commit 273fc65af0a309e2860b15baab664a85e1ddfbd5 Author: Alberto Bertogli Date: Wed Sep 5 19:55:13 2012 +0100 tests: Add generated tests for kill and mmap Signed-off-by: Alberto Bertogli commit 4856a2c32c11afac87da19f1554fec5da579ebe6 Author: Alberto Bertogli Date: Wed Sep 5 10:36:05 2012 +0100 tests/generated: Let generated tests be wrapped around #ifdefs Some of the functions we want to test are not always included in the posix preload library, but depend on some precompiler expression being defined. This patch adds support for that in the test generator, which will be used in subsequent patches. Signed-off-by: Alberto Bertogli commit b96717bef154c059b52099b36a3b91308c462934 Author: Alberto Bertogli Date: Wed Sep 5 00:44:51 2012 +0100 libfiu: Fix backtrace_works() in fiu_enable_stack_by_name() fiu_enable_stack_by_name() calls fiu_enable_stack(), which does the backtrace_works() check. For that check to work, fiu_enable_stack() must be on the stack. However, when fiu_enable_stack_by_name() invokes it, it could be inlined, causing the check to fail. This patch adds an independent backtrace_works() check within fiu_enable_stack_by_name(), so we're sure the caller is on the stack. Signed-off-by: Alberto Bertogli commit 2be43a71b7e32dcd0489ee70667aa0898a9f645a Author: Alberto Bertogli Date: Wed Sep 5 00:30:40 2012 +0100 preload/posix: Remove stat() and friends These functions were wrapped with #ifdefs in 2dafdf7, but it turns out they're also often defined as inline functions in headers, which also prevents the preloading from working correctly. Signed-off-by: Alberto Bertogli commit 8b8713b2bf6f44c88c5a2936ceceebed865ae35f Author: Alberto Bertogli Date: Sun Sep 2 23:46:49 2012 +0100 libfiu: Test if backtrace works in fiu_enable_stack() In fiu_enable_stack(), test the backtrace-related functions to make sure they work before adding the new failure point. That way, the caller will know if the function isn't available on the platform instead of the failure point not working when it should. We need it because even on platforms where backtrace() is available, it may not be working properly (because of build options, broken glibc, etc.). The tester function takes the caller as a parameter to work around compiler inlining issues that can result in a false negative. Signed-off-by: Alberto Bertogli commit ea20786fca65b3e3eb30c8116f7146f95bbae6a3 Author: Alberto Bertogli Date: Fri Aug 31 00:43:08 2012 +0100 libfiu: Include function boundaries When checking if the instruction pointer is within a given function boundaries, we have to include the boundaries themselves too. Signed-off-by: Alberto Bertogli commit 78f9899beb67502d9bd2e8345724ef2f6877122a Author: Alberto Bertogli Date: Sun Aug 26 23:20:01 2012 +0100 libfiu: Fail fiu_enable_stack() if we know we can't do it When the backtrace related functions are not available, fail fiu_enable_stack(); otherwise the caller may think it's going to work, when it's not. Signed-off-by: Alberto Bertogli commit d7130e41d4f64695cf2928c6704140512fc8f3c0 Author: Alberto Bertogli Date: Sun Aug 26 22:23:10 2012 +0100 tests: Do not fail if fiu_enable_stack*() returns an error fiu_enable_stack() and fiu_enable_stack_by_name() are only supported on some platforms; where they're not, an error will be returned. This small patch avoid failing the tests on that situation. Is not ideal because the function could fail when it shouldn't, but until we introduce other changes needed for detecting when it should and should not work, this prevents the false negative. Signed-off-by: Alberto Bertogli commit aaf11880e2a2653205afba45dfa5e0aa6f40b8d0 Author: Alberto Bertogli Date: Sun Aug 26 22:05:29 2012 +0100 preload/posix: Do not wrap strdup() if it's a macro glibc, when _GNU_SOURCE is defined, can have macros for strdup/strndup, so we need to avoid generating wrappers for them. Signed-off-by: Alberto Bertogli commit 6825143135e5a6b9be7041d3319d32c03c2ed701 Author: Alberto Bertogli Date: Sun Aug 26 21:56:52 2012 +0100 preload/posix: Use RTLD_NEXT when available This patch makes the posix preloader use RTLD_NEXT for finding the original symbols of the functions we're wrapping, instead of needing dlopen(LIBC_SONAME). It's a GNU extension, but very very useful. The change also requires some reorganization, including a special case for failing the function during its own initialization, which can happen if dlopen()/dlsym() invoke the functions we are wrapping. That works as long as those functions can cope with the failures, which is the case in all tested platforms so far (and we're no worse than we were before anyway). Much of the initialization and libc handling is simplified, so the patch removes more than twice the lines it adds. The original motivation for this patch, however, is to fix the removal of the malloc hooks in the latest glibc versions. With it, malloc() and friends no longer need special treatment. Thanks a lot to Georg Profos for reporting this issue, along with code samples for reproducing it. Signed-off-by: Alberto Bertogli commit 2dafdf78fa23c4244def42f28d5bfd78d3a27841 Author: Alberto Bertogli Date: Sun Aug 26 20:55:40 2012 +0100 preload/posix: Use #ifdef for stat() and friends stat(), fstat() and lstat() are often defined as macros instead of functions, which makes them much harder to override. They were commented out, and this patch changes that to individual #ifdef, so they can be enabled on platforms which have them as proper functions. Signed-off-by: Alberto Bertogli commit 98a0f745cc79af11ace6416142bcc6855daeb02a Author: Alberto Bertogli Date: Sat Aug 25 16:59:11 2012 +0100 Add tests for the posix preloader wrappers This patch introduces some tests for selected posix preloader wrappers. The tests are autogenerated based on a small configuration files, to make it easier to add more later on. Signed-off-by: Alberto Bertogli commit 005a56fbcb5ab8045f9d51676c521b335f058552 Author: Alberto Bertogli Date: Fri Apr 6 17:51:15 2012 +0100 libfiu: Include to fix a broken build On some platforms, the headers already included by backtrace.c are not enough to get the definition of NULL, so this patch includes directly to prevent that. Signed-off-by: Alberto Bertogli commit 6f1eeacdabb857e06b78deeb2c38fc452b783ad6 Author: Alberto Bertogli Date: Thu Apr 5 20:24:54 2012 +0100 libfiu: Use CFLAGS when attempting to build backtrace.o Signed-off-by: Alberto Bertogli commit 83fb1e675de26ad5409e554e2947e53c8f1b10c0 Author: Alberto Bertogli Date: Tue Apr 3 21:59:31 2012 +0100 Properly wrap python to use the built bindings The Python tests should run using the built bindings, not the installed ones. This patch adds a wrapper to do the invocation of the python binary with the appropriate environment variables to make that happen. Thanks to Chris Lamb for reporting this issue. Signed-off-by: Alberto Bertogli commit 65614be02e3952b7ad47843156d2b480f998d01e Author: Alberto Bertogli Date: Fri Mar 30 00:44:45 2012 +0100 fiu: Fix parameter name in fiu_rc_string()'s documentation Signed-off-by: Alberto Bertogli