Bug #9110

double free or corruption error at_exit with callcc

Added by Masaki Matsushita over 1 year ago. Updated about 1 year ago.

[ruby-core:58329]
Status:Closed
Priority:Normal
Assignee:Masaki Matsushita
ruby -v:ruby 2.1.0dev (2013-11-14 trunk 43675) [x86_64-linux] Backport:1.9.3: DONE, 2.0.0: DONE

Description

Following code causes double free or corruption error.

require "continuation"

c = nil
at_exit { c.call }
at_exit { callcc {|_c| c = _c } }

patch.diff Magnifier - defer xfree() of end_procs (1.25 KB) Masaki Matsushita, 11/14/2013 01:12 PM

Associated revisions

Revision 43685
Added by glass over 1 year ago

  • eval_jump.c (rb_exec_end_proc): fix double free or corruption error
    when reentering by callcc. [Bug #9110]

    • test/ruby/test_beginendblock.rb: test for above.

Revision 43685
Added by glass over 1 year ago

  • eval_jump.c (rb_exec_end_proc): fix double free or corruption error
    when reentering by callcc. [Bug #9110]

    • test/ruby/test_beginendblock.rb: test for above.

Revision 43705
Added by Nobuyoshi Nakada over 1 year ago

eval_jump.c: refix [Bug #9110]

  • eval_jump.c (rb_exec_end_proc): unlink and free procs data before calling for each procs. [Bug #9110]

Revision 43705
Added by Nobuyoshi Nakada over 1 year ago

eval_jump.c: refix [Bug #9110]

  • eval_jump.c (rb_exec_end_proc): unlink and free procs data before calling for each procs. [Bug #9110]

History

#1 Updated by Masaki Matsushita over 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Masaki Matsushita
  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: REQUIRED to 1.9.3: REQUIRED, 2.0.0: REQUIRED

#2 Updated by Anonymous over 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r43685.
Masaki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • eval_jump.c (rb_exec_end_proc): fix double free or corruption error
    when reentering by callcc. [Bug #9110]

    • test/ruby/test_beginendblock.rb: test for above.

#3 Updated by Tomoyuki Chikanaga about 1 year ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED to 1.9.3: REQUIRED, 2.0.0: DONE

r43685, r43690 and r43705 were backported to ruby_2_0_0 at r44325.

#4 Updated by Usaku NAKAMURA about 1 year ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: DONE to 1.9.3: DONE, 2.0.0: DONE

backported into ruby_1_9_3 at r44740.

Also available in: Atom PDF