Skip to content

Fix up subsystem termination order #18439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

khwilliamson
Copy link
Contributor

During destruction, a list is executed in order. Here's a couple of
them:
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM;

If something goes wrong, and the I/O system has already been destructed,
it's hard to figure out what's going on. This is solved simply by
moving the I/O termination to the end of the list.

@khwilliamson khwilliamson requested a review from tonycoz December 25, 2020 02:31
@Leont
Copy link
Contributor

Leont commented Dec 25, 2020

I would expect PERLIO_TERM to have to happen before MALLOC_TERM, otherwise mymalloc can get confused? (as PerlIO_teardown() uses free()

@jkeenan
Copy link
Contributor

jkeenan commented Jan 26, 2021

@khwilliamson , @Leont, Can we get an update on the status of this p.r.?

Thank you very much.
Jim Keenan

@tonycoz
Copy link
Contributor

tonycoz commented Jan 26, 2021

Yes,

I would expect PERLIO_TERM to have to happen before MALLOC_TERM, otherwise mymalloc can get confused? (as PerlIO_teardown() uses free()

mymalloc uses PerlIO under -Dm (which is probably a bug.)

The IO and memory terminations need to be after other things.  Add a
comment so that future maintainers won't make the mistakes I did.

Also refactor to that amiga os doesn't have a separate list to get out
of sync

I suspect that the amiga termination should be moved to earlier in
the sequence, but absent any evidence; I'm leaving it unchanged.
@khwilliamson khwilliamson changed the title Move I/O destruction to end of list Fix up subsystem termination order Feb 11, 2021
@khwilliamson khwilliamson requested a review from Leont February 11, 2021 19:52

#ifndef PERL_SYS_TERM_BODY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need this #ifdef. There are several operating systems that still define their own PERL_SYS_INIT_BODY (plan9, dos, vms, os2).

Maybe this can be refactored into some OS_SYS_INIT_, I haven't looked into potential ordering issues.

@khwilliamson khwilliamson deleted the smoke-me/khw-pr4 branch May 25, 2021 21:07
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.

None yet

4 participants