Skip to content

Thread clone segfaults if a class with no fields exists #23771

@leonerd

Description

@leonerd
$ ./perl -Ilib -Mthreads -Mfeature=class -E \
  'class X {}; threads->create( sub { say "Hello"; 1 })->join()'
class is experimental at -e line 1.
Segmentation fault

Empty classes do not crash without threads.

Does not crash if you add a field:

$ ./perl -Ilib -Mthreads -Mfeature=class -E 'class X { field $y; }; threads->create( sub { say "Hello"; 1 })->join()'
class is experimental at -e line 1.
field is experimental at -e line 1.
Hello

Metadata

Metadata

Assignees

Labels

BugclassIssues related to 'class' keyword or __CLASS__

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions