https://bugs.kde.org/show_bug.cgi?id=361615

--- Comment #13 from earl_c...@yahoo.com ---
Created attachment 101149
  --> https://bugs.kde.org/attachment.cgi?id=101149&action=edit
Standalone test case

I could not find the previously mentioned standalone test case, so I've
uploaded a reconstructed version that illustrates the same behaviour.

Note also that I have included a candidate patch with this ticket:
https://bugs.kde.org/attachment.cgi?id=98326

When run outside valgrind, the test program prints:
---------------------------------------------------
$ gcc -o test test.c -lpthread && ./test ; echo $?
Signal 15
0
---------------------------------------------------

When run under valgrind, the result is different:
---------------------------------------------------
$ gcc -o test test.c -lpthread && valgrind ./test ; echo $?
==3351== Memcheck, a memory error detector
==3351== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==3351== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==3351== Command: ./test
==3351== 
==3352== 
==3352== Process terminating with default action of signal 15 (SIGTERM)
==3352==    at 0x405DF3F: pthread_sigmask (pthread_sigmask.c:48)
==3352==    by 0x804875E: slavethread (in /home/earl/test)
==3352==    by 0x4058F71: start_thread (pthread_create.c:312)
==3352==    by 0x415AF8D: clone (clone.S:129)
==3352== 
==3352== HEAP SUMMARY:
==3352==     in use at exit: 136 bytes in 1 blocks
==3352==   total heap usage: 1 allocs, 0 frees, 136 bytes allocated
==3352== 
==3352== LEAK SUMMARY:
==3352==    definitely lost: 0 bytes in 0 blocks
==3352==    indirectly lost: 0 bytes in 0 blocks
==3352==      possibly lost: 136 bytes in 1 blocks
==3352==    still reachable: 0 bytes in 0 blocks
==3352==         suppressed: 0 bytes in 0 blocks
==3352== Rerun with --leak-check=full to see details of leaked memory
==3352== 
==3352== For counts of detected and suppressed errors, rerun with: -v
==3352== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Signal 9
test: test.c:88: main: Assertion `(((__extension__ (((union { __typeof(status)
__in; int __i; }) { .__in = (status) }).__i))) & 0x7f) == 15' failed.
==3351== 
==3351== Process terminating with default action of signal 6 (SIGABRT)
==3351==    at 0x409D687: raise (raise.c:56)
==3351==    by 0x40A0AB2: abort (abort.c:89)
==3351==    by 0x40967C6: __assert_fail_base (assert.c:92)
==3351==    by 0x4096876: __assert_fail (assert.c:101)
==3351==    by 0x80489E5: main (in /home/earl/test)
==3351== 
==3351== HEAP SUMMARY:
==3351==     in use at exit: 0 bytes in 0 blocks
==3351==   total heap usage: 3 allocs, 3 frees, 550 bytes allocated
==3351== 
==3351== All heap blocks were freed -- no leaks are possible
==3351== 
==3351== For counts of detected and suppressed errors, rerun with: -v
==3351== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Aborted
134
---------------------------------------------------

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to