about:blog Archives

reversing, python, cookies
Friends: aj deadrom1 fr33tux kiwie

Non-zero wait status: 139 with libtap

I was writing some unit-tests for libotr with libtap (a pretty cool and simple C unit-test library), when I stumbled upon this:

test_dh (Wstat: 139 Tests: 5 Failed: 0)
  Non-zero wait status: 139
  Parse errors: Bad plan.  You planned 7 tests but ran 5.

I checked that I wrote seven tests and not five, that my build system was correct, that nothing was wrong in the code, and found nothing obvious.

The explanation is that 139 % 128 = 11, which is a SIGSEGV: my code was segfaulting. This is why it couldn't run seven tests: the fifth one killed the program. Everything turned to green after a proper fix of a unallocated variable.