Bug #9110

double free or corruption error at_exit with callcc

Added by Masaki Matsushita 5 months ago. Updated 3 months ago.

[ruby-core:58329]
Status:Closed
Priority:Normal
Assignee:Masaki Matsushita
Category:core
Target version:-
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
atexit { 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 5 months ago

  • evaljump.c (rbexecendproc): 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 5 months ago

eval_jump.c: refix [Bug #9110]

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

History

#1 Updated by Masaki Matsushita 5 months 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 5 months 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.


  • evaljump.c (rbexecendproc): 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 4 months 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 ruby20_0 at r44325.

#4 Updated by Usaku NAKAMURA 3 months ago

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

backported into ruby19_3 at r44740.

Also available in: Atom PDF