# Signal handling behaviour change after ruby upgrade

**URL:** <https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107>\
**Category:** Ruby\
**Created:** [October 21, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107 "2006-10-21T14:19:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 21, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107/1 "2006-10-21T14:19:07Z")

</div>

I use an init system written in ruby for my Gnu/linux distro, and it  
makes heavy use of signal handling.

After upgrading (stable snapshots)  
from  
ruby 1.8.3 (2005-10-26)  
to  
ruby 1.8.5 (2006-10-18)

nothing much works any more. It seems that signals are no longer  
delivered until _after_ a blocking system call returns. For example:

```
#!/bin/ruby -w

trap("USR1") { puts("USR1") }
fork { sleep 60 }
pid = Process::wait()

```

If you run this up under a recent snapshot and fire some signals at  
the process with

```
kill -USR1 <pid>

```

you will get no “USR1” output until AFTER the 60seconds have elapsed and  
Process::wait() returns.

The old behaviour was to handle signals immediately, with presumably  
SA\_RESTART (or whatever it is called) set such that the wait system call  
just carries on unaffected after the signal handler has been run.

So, is the change intentional? If so, whats the rationale?

Andrew Walrond

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 22, 2006, 9:55am UTC](https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107/2 "2006-10-22T09:55:59Z")

</div>

Hi,

In message “Re: Signal handling behaviour change after ruby upgrade”  
on Sat, 21 Oct 2006 21:17:46 +0900, removed\_email\_address@domain.invalid writes:

|I use an init system written in ruby for my Gnu/linux distro, and it  
|makes heavy use of signal handling.  
|  
|After upgrading (stable snapshots)  
|from  
| ruby 1.8.3 (2005-10-26)  
|to  
| ruby 1.8.5 (2006-10-18)

It was caused by a partial backport from the HEAD. The problem was  
reported more than year ago in [ruby-talk:147220] by Guillaume  
Marcais, but somehow I missed it. I am sorry. It will be fixed in  
the snapshot soon.

```
						matz.
```

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 22, 2006, 10:34am UTC](https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107/3 "2006-10-22T10:34:03Z")

</div>

On Sun, Oct 22, 2006 at 04:54:21PM +0900, Yukihiro M. wrote:

> It was caused by a partial backport from the HEAD. The problem was  
> reported more than year ago in [ruby-talk:147220] by Guillaume  
> Marcais, but somehow I missed it. I am sorry. It will be fixed in  
> the snapshot soon.
> 
> ```
> matz.
> 
> ```

Well ok, but don’t let it happen again 😉

(I don’t think you need make apologies; especially here!)

Andrew Walrond

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 23, 2006, 3:09am UTC](https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107/4 "2006-10-23T03:09:55Z")

</div>

Yukihiro M. wrote:

> It will be fixed in the snapshot soon.

Time machine batteries dead?

David V.  
Running for the hills

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 23, 2006, 7:02am UTC](https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107/5 "2006-10-23T07:02:44Z")

</div>

Hi,

In message “Re: Signal handling behaviour change after ruby upgrade”  
on Mon, 23 Oct 2006 10:09:17 +0900, David V.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|\> It will be fixed in the snapshot soon.  
|  
|Time machine batteries dead?

Usually I am living in the future. But I am in the States now. 😉

```
						matz.

```

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 23, 2006, 7:16am UTC](https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107/6 "2006-10-23T07:16:45Z")

</div>

Yukihiro M. wrote:

> ```
> matz.
> 
> ```

Yeah … it’s tomorrow where you live. 🙂

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 7, 2006, 10:45am UTC](https://www.ruby-forum.com/t/signal-handling-behaviour-change-after-ruby-upgrade/73107/7 "2006-11-07T10:45:04Z")

</div>

On Sun, Oct 22, 2006 at 04:54:21PM +0900, Yukihiro M. wrote:

> It was caused by a partial backport from the HEAD. The problem was  
> reported more than year ago in [ruby-talk:147220] by Guillaume  
> Marcais, but somehow I missed it. I am sorry. It will be fixed in  
> the snapshot soon.

Fixed - thanks!

Andrew Walrond
