Artificial truth

The more you see, the less you believe.

[archives] [latest] | [homepage] | [atom/rss]

Non-zero wait status: 139 with libtap
Thu 17 July 2014 — download

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.