public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Another sigwaitinfo problem (with testcase)
@ 2012-08-15  8:04 Daniel Colascione
  2012-08-16 19:12 ` Christopher Faylor
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Colascione @ 2012-08-15  8:04 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

When run on a Linux machine, this program starts up and blocks on sigwaitinfo.
You can suspend and resume the program using usual job control facilities, and
on SIGINT, the program prints a message and exits. When the program resumes
after being stopped, it prints "resumed".

With the 2012-08-07 Cygwin snapshot, this program prints "resumed" immediately
after receiving SIGTSTP, then fails to respond to any signal, even signals not
in the blocked set. A simpler test program that just calls "raise (SIGSTOP)"
property stops itself before resuming execution.

#define _GNU_SOURCE 1
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <pthread.h>

int
main()
{
    sigset_t waitmask;
    int sig;

    sigemptyset (&waitmask);
    sigaddset (&waitmask, SIGTSTP);
    sigaddset (&waitmask, SIGINT);
    sigprocmask (SIG_BLOCK, &waitmask, NULL);

    for (;;) {
        sig = sigwaitinfo (&waitmask, NULL);
        fprintf (stderr, "got %s\n", sys_siglist[sig]);
        if (sig == SIGTSTP) {
            raise (SIGSTOP); /* Block until somebody resumes us. */
        } else if (sig == SIGINT) {
            fprintf(stderr, "exiting");
            break;
        }
    }

    return 0;
}


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Another sigwaitinfo problem (with testcase)
  2012-08-15  8:04 Another sigwaitinfo problem (with testcase) Daniel Colascione
@ 2012-08-16 19:12 ` Christopher Faylor
  2012-08-17  4:20   ` Daniel Colascione
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Faylor @ 2012-08-16 19:12 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 14, 2012 at 10:36:39PM -0700, Daniel Colascione wrote:
>When run on a Linux machine, this program starts up and blocks on sigwaitinfo.
>You can suspend and resume the program using usual job control facilities, and
>on SIGINT, the program prints a message and exits. When the program resumes
>after being stopped, it prints "resumed".
>
>With the 2012-08-07 Cygwin snapshot, this program prints "resumed" immediately
>after receiving SIGTSTP, then fails to respond to any signal, even signals not
>in the blocked set. A simpler test program that just calls "raise (SIGSTOP)"
>property stops itself before resuming execution.

This should be fixed in the latest snapshot.

Thanks for the test case.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Another sigwaitinfo problem (with testcase)
  2012-08-16 19:12 ` Christopher Faylor
@ 2012-08-17  4:20   ` Daniel Colascione
  2012-08-17  7:18     ` Daniel Colascione
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Colascione @ 2012-08-17  4:20 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]

On 8/16/2012 11:43 AM, Christopher Faylor wrote:
> On Tue, Aug 14, 2012 at 10:36:39PM -0700, Daniel Colascione wrote:
>> When run on a Linux machine, this program starts up and blocks on sigwaitinfo.
>> You can suspend and resume the program using usual job control facilities, and
>> on SIGINT, the program prints a message and exits. When the program resumes
>> after being stopped, it prints "resumed".
>>
>> With the 2012-08-07 Cygwin snapshot, this program prints "resumed" immediately
>> after receiving SIGTSTP, then fails to respond to any signal, even signals not
>> in the blocked set. A simpler test program that just calls "raise (SIGSTOP)"
>> property stops itself before resuming execution.
> 
> This should be fixed in the latest snapshot.
> 
> Thanks for the test case.

Thanks for the fix. It's incomplete, though. Previously, C-z would make the
program print "resumed", then become insensitive the signals present in
waitmask. With the 2012-08-16 snapshot, C-z stops the program, but on
resumption, it doesn't print "resumed". Instead, on resumption, the program
enters the same signal-insensitive state it did with the 2012-08-07 snapshot.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Another sigwaitinfo problem (with testcase)
  2012-08-17  4:20   ` Daniel Colascione
@ 2012-08-17  7:18     ` Daniel Colascione
  2012-08-17 19:28       ` Achim Gratz
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Colascione @ 2012-08-17  7:18 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]

On 8/16/2012 8:51 PM, Daniel Colascione wrote:
> On 8/16/2012 11:43 AM, Christopher Faylor wrote:
>> On Tue, Aug 14, 2012 at 10:36:39PM -0700, Daniel Colascione wrote:
>>> When run on a Linux machine, this program starts up and blocks on sigwaitinfo.
>>> You can suspend and resume the program using usual job control facilities, and
>>> on SIGINT, the program prints a message and exits. When the program resumes
>>> after being stopped, it prints "resumed".
>>>
>>> With the 2012-08-07 Cygwin snapshot, this program prints "resumed" immediately
>>> after receiving SIGTSTP, then fails to respond to any signal, even signals not
>>> in the blocked set. A simpler test program that just calls "raise (SIGSTOP)"
>>> property stops itself before resuming execution.
>>
>> This should be fixed in the latest snapshot.
>>
>> Thanks for the test case.
> 
> Thanks for the fix. It's incomplete, though. Previously, C-z would make the
> program print "resumed", then become insensitive the signals present in
> waitmask. With the 2012-08-16 snapshot, C-z stops the program, but on
> resumption, it doesn't print "resumed". Instead, on resumption, the program
> enters the same signal-insensitive state it did with the 2012-08-07 snapshot.
> 

More odd behavior under the 2012-08-16 snapshot:

1) Start vim
2) Hit C-z
3) Run "fg"
4) Observe that vim doesn't reappear. Rather, nothing happens, until...
5) C-c
6) vim now redisplays and accepts input



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Another sigwaitinfo problem (with testcase)
  2012-08-17  7:18     ` Daniel Colascione
@ 2012-08-17 19:28       ` Achim Gratz
  0 siblings, 0 replies; 5+ messages in thread
From: Achim Gratz @ 2012-08-17 19:28 UTC (permalink / raw)
  To: cygwin

Daniel Colascione writes:
> More odd behavior under the 2012-08-16 snapshot:
>
> 1) Start vim
> 2) Hit C-z
> 3) Run "fg"
> 4) Observe that vim doesn't reappear. Rather, nothing happens, until...
> 5) C-c
> 6) vim now redisplays and accepts input

I can confirm this behaviour.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-17 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15  8:04 Another sigwaitinfo problem (with testcase) Daniel Colascione
2012-08-16 19:12 ` Christopher Faylor
2012-08-17  4:20   ` Daniel Colascione
2012-08-17  7:18     ` Daniel Colascione
2012-08-17 19:28       ` Achim Gratz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).