------ This is output for >= glibc 2.4 ------

---------------- pthread_create/join ----------------

---Thread-Announcement------------------------------------------

Thread #x is the program's root thread

---Thread-Announcement------------------------------------------

Thread #x was created
   ...
   by 0x........: pthread_create_WRK (hg_intercepts.c:...)
   by 0x........: pthread_create@* (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:81)

----------------------------------------------------------------

Possible data race during write of size 2 at 0x........ by thread #x
Locks held: none
   at 0x........: main (tc20_verifywrap.c:83)

This conflicts with a previous write of size 2 by thread #x
Locks held: none
   at 0x........: racy_child (tc20_verifywrap.c:39)
   by 0x........: mythread_wrapper (hg_intercepts.c:...)
   ...

Location 0x........ is 0 bytes inside global var "unprotected"
declared at tc20_verifywrap.c:32

----------------------------------------------------------------

Thread #x's call to pthread_join failed
   with error code 45 (EDEADLK: Resource deadlock would occur)
   at 0x........: pthread_join_WRK (hg_intercepts.c:...)
   by 0x........: pthread_join (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:88)


---------------- pthread_mutex_lock et al ----------------

----------------------------------------------------------------

Thread #x's call to pthread_mutex_init failed
   with error code 122 (EOPNOTSUPP: Operation not supported on transport endpoint)
   at 0x........: pthread_mutex_init (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:102)

----------------------------------------------------------------

Thread #x: pthread_mutex_destroy of a locked mutex
   at 0x........: mutex_destroy_WRK (hg_intercepts.c:...)
   by 0x........: pthread_mutex_destroy (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:112)

----------------------------------------------------------------

Thread #x's call to pthread_mutex_destroy failed
   with error code 16 (EBUSY: Device or resource busy)
   at 0x........: mutex_destroy_WRK (hg_intercepts.c:...)
   by 0x........: pthread_mutex_destroy (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:112)

----------------------------------------------------------------

Thread #x's call to pthread_mutex_lock failed
   with error code 22 (EINVAL: Invalid argument)
   at 0x........: mutex_lock_WRK (hg_intercepts.c:...)
   by 0x........: pthread_mutex_lock (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:118)

----------------------------------------------------------------

Thread #x's call to pthread_mutex_trylock failed
   with error code 22 (EINVAL: Invalid argument)
   at 0x........: mutex_trylock_WRK (hg_intercepts.c:...)
   by 0x........: pthread_mutex_trylock (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:126)

----------------------------------------------------------------

Thread #x's call to pthread_mutex_timedlock failed
   with error code 22 (EINVAL: Invalid argument)
   at 0x........: mutex_timedlock_WRK (hg_intercepts.c:...)
   by 0x........: pthread_mutex_timedlock (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:131)

----------------------------------------------------------------

Thread #x unlocked an invalid lock at 0x........
   at 0x........: mutex_unlock_WRK (hg_intercepts.c:...)
   by 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:135)

----------------------------------------------------------------

Thread #x's call to pthread_mutex_unlock failed
   with error code 22 (EINVAL: Invalid argument)
   at 0x........: mutex_unlock_WRK (hg_intercepts.c:...)
   by 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:135)


---------------- pthread_cond_wait et al ----------------

----------------------------------------------------------------

Thread #x: pthread_cond_{timed}wait called with un-held mutex
   at 0x........: pthread_cond_wait_WRK (hg_intercepts.c:...)
   by 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:157)

----------------------------------------------------------------

Thread #x's call to pthread_cond_wait failed
   with error code 1 (EPERM: Operation not permitted)
   at 0x........: pthread_cond_wait_WRK (hg_intercepts.c:...)
   by 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:157)

----------------------------------------------------------------

Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
   at 0x........: pthread_cond_signal_WRK (hg_intercepts.c:...)
   by 0x........: pthread_cond_signal@* (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:162)


FIXME: can't figure out how to verify wrap of pthread_cond_signal

----------------------------------------------------------------

Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
   at 0x........: pthread_cond_broadcast_WRK (hg_intercepts.c:...)
   by 0x........: pthread_cond_broadcast@* (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:168)


FIXME: can't figure out how to verify wrap of pthread_broadcast_signal

----------------------------------------------------------------

Thread #x: pthread_cond_{timed}wait called with un-held mutex
   at 0x........: pthread_cond_timedwait_WRK (hg_intercepts.c:...)
   by 0x........: pthread_cond_timedwait@* (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:175)

----------------------------------------------------------------

Thread #x's call to pthread_cond_timedwait failed
   with error code 22 (EINVAL: Invalid argument)
   at 0x........: pthread_cond_timedwait_WRK (hg_intercepts.c:...)
   by 0x........: pthread_cond_timedwait@* (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:175)


---------------- pthread_rwlock_* ----------------

----------------------------------------------------------------

Thread #x unlocked a not-locked lock at 0x........
   at 0x........: pthread_rwlock_unlock_WRK (hg_intercepts.c:...)
   by 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
   ...
   by 0x........: main (tc20_verifywrap.c:189)
  Lock at 0x........ was first observed
   at 0x........: pthread_rwlock_init_WRK (hg_intercepts.c:...)
   by 0x........: pthread_rwlock_init (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:188)

(1) no error on next line
(2) no error on next line
(3)    ERROR on next line
----------------------------------------------------------------

Thread #x unlocked a not-locked lock at 0x........
   at 0x........: pthread_rwlock_unlock_WRK (hg_intercepts.c:...)
   by 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
   ...
   by 0x........: main (tc20_verifywrap.c:206)
  Lock at 0x........ was first observed
   at 0x........: pthread_rwlock_init_WRK (hg_intercepts.c:...)
   by 0x........: pthread_rwlock_init (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:196)

(4) no error on next line
(5) no error on next line
(6) no error on next line
(7) no error on next line
(8)    ERROR on next line
----------------------------------------------------------------

Thread #x unlocked a not-locked lock at 0x........
   at 0x........: pthread_rwlock_unlock_WRK (hg_intercepts.c:...)
   by 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
   ...
   by 0x........: main (tc20_verifywrap.c:227)
  Lock at 0x........ was first observed
   at 0x........: pthread_rwlock_init_WRK (hg_intercepts.c:...)
   by 0x........: pthread_rwlock_init (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:196)


---------------- sem_* ----------------

----------------------------------------------------------------

Thread #x's call to sem_init failed
   with error code 22 (EINVAL: Invalid argument)
   at 0x........: sem_init_WRK (hg_intercepts.c:...)
   by 0x........: sem_init@* (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:243)


FIXME: can't figure out how to verify wrap of sem_destroy

----------------------------------------------------------------

Thread #x: Bug in libpthread: sem_wait succeeded on semaphore without prior sem_post
   at 0x........: sem_wait_WRK (hg_intercepts.c:...)
   by 0x........: sem_wait (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:257)

----------------------------------------------------------------

Thread #x's call to sem_post failed
   with error code 89 (ENOSYS: Function not implemented)
   at 0x........: sem_post_WRK (hg_intercepts.c:...)
   by 0x........: sem_post (hg_intercepts.c:...)
   by 0x........: main (tc20_verifywrap.c:260)


FIXME: can't figure out how to verify wrap of sem_post


------------ dealloc of mem holding locks ------------

----------------------------------------------------------------

Thread #x: Exiting thread still holds 1 lock
   ...


ERROR SUMMARY: 23 errors from 23 contexts (suppressed: 0 from 0)