StrToShap test fails on x86-32
Downstream bug: https://bugs.gentoo.org/928419
test/StrToShap.log
shows:
TAP version 13
# random seed: R02S7215a6e9badb25b7a3c860e1f9201542
1..2
# Start of StrToShap tests
# test_XmuCvtStringToShapeStyle starting
# StringToShapeStyle(Rectangle)
# StringToShapeStyle(Oval)
# StringToShapeStyle(Ellipse)
# StringToShapeStyle(RoundedRectangle)
# StringToShapeStyle(DoesNotExist)
# Caught error: Couldn't find per display information
# test_XmuCvtStringToShapeStyle completed
ok 1 /StrToShap/XmuCvtStringToShapeStyle
PASS: StrToShap 1 /StrToShap/XmuCvtStringToShapeStyle
# test_XmuCvtShapeStyleToString starting
# ShapeStyleToString(1)
# ShapeStyleToString(2)
# ShapeStyleToString(3)
# ShapeStyleToString(4)
# ShapeStyleToString(1984)
./tap-test: line 2: 517347 Segmentation fault (core dumped) "$1" -k --tap
# Caught error: Couldn't find per display information
ERROR: StrToShap - too few tests run (expected 2, got 1)
ERROR: StrToShap - exited with status 139 (terminated by signal 11?)
gdb shows:
x86 ~/libxmu # libtool --mode=execute gdb -q ./test/StrToShap
Reading symbols from /root/libxmu/test/.libs/StrToShap...
(gdb) r
Starting program: /root/libxmu/test/.libs/StrToShap
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
TAP version 13
# random seed: R02S69353e8793652ee71023d1cdb2d27506
1..2
# Start of StrToShap tests
# test_XmuCvtStringToShapeStyle starting
# StringToShapeStyle(Rectangle)
# StringToShapeStyle(Oval)
# StringToShapeStyle(Ellipse)
# StringToShapeStyle(RoundedRectangle)
# StringToShapeStyle(DoesNotExist)
# Caught error: Couldn't find per display information
# test_XmuCvtStringToShapeStyle completed
ok 1 /StrToShap/XmuCvtStringToShapeStyle
# test_XmuCvtShapeStyleToString starting
# ShapeStyleToString(1)
# ShapeStyleToString(2)
# ShapeStyleToString(3)
# ShapeStyleToString(4)
# ShapeStyleToString(1984)
# Caught error: Couldn't find per display information
Program received signal SIGSEGV, Segmentation fault.
0x003e4c4c in ?? ()
(gdb) bt
#0 0x003e4c4c in ?? ()
#1 0x5655697f in test_XmuCvtStringToShapeStyle () at StrToShap.c:126
#2 0xf7d184c6 in test_case_run (tc=0x5655ffc0) at ../glib-2.78.3/glib/gtestutils.c:3161
#3 g_test_run_suite_internal (suite=suite@entry=0x56560030, path=path@entry=0x0) at ../glib-2.78.3/glib/gtestutils.c:3256
#4 0xf7d18295 in g_test_run_suite_internal (suite=suite@entry=0x5655efa0, path=path@entry=0x0) at ../glib-2.78.3/glib/gtestutils.c:3275
#5 0xf7d18ad1 in g_test_run_suite (suite=suite@entry=0x5655efa0) at ../glib-2.78.3/glib/gtestutils.c:3355
#6 0xf7d18b6f in g_test_run () at ../glib-2.78.3/glib/gtestutils.c:2462
#7 0x5655714c in main (argc=1, argv=0xffffd174) at StrToShap.c:196
This doesn't make sense because the log shows that the XmuCvtStringToShapeStyle
test completed.
StrToShap.c:126
is:
70 static void
71 test_XmuCvtStringToShapeStyle(void)
72 {
[...]
125 g_assert_cmpint(warning_count, >, 0);
126 g_test_message("test_XmuCvtStringToShapeStyle completed");
127 }
Commenting out that line and rerunning shows that the stack is getting smashed somewhere earlier:
x86 ~/libxmu # libtool --mode=execute gdb -q ./test/StrToShap
Reading symbols from /root/libxmu/test/.libs/StrToShap...
(gdb) r
Starting program: /root/libxmu/test/.libs/StrToShap
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
TAP version 13
# random seed: R02S0fefdad74913b98a2301587c376e7136
1..2
# Start of StrToShap tests
# test_XmuCvtStringToShapeStyle starting
# StringToShapeStyle(Rectangle)
# StringToShapeStyle(Oval)
# StringToShapeStyle(Ellipse)
# StringToShapeStyle(RoundedRectangle)
# StringToShapeStyle(DoesNotExist)
# Caught error: Couldn't find per display information
ok 1 /StrToShap/XmuCvtStringToShapeStyle
# test_XmuCvtShapeStyleToString starting
# ShapeStyleToString(1)
# ShapeStyleToString(2)
# ShapeStyleToString(3)
# ShapeStyleToString(4)
# ShapeStyleToString(1984)
# Caught error: Couldn't find per display information
*** stack smashing detected ***: terminated
Program received signal SIGABRT, Aborted.
0xf7fc6589 in __kernel_vsyscall ()
(gdb) bt
#0 0xf7fc6589 in __kernel_vsyscall ()
#1 0xf7a8eed7 in ?? () from /usr/lib/libc.so.6
#2 0xf7a38837 in raise () from /usr/lib/libc.so.6
#3 0xf7a1e2a4 in abort () from /usr/lib/libc.so.6
#4 0xf7a1f2e5 in ?? () from /usr/lib/libc.so.6
#5 0xf7b461b5 in __fortify_fail () from /usr/lib/libc.so.6
#6 0xf7b471ed in __stack_chk_fail () from /usr/lib/libc.so.6
#7 0x56557154 in __stack_chk_fail_local () at stack_chk_fail_local.c:45
#8 0x5655697c in test_XmuCvtStringToShapeStyle () at StrToShap.c:127
#9 0xf7d184c6 in test_case_run (tc=0x5655ffc0) at ../glib-2.78.3/glib/gtestutils.c:3161
#10 g_test_run_suite_internal (suite=suite@entry=0x56560030, path=path@entry=0x0) at ../glib-2.78.3/glib/gtestutils.c:3256
#11 0xf7d18295 in g_test_run_suite_internal (suite=suite@entry=0x5655efa0, path=path@entry=0x0) at ../glib-2.78.3/glib/gtestutils.c:3275
#12 0xf7d18ad1 in g_test_run_suite (suite=suite@entry=0x5655efa0) at ../glib-2.78.3/glib/gtestutils.c:3355
#13 0xf7d18b6f in g_test_run () at ../glib-2.78.3/glib/gtestutils.c:2462
#14 0x56557134 in main (argc=1, argv=0xffffd174) at StrToShap.c:196
The test passes if I comment out g_test_add_func(..., test_XmuCvtShapeStyleToString)
, but still fails if I comment out the earlier g_test_add_func(..., test_XmuCvtStringToShapeStyle)
.
Stepping through the function, it fails at
171 warning_count = 0;
(gdb)
172 value = 1984;
(gdb)
173 from.addr = (XPointer) &value;
(gdb)
174 g_test_message("ShapeStyleToString(%d)", value);
(gdb)
# ShapeStyleToString(1984)
175 ret = XmuCvtShapeStyleToString(NULL, NULL, &nargs, &from, &to, NULL);
(gdb)
# Caught error: Couldn't find per display information
Warning:
Cannot insert breakpoint 0.
Cannot access memory at address 0xbed63de
0xf7a385d0 in siglongjmp () from /usr/lib/libc.so.6
I'll continue debugging.