On Fri, Apr 18, 2025 at 05:25:22PM +0200, Vladimir Marek wrote: > Hi, > > I'm trying to update m4 on Solaris. All seems to work nicely with the > exception of 198.sysval test. The tests do show:
Thanks for the report. It looks like you have tripped on a known weakness in 1.4.19; which has been repaired in the meantime: https://git.sv.gnu.org/cgit/m4.git/commit/?h=branch-1.4&id=cd7f4d153 > > ... > Checking /builds/vmarek/autoconf/components/m4/m4-1.4.19/checks/198.sysval > > > @ ../doc/m4.texi:6751: Origin of test > > > /builds/vmarek/autoconf/components/m4/m4-1.4.19/checks/198.sysval: stderr > mismatch > > --- m4-tmp.9274/m4-xerr 2025-04-18 17:08:31.490034716 +0200 > > > +++ m4-tmp.9274/m4-err 2025-04-18 17:08:31.472374843 +0200 > > > @@ -0,0 +1 @@ > > > +sh: 12103 Killed > > > ... > That test in 1.4.19 has been renumbered slightly (it is 202.sysval in the 1.4.19.60 snapshot), and should silence stderr. If not, I have one more trick available to ignore stderr for that test (the real thing being tested there is that sysval can distinguish between exit due to signal from normal exit, and noise on stderr does not affect that aspect of the test); I won't apply this unless necessary: | diff --git i/doc/m4.texi w/doc/m4.texi | index 229ebcbd..37184afc 100644 | --- i/doc/m4.texi | +++ w/doc/m4.texi | @@ -6858,7 +6858,10 @@ Sysval | @comment ignored, with m4 inheriting that choice. That leaves KILL as | @comment the only signal we can reliably test, but even that is tricky: | @comment on Haiku, 'kill -9' actually causes a process to die with | -@comment signal 15 named KILLTHR on that platform. | +@comment signal 15 named KILLTHR on that platform. What's more, some | +@comment shells litter stderr with a message about detection of a killed | +@comment process, so the test merely ignores stderr. | +@comment xerr: ignore | @example | dnl This test assumes kill is a shell builtin, and that signals are | dnl recognizable. > I believe that it is the unexpected string on stderr which trips the > test. I can reproduce it manually by running > > (solaris)$ sh -c "/bin/sh -c 'kill -9 \$\$'; st=\$?; test \$st = 137 || test > \$st = 265" > sh: 10677: Killed > > When I try on Linux I get: > $ sh -c "/bin/sh -c 'kill -9 \$\$'; st=\$?; test \$st = 137 || test \$st = > 265" > Killed I'm on a GNU/Linux system (Fedora 40) where I don't even see that, at least when /bin/sh is bash: $ /bin/sh -c 'kill -9 $$' Killed $ sh -c "/bin/sh -c 'kill -9 \$\$'; st=\$?; test \$st = 137 || test \$st = 265" $ echo $? 0 But with dash, I do see: $ dash -c "/bin/sh -c 'kill -9 \$\$'; st=\$?; test \$st = 137 || test \$st = 265" Killed $ echo $? 0 However, the fixed version of the test uses: sh -c "{ /bin/sh -c 'kill -9 \$\$'; } 2>/dev/null; st=\$?; test \$st = 137 || test \$st = 265" which should be silent even on your system (if not, let me know). > > So I thought that maybe it is unexpected PID in the output but I was not > able to find a code handling "Killed" on it's own. > > I have tried to modify the test to redirect stderr to /dev/null in > various ways, but was also unsuccessful. You probably didn't use the "{ ...kill... ; } 2>/dev/null" trick. But your report DID flush out another actual bug; I'll be patching checks/get-them for a typo (I had xout in one place where it should be xerr). | diff --git i/checks/get-them w/checks/get-them | index b80f70fb..dcbb18d5 100755 | --- i/checks/get-them | +++ w/checks/get-them | @@ -60,7 +60,7 @@ BEGIN { | status = 0; | options = ""; | xout = ""; | - xout = ""; | + xerr = ""; | next; | } > > For the moment I have just commented out the test. I'm sorry I don't > have better solution. I would be more than happy help testing any > patches. If you wouldn't mind, I would love help testing the more recent m4 snapshots; here's the link to the most recent snapshot announcement[1] that should fare better on your setup, although I should now probably make another one due to fixes that have landed in the meantime. [1] https://lists.gnu.org/archive/html/bug-m4/2025-04/msg00033.html -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org