bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linkage problem with m4 1.4.11 on AIX 6.1


From: Eric Blake
Subject: Re: linkage problem with m4 1.4.11 on AIX 6.1
Date: Fri, 25 Apr 2008 06:46:07 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[please keep replies on-list]

According to Rainer Tammer on 4/25/2008 12:04 AM:
|> Good to know.  At this point, replies can drop bug-gnulib.  Is there also
|> a standalone kill(1) provided somewhere on PATH?  What do the
|> following do?
|>
| Yes,
| /usr/bin/kill
|
|> $ sh -c 'kill $$'; echo $?
| output:
| Terminated
| 143
|
|> $ sh -c 'env kill $$'; echo $?
| output:
| Terminated
| 143

Good; the shell builtin and standalone app can both terminate sh with a
signal.

|
|> $ sh -c 'kill -9 $$'; echo $?
| output:
| Killed
| 137
|
|> $ sh -c 'env kill -9 $$'; echo $?
| output:
| Killed
| 137

And signal 9 is detectable as a signal, regardless of whether the builtin
or standalone app did the killing, which is what the m4 testsuite expects.

So I have no idea why syscmd was resulting in sysval reporting 127 instead
of 2304 (ie (137-128) << 8; the trick m4 uses to distinguish signals from
normal exit), nor why it appears that esyscmd didn't have the problem in
your original report (the difference between syscmd and esyscmd is using
system(3) vs. popen(3)).

|
| truss tarce:
| execve("/usr/bin/m4", 0x2FF22AA0, 0x200121E8)    argc: 2

Unfortunately, you truss'd the native m4, and not the just-built one.
Care to replace that 'm4' with 'path/to/m4-1.4.11/src/m4' and retry?

| -1
| kwrite(1, " - 1\n", 3)                          = 3

As-is, the native m4 reports -1 instead of 127 when reaping the child
process, but that's not what I was interested in learning :)

|> $ m4 -Dsyscmd='esyscmd($@)' file
| kread(3, " s y s c m d ( k i l l  ".., 4096)    = 25
| kioctl(1, 22528, 0x00000000, 0x00000000)        = 0
| esyscmd(kill -9 $$)0
| kwrite(1, " e s y s c m d ( k i l l".., 21)     = 21

And the native m4 doesn't even understand esyscmd (it's a GNU extension,
after all).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgR0o8ACgkQ84KuGfSFAYDoJACgmLOhZ1wqivnQ+k1vd7dwA93w
YtQAoIYFhop37m5/jqAMCHE8Fhjm4a3U
=4C8W
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]