Forum: Ruby-core [ruby-trunk - Bug #7570][Open] rb_fatal() in Fiber don't terminate process

5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2012-12-15 18:02
(Received via mailing list)
Issue #7570 has been reported by nagachika (Tomoyuki Chikanaga).

----------------------------------------
Bug #7570: rb_fatal() in Fiber don't terminate process
https://bugs.ruby-lang.org/issues/7570

Author: nagachika (Tomoyuki Chikanaga)
Status: Open
Priority: Low
Assignee:
Category: core
Target version:
ruby -v: ruby 2.0.0dev (2012-12-16 trunk 38414) [x86_64-darwin10.8.0]


rb_fatal() (C function) should terminate whole script.

  Thread.start{
    rb_fatal() # a extension library method calling rb_fatal()
  }.resume
  p :ng  # => never reached here

But rb_fatal() inside Fiber could be ignored.

  Fiber.start{
    rb_fatal()
  }.resume
  p :ng    # => reached here!

I think it's because TAG_FATAL is ignored in
rb_vm_make_jump_tag_but_local_jump().
I'll attach a patch with a testcase.
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 ko1 (Koichi Sasada) (Guest)
on 2012-12-17 21:48
(Received via mailing list)
Issue #7570 has been updated by ko1 (Koichi Sasada).

Assignee set to ko1 (Koichi Sasada)
Target version set to 2.0.0

Thank you for your report.

Your patch seems good and passed test-all on my environment.
Could you commit it?

----------------------------------------
Bug #7570: rb_fatal() in Fiber don't terminate process
https://bugs.ruby-lang.org/issues/7570#change-34810

Author: nagachika (Tomoyuki Chikanaga)
Status: Open
Priority: Low
Assignee: ko1 (Koichi Sasada)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-16 trunk 38414) [x86_64-darwin10.8.0]


rb_fatal() (C function) should terminate whole script.

  Thread.start{
    rb_fatal() # a extension library method calling rb_fatal()
  }.resume
  p :ng  # => never reached here

But rb_fatal() inside Fiber could be ignored.

  Fiber.start{
    rb_fatal()
  }.resume
  p :ng    # => reached here!

I think it's because TAG_FATAL is ignored in
rb_vm_make_jump_tag_but_local_jump().
I'll attach a patch with a testcase.
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2012-12-18 15:03
(Received via mailing list)
Issue #7570 has been updated by nagachika (Tomoyuki Chikanaga).

Status changed from Open to Closed

Thank you for your review.
I've committed at r38441.
----------------------------------------
Bug #7570: rb_fatal() in Fiber don't terminate process
https://bugs.ruby-lang.org/issues/7570#change-34828

Author: nagachika (Tomoyuki Chikanaga)
Status: Closed
Priority: Low
Assignee: ko1 (Koichi Sasada)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-16 trunk 38414) [x86_64-darwin10.8.0]


rb_fatal() (C function) should terminate whole script.

  Thread.start{
    rb_fatal() # a extension library method calling rb_fatal()
  }.resume
  p :ng  # => never reached here

But rb_fatal() inside Fiber could be ignored.

  Fiber.start{
    rb_fatal()
  }.resume
  p :ng    # => reached here!

I think it's because TAG_FATAL is ignored in
rb_vm_make_jump_tag_but_local_jump().
I'll attach a patch with a testcase.
This topic is locked and can not be replied to.