mattst88,

Another fun adventure, this time with a happy ending.

A unit test in libXmu failed on x86-32 (https://gitlab.freedesktop.org/xorg/lib/libxmu/-/issues/2). I looked for the typical things first like bad casts but didn't see anything wrong.

I noticed that the unit test program runs two subtests and the log indicates that it completed the first successfully before crashing, but when I ran it under gdb the back trace showed it in the first unit test when the segfault occurred. Very strange.

mattst88,

Single stepping in #gdb, I ultimately came across a longjmp() call (apparently libXt handles errors this way?), and it was this call that triggered the failure.

Turns out each of the subtests checks some exceptional case and expects a function call to fail by longjmp()'ing, but only the first unit test actually prepared for the jump with a call to setjmp().

As a result, when the second subtest triggered its own longjmp() it jumped to the first subtest's function that had already completed!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • tacticalgear
  • DreamBathrooms
  • cisconetworking
  • khanakhh
  • mdbf
  • magazineikmin
  • modclub
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • ngwrru68w68
  • provamag3
  • everett
  • normalnudes
  • cubers
  • tester
  • thenastyranch
  • osvaldo12
  • GTA5RPClips
  • ethstaker
  • megavids
  • anitta
  • Leos
  • JUstTest
  • lostlight
  • All magazines