diff -u libnih-1.0.3/debian/changelog libnih-1.0.3/debian/changelog --- libnih-1.0.3/debian/changelog +++ libnih-1.0.3/debian/changelog @@ -1,3 +1,11 @@ +libnih (1.0.3-4ubuntu12) raring; urgency=low + + * nih/logging.c: Use our own __nih_abort_msg rather than the (e)glibc + private symbol __abort_msg to avoid upgrade issues (LP: #997359). + * nih/tests/test_logging.c: Update tests for __nih_abort_msg. + + -- James Hunt Thu, 25 Oct 2012 10:57:30 +0100 + libnih (1.0.3-4ubuntu11) quantal; urgency=low * Addition of debian/libnih-dbus1.postinst and only in patch2: unchanged: --- libnih-1.0.3.orig/nih/logging.c +++ libnih-1.0.3/nih/logging.c @@ -39,11 +39,11 @@ /** - * __abort_msg: + * __nih_abort_msg: * - * A glibc variable that keeps the assertion message in the core dump. + * A variable that keeps the assertion message in the core dump. **/ -extern char *__abort_msg __attribute__ ((weak)); +char *__nih_abort_msg; /** * logger: @@ -114,19 +114,19 @@ * nih_log_abort_message: * @message: message to be logged. * - * Save @message in the glibc __abort_msg variable so it can be retrieved + * Save @message in the __nih_abort_msg variable so it can be retrieved * by debuggers if we should crash at this point. **/ static void nih_log_abort_message (const char *message) { - if (! &__abort_msg) + if (! &__nih_abort_msg) return; - if (__abort_msg) - nih_discard (__abort_msg); + if (__nih_abort_msg) + nih_discard (__nih_abort_msg); - __abort_msg = NIH_MUST (nih_strdup (NULL, message)); + __nih_abort_msg = NIH_MUST (nih_strdup (NULL, message)); } /** only in patch2: unchanged: --- libnih-1.0.3.orig/nih/tests/test_logging.c +++ libnih-1.0.3/nih/tests/test_logging.c @@ -31,7 +31,7 @@ #include -extern char *__abort_msg __attribute__ ((weak)); +extern char *__nih_abort_msg; static NihLogLevel last_priority = NIH_LOG_UNKNOWN; static char * last_message = NULL; @@ -156,13 +156,13 @@ } - /* Check that a fatal message is also stored in the glibc __abort_msg + /* Check that a fatal message is also stored in the __nih_abort_msg * variable. */ - if (&__abort_msg) { + if (&__nih_abort_msg) { TEST_FEATURE ("with fatal message"); TEST_ALLOC_FAIL { - __abort_msg = NULL; + __nih_abort_msg = NULL; last_priority = NIH_LOG_UNKNOWN; last_message = NULL; @@ -174,16 +174,16 @@ TEST_EQ (last_priority, NIH_LOG_FATAL); TEST_EQ_STR (last_message, "message with some 20 formatting"); - TEST_NE_P (__abort_msg, NULL); - TEST_ALLOC_PARENT (__abort_msg, NULL); - TEST_EQ_STR (__abort_msg, "message with some 20 formatting"); + TEST_NE_P (__nih_abort_msg, NULL); + TEST_ALLOC_PARENT (__nih_abort_msg, NULL); + TEST_EQ_STR (__nih_abort_msg, "message with some 20 formatting"); free (last_message); } /* Check that a fatal message can safely overwrite one already stored - * in the glibc __abort_msg variable. + * in the __nih_abort_msg variable. */ TEST_FEATURE ("with second fatal message"); TEST_ALLOC_FAIL { @@ -191,7 +191,7 @@ msg = nih_strdup (NULL, "test"); } - __abort_msg = msg; + __nih_abort_msg = msg; TEST_FREE_TAG (msg); last_priority = NIH_LOG_UNKNOWN; @@ -207,14 +207,14 @@ TEST_FREE (msg); - TEST_NE_P (__abort_msg, NULL); - TEST_ALLOC_PARENT (__abort_msg, NULL); - TEST_EQ_STR (__abort_msg, "message with some 20 formatting"); + TEST_NE_P (__nih_abort_msg, NULL); + TEST_ALLOC_PARENT (__nih_abort_msg, NULL); + TEST_EQ_STR (__nih_abort_msg, "message with some 20 formatting"); free (last_message); } } else { - printf ("SKIP: __abort_msg not available\n"); + printf ("SKIP: __nih_abort_msg not available\n"); }