GNU bug report logs - #31218
kill() not wrapped with HAVE_WORKING_FORK

Previous Next

Package: diffutils;

Reported by: "Burton, Ross" <ross.burton <at> intel.com>

Date: Thu, 19 Apr 2018 15:11:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31218 in the body.
You can then email your comments to 31218 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#31218; Package diffutils. (Thu, 19 Apr 2018 15:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Burton, Ross" <ross.burton <at> intel.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Thu, 19 Apr 2018 15:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Burton, Ross" <ross.burton <at> intel.com>
To: bug-diffutils <at> gnu.org
Subject: kill() not wrapped with HAVE_WORKING_FORK
Date: Thu, 19 Apr 2018 10:59:44 +0100
Hi,

In sdiff.c the use of kill() is guarded in cleanup():

static void
cleanup (int signo __attribute__((unused)))
{
#if HAVE_WORKING_FORK
  if (0 < diffpid)
    kill (diffpid, SIGPIPE);
#endif
  if (tmpname)
    unlink (tmpname);
}

However, in checksigs() it isn't.  A simple fix to help build
diffutils under mingw (which doesn't have kill()) is:

+--- a/src/sdiff.c
++++ b/src/sdiff.c
+@@ -805,7 +805,9 @@
+
+       /* Yield an exit status indicating that a signal was received.  */
+       untrapsig (s);
++#if HAVE_WORKING_FORK
+       kill (getpid (), s);
++#endif
+
+       /* That didn't work, so exit with error status.  */
+       exit (EXIT_TROUBLE);

Cheers,
Ross




Information forwarded to bug-diffutils <at> gnu.org:
bug#31218; Package diffutils. (Thu, 19 Apr 2018 21:39:01 GMT) Full text and rfc822 format available.

Message #8 received at 31218 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Burton, Ross" <ross.burton <at> intel.com>, 31218 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#31218: kill() not wrapped with
 HAVE_WORKING_FORK
Date: Thu, 19 Apr 2018 14:38:26 -0700
On 04/19/2018 02:59 AM, Burton, Ross wrote:
> However, in checksigs() it isn't.  A simple fix to help build
> diffutils under mingw (which doesn't have kill()) is:
>
> +--- a/src/sdiff.c
> ++++ b/src/sdiff.c
> +@@ -805,7 +805,9 @@
> +
> +       /* Yield an exit status indicating that a signal was received.  */
> +       untrapsig (s);
> ++#if HAVE_WORKING_FORK
> +       kill (getpid (), s);
> ++#endif

How about using 'raise' instead?





Information forwarded to bug-diffutils <at> gnu.org:
bug#31218; Package diffutils. (Fri, 20 Apr 2018 13:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 31218 <at> debbugs.gnu.org (full text, mbox):

From: "Burton, Ross" <ross.burton <at> intel.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 31218 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#31218: kill() not wrapped with
 HAVE_WORKING_FORK
Date: Fri, 20 Apr 2018 14:29:01 +0100
Yep, this compiles on mingw:

- kill (getpid (), s);
+ raise (s);

Ross

On 19 April 2018 at 22:38, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> On 04/19/2018 02:59 AM, Burton, Ross wrote:
>>
>> However, in checksigs() it isn't.  A simple fix to help build
>> diffutils under mingw (which doesn't have kill()) is:
>>
>> +--- a/src/sdiff.c
>> ++++ b/src/sdiff.c
>> +@@ -805,7 +805,9 @@
>> +
>> +       /* Yield an exit status indicating that a signal was received.  */
>> +       untrapsig (s);
>> ++#if HAVE_WORKING_FORK
>> +       kill (getpid (), s);
>> ++#endif
>
>
> How about using 'raise' instead?
>




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Fri, 20 Apr 2018 20:42:02 GMT) Full text and rfc822 format available.

Notification sent to "Burton, Ross" <ross.burton <at> intel.com>:
bug acknowledged by developer. (Fri, 20 Apr 2018 20:42:02 GMT) Full text and rfc822 format available.

Message #16 received at 31218-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Burton, Ross" <ross.burton <at> intel.com>
Cc: 31218-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#31218: kill() not wrapped with
 HAVE_WORKING_FORK
Date: Fri, 20 Apr 2018 13:40:52 -0700
[Message part 1 (text/plain, inline)]
On 04/20/2018 06:29 AM, Burton, Ross wrote:
> Yep, this compiles on mingw:

Thanks for checking; I installed the attached. Closing the bug report.

[0001-sdiff-port-to-mingw.txt (text/plain, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 May 2018 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 94 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.