ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:92428] [Ruby trunk Bug#15798] Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD
       [not found] <redmine.issue-15798.20190426234626@ruby-lang.org>
@ 2019-04-26 23:46 ` merch-redmine
  2019-05-16 15:54 ` [ruby-core:92684] " merch-redmine
  2019-08-03 12:27 ` [ruby-core:94131] [Ruby master " nagachika00
  2 siblings, 0 replies; 3+ messages in thread
From: merch-redmine @ 2019-04-26 23:46 UTC (permalink / raw)
  To: ruby-core

Issue #15798 has been reported by jeremyevans0 (Jeremy Evans).

----------------------------------------
Bug #15798: Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD
https://bugs.ruby-lang.org/issues/15798

* Author: jeremyevans0 (Jeremy Evans)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-04-26 trunk e804fcb42c) [x86_64-openbsd]
* Backport: 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED
----------------------------------------
When using UBF_TIMER_PTHREAD, the timer_pthread_fn function will
not signal the main thread with SIGVTALRM in cases where
timer_pthread is armed before consume_communication_pipe is called.
This is because consume_communication_pipe will unarm the timer.

Fix this by checking the return value of consume_communication_pipe.
If it returns TRUE and the timer_pthread is disarmed, then signal
the main thread with SIGVTALRM.

This fixes TestThread#test_thread_timer_and_interrupt. It also 
fixes the use of Ctrl+C/SIGINT in irb on OpenBSD, and I'm guessing
other platforms that use UBF_TIMER_PTHREAD.  Previously,
you could hit Ctrl+C multiple times and it would do nothing until
another key was pressed (even Backspace).

If this is determined to be the correct fix, this should be
backported to 2.6, but it is not a problem in earlier versions.

---Files--------------------------------
fix-pthread-timer.patch (2.43 KB)


-- 
https://bugs.ruby-lang.org/

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

* [ruby-core:92684] [Ruby trunk Bug#15798] Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD
       [not found] <redmine.issue-15798.20190426234626@ruby-lang.org>
  2019-04-26 23:46 ` [ruby-core:92428] [Ruby trunk Bug#15798] Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD merch-redmine
@ 2019-05-16 15:54 ` merch-redmine
  2019-08-03 12:27 ` [ruby-core:94131] [Ruby master " nagachika00
  2 siblings, 0 replies; 3+ messages in thread
From: merch-redmine @ 2019-05-16 15:54 UTC (permalink / raw)
  To: ruby-core

Issue #15798 has been updated by jeremyevans0 (Jeremy Evans).


I've tested on Linux when forcing UBF_TIMER_PTHREAD.  While the patch does not appear to be necessary on Linux, there are no regressions in the tests when using it, so it should be safe.  It does fix the annoying current behavior on OpenBSD, so I hope a committer can review and commit it.

----------------------------------------
Bug #15798: Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD
https://bugs.ruby-lang.org/issues/15798#change-78044

* Author: jeremyevans0 (Jeremy Evans)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-04-26 trunk e804fcb42c) [x86_64-openbsd]
* Backport: 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED
----------------------------------------
When using UBF_TIMER_PTHREAD, the timer_pthread_fn function will
not signal the main thread with SIGVTALRM in cases where
timer_pthread is armed before consume_communication_pipe is called.
This is because consume_communication_pipe will unarm the timer.

Fix this by checking the return value of consume_communication_pipe.
If it returns TRUE and the timer_pthread is disarmed, then signal
the main thread with SIGVTALRM.

This fixes TestThread#test_thread_timer_and_interrupt. It also 
fixes the use of Ctrl+C/SIGINT in irb on OpenBSD, and I'm guessing
other platforms that use UBF_TIMER_PTHREAD.  Previously,
you could hit Ctrl+C multiple times and it would do nothing until
another key was pressed (even Backspace).

If this is determined to be the correct fix, this should be
backported to 2.6, but it is not a problem in earlier versions.

---Files--------------------------------
fix-pthread-timer.patch (2.43 KB)


-- 
https://bugs.ruby-lang.org/

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

* [ruby-core:94131] [Ruby master Bug#15798] Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD
       [not found] <redmine.issue-15798.20190426234626@ruby-lang.org>
  2019-04-26 23:46 ` [ruby-core:92428] [Ruby trunk Bug#15798] Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD merch-redmine
  2019-05-16 15:54 ` [ruby-core:92684] " merch-redmine
@ 2019-08-03 12:27 ` nagachika00
  2 siblings, 0 replies; 3+ messages in thread
From: nagachika00 @ 2019-08-03 12:27 UTC (permalink / raw)
  To: ruby-core

Issue #15798 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE

ruby_2_6 r67725 merged revision(s) 1ef39d8d099f145222b9352423af16a2bab6e05b.

----------------------------------------
Bug #15798: Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD
https://bugs.ruby-lang.org/issues/15798#change-80380

* Author: jeremyevans0 (Jeremy Evans)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-04-26 trunk e804fcb42c) [x86_64-openbsd]
* Backport: 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE
----------------------------------------
When using UBF_TIMER_PTHREAD, the timer_pthread_fn function will
not signal the main thread with SIGVTALRM in cases where
timer_pthread is armed before consume_communication_pipe is called.
This is because consume_communication_pipe will unarm the timer.

Fix this by checking the return value of consume_communication_pipe.
If it returns TRUE and the timer_pthread is disarmed, then signal
the main thread with SIGVTALRM.

This fixes TestThread#test_thread_timer_and_interrupt. It also 
fixes the use of Ctrl+C/SIGINT in irb on OpenBSD, and I'm guessing
other platforms that use UBF_TIMER_PTHREAD.  Previously,
you could hit Ctrl+C multiple times and it would do nothing until
another key was pressed (even Backspace).

If this is determined to be the correct fix, this should be
backported to 2.6, but it is not a problem in earlier versions.

---Files--------------------------------
fix-pthread-timer.patch (2.43 KB)


-- 
https://bugs.ruby-lang.org/

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

end of thread, other threads:[~2019-08-03 12:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15798.20190426234626@ruby-lang.org>
2019-04-26 23:46 ` [ruby-core:92428] [Ruby trunk Bug#15798] Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD merch-redmine
2019-05-16 15:54 ` [ruby-core:92684] " merch-redmine
2019-08-03 12:27 ` [ruby-core:94131] [Ruby master " nagachika00

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).