Skip to content

Conversation

@leonerd
Copy link
Contributor

@leonerd leonerd commented Sep 26, 2025

Fixes #23771

This fixes two separate but related bugs.

  • Thread clone crashed if any class existed with no fields in it. This is fixed by permitting a NULL PADNAMELIST parameter to padnamelist_dup().

  • Thread cloning would unreliably segfault due to missing PadnameFIELDINFO() of an outer closure capture, depending on the exact order of CV discovery. This is fixed by correct usage of the PL_ptr_table to store details of cloned struct padname_fieldinfo structures, and careful ordering of assignments and recursive clone calls.

  • This set of changes does not require a perldelta entry as it is two small bugfixes to an experimental feature

@Leont
Copy link
Contributor

Leont commented Sep 26, 2025

Can you please keep your commit titles below 72 characters, most git tools (including github) don't handle longer titles gracefully.

This fixes two separate but related bugs.

 * Thread clone crashed if any class existed with no fields in it. This
   is fixed by permitting a NULL PADNAMELIST parameter to
   padnamelist_dup(). [GH23771]

 * Thread cloning would unreliably segfault due to missing
   PadnameFIELDINFO() of an outer closure capture, depending on the
   exact order of CV discovery. This is fixed by correct usage of the
   PL_ptr_table to store details of cloned `struct padname_fieldinfo`
   structures, and careful ordering of assignments and recursive clone
   calls.
@leonerd
Copy link
Contributor Author

leonerd commented Sep 26, 2025

Can you please keep your commit titles below 72 characters, most git tools (including github) don't handle longer titles gracefully.

Reworded

@leonerd leonerd merged commit 05fb844 into Perl:blead Sep 27, 2025
33 checks passed
@leonerd leonerd deleted the gh23771 branch September 27, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thread clone segfaults if a class with no fields exists

2 participants