ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:115594] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault
@ 2023-12-05 20:47 ioquatix (Samuel Williams) via ruby-core
  2023-12-06  7:59 ` [ruby-core:115600] " byroot (Jean Boussier) via ruby-core
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ioquatix (Samuel Williams) via ruby-core @ 2023-12-05 20:47 UTC (permalink / raw
  To: ruby-core; +Cc: ioquatix (Samuel Williams)

Issue #20042 has been reported by ioquatix (Samuel Williams).

----------------------------------------
Bug #20042: ObjectSpace finalizer can cause segfault
https://bugs.ruby-lang.org/issues/20042

* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
```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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:115600] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault
  2023-12-05 20:47 [ruby-core:115594] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault ioquatix (Samuel Williams) via ruby-core
@ 2023-12-06  7:59 ` byroot (Jean Boussier) via ruby-core
  2023-12-06  8:02 ` [ruby-core:115601] " byroot (Jean Boussier) via ruby-core
  2024-01-18  3:20 ` [ruby-core:116284] " nagachika (Tomoyuki Chikanaga) via ruby-core
  2 siblings, 0 replies; 4+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2023-12-06  7:59 UTC (permalink / raw
  To: ruby-core; +Cc: byroot (Jean Boussier)

Issue #20042 has been updated by byroot (Jean Boussier).

Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 3.0: DONTNEED, 3.1: REQUIRED, 3.2: REQUIRED

It started on 3.1:

```
:ok: 1.8 -- 3.0
(no stdout :speak_no_evil:)
:ok: 3.1,3.2
<internal:gc>:34: warning: Exception in finalizer #<Method: Object#fin() -:2>
-:2:in `fin': wrong number of arguments (given 1, expected 0) (ArgumentError)
    from <internal:gc>:34:in `call'
    from <internal:gc>:34:in `start'
    from -:7:in `<main>'


:ok: 7e05e9ff94 (2023-12-06T06:48:55Z)
<internal:gc>:39: warning: Exception in finalizer #<Method: Object#fin() -:2>
-:2:in `fin': wrong number of arguments (given 1, expected 0) (ArgumentError)
    from <internal:gc>:39:in `call'
    from <internal:gc>:39:in `start'
    from -:7:in `<main>'
```

----------------------------------------
Bug #20042: ObjectSpace finalizer can cause segfault
https://bugs.ruby-lang.org/issues/20042#change-105530

* 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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:115601] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault
  2023-12-05 20:47 [ruby-core:115594] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault ioquatix (Samuel Williams) via ruby-core
  2023-12-06  7:59 ` [ruby-core:115600] " byroot (Jean Boussier) via ruby-core
@ 2023-12-06  8:02 ` byroot (Jean Boussier) via ruby-core
  2024-01-18  3:20 ` [ruby-core:116284] " nagachika (Tomoyuki Chikanaga) via ruby-core
  2 siblings, 0 replies; 4+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2023-12-06  8:02 UTC (permalink / raw
  To: ruby-core; +Cc: byroot (Jean Boussier)

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
```<internal:gc>: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 <internal:gc>: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
<internal:gc>:34: warning: Exception in finalizer #<Finalizer:0x00007fc730f72e30>
-:2:in `call': wrong number of arguments (given 1, expected 0) (ArgumentError)
    from <internal:gc>:34:in `start'
    from -:10:in `<main>'
<internal:gc>:35:in `start': Stack consistency error (sp: 17, bp: 15) (fatal)

:x: 3.2
```<internal:gc>:34: warning: Exception in finalizer #<Finalizer:0x00007fe950ab9d98>
-:2:in `call': wrong number of arguments (given 1, expected 0) (ArgumentError)
    from <internal:gc>:34:in `start'
    from -:10:in `<main>'
<internal:gc>:35: [BUG] Stack consistency error (sp: 17, bp: 15)


:x: 7e05e9ff94 (2023-12-06T06:48:55Z)
```<internal:gc>:39: warning: Exception in finalizer #<Finalizer:0x00007fae4e314850>
-:2:in `call': wrong number of arguments (given 1, expected 0) (ArgumentError)
    from <internal:gc>:39:in `start'
    from -:10:in `<main>'
<internal:gc>: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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:116284] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault
  2023-12-05 20:47 [ruby-core:115594] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault ioquatix (Samuel Williams) via ruby-core
  2023-12-06  7:59 ` [ruby-core:115600] " byroot (Jean Boussier) via ruby-core
  2023-12-06  8:02 ` [ruby-core:115601] " byroot (Jean Boussier) via ruby-core
@ 2024-01-18  3:20 ` nagachika (Tomoyuki Chikanaga) via ruby-core
  2 siblings, 0 replies; 4+ messages in thread
From: nagachika (Tomoyuki Chikanaga) via ruby-core @ 2024-01-18  3:20 UTC (permalink / raw
  To: ruby-core; +Cc: nagachika (Tomoyuki Chikanaga)

Issue #20042 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED to 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE

ruby_3_2 0cc0e43745ffc13a596441adccee295274d99a0b merged revision(s) f9a48548cf3ef54fc0a385ccd78c708737055ecc.

----------------------------------------
Bug #20042: ObjectSpace finalizer can cause segfault
https://bugs.ruby-lang.org/issues/20042#change-106306

* Author: ioquatix (Samuel Williams)
* Status: Closed
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE
----------------------------------------
```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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-18  3:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05 20:47 [ruby-core:115594] [Ruby master Bug#20042] ObjectSpace finalizer can cause segfault ioquatix (Samuel Williams) via ruby-core
2023-12-06  7:59 ` [ruby-core:115600] " byroot (Jean Boussier) via ruby-core
2023-12-06  8:02 ` [ruby-core:115601] " byroot (Jean Boussier) via ruby-core
2024-01-18  3:20 ` [ruby-core:116284] " nagachika (Tomoyuki Chikanaga) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).