From: "byroot (Jean Boussier) via ruby-core" Date: 2023-12-06T08:02:09+00:00 Subject: [ruby-core:115601] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault Issue #20042 has been updated by byroot (Jean Boussier). Actually nevermind, my simplification was wrong. Using exactly your script, it crash all the way to 3.0. ``` :x: 3.0 ���������:35: [BUG] Stack consistency error (sp: 17, bp: 15) ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux] -- Control frame information ----------------------------------------------- c:0003 p:0011 s:0017 e:000014 METHOD :35 c:0002 p:0060 s:0007 E:001af8 EVAL -:10 [FINISH] c:0001 p:0000 s:0003 E:002140 (none) [FINISH] -- Ruby level backtrace information ---------------------------------------- :x: 3.1 :34: warning: Exception in finalizer # -:2:in `call': wrong number of arguments (given 1, expected 0) (ArgumentError) from :34:in `start' from -:10:in `
' :35:in `start': Stack consistency error (sp: 17, bp: 15) (fatal) :x: 3.2 ���������:34: warning: Exception in finalizer # -:2:in `call': wrong number of arguments (given 1, expected 0) (ArgumentError) from :34:in `start' from -:10:in `
' :35: [BUG] Stack consistency error (sp: 17, bp: 15) :x: 7e05e9ff94 (2023-12-06T06:48:55Z) ���������:39: warning: Exception in finalizer # -:2:in `call': wrong number of arguments (given 1, expected 0) (ArgumentError) from :39:in `start' from -:10:in `
' :40: [BUG] Stack consistency error (sp: 17, bp: 15) ``` ---------------------------------------- Bug #20042: ObjectSpace finalizer can cause segfault https://bugs.ruby-lang.org/issues/20042#change-105531 * Author: ioquatix (Samuel Williams) * Status: Open * Priority: Normal * Assignee: ko1 (Koichi Sasada) * Backport: 3.0: DONTNEED, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- ```ruby class Finalizer def call # <- missing (id) argument end end object = Object.new ObjectSpace.define_finalizer(object, Finalizer.new) object = nil GC.start # segfaults here ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/