uClibc-ng test-suite failures #2: tst-cancel7 anomaly (busybox additional fork)
Closed this issue · 1 comments
tst-cancel7 / tst-cancelx7 have always failed in my local uClibc runs
.... tst-cancel7 FAIL tst-cancel7 got 1 expected 0
.... tst-cancelx7 FAIL tst-cancelx7 got 1 expected 0
However these pass in Waldemar's upstream uclibc-ng testing for ARC (https://downloads.uclibc-ng.org/reports/1.0.31/REPORT.arcv2.libc.uClibc-ng-1.0.31)
Similar test also exists in glibc and that passes for ARC as well.
This turned out to be interesting and attributed to busybox itself.
The test harness uses libc system() to spawn a new shell and run the test
system in uclibc uses -c toggle to (v)fork/execve.
'system("tst-cancel7") =>
execve("/bin/sh", ["/bin/sh", "-c", "./tst-cancel7 -d -p /tmp/tst-can"...], [/* 9 vars */]) = 0`
In my busybox 1.27.2 busybox shell handled -c by doing a fork before execve. So the kill signal is delivered to a different task hence the failure. In later busybox versions (from latest buildroot and likely one used by Waldemer) this extra fork has been optimized away, so the signal is passed to same task. see commit below.
2017-07-25 1e3e2ccd5dd2 ash: [SHELL] Optimize dash -c "command" to avoid a fork
So nothing needs fixing in uclibc, just need a different busybox version.