Skip to content

linux: don't walk the rendez-vous while the linker is mid-update - #235

Merged
schopin-mozilla merged 1 commit into
mainfrom
rdv-linker-status
Sep 17, 2026
Merged

schopin-mozilla merged 1 commit into
mainfrom
rdv-linker-status

Conversation

@schopin-mozilla

Copy link
Copy Markdown
Collaborator

While playing around with edge cases scenarii, one of them stood out:
what would happen if there was a crash during a dlopen() call? That's
what this patch is about.

Luckily for us, the libc folks know their stuff, and have a marker field
in the RT_DEBUG structure: r_state. It is present in both bionic and
glibc, with the same standard values, so we can probably assume it's
fairly standard, probably part of the SVR4 ABI – not that it's
documented anywhere besides random blog articles that lamented at the
same thing.

In any case, we can now bail early if the linker doesn't explicitly mark
its data as consistent. Note that this impacts the DSO data dump, that
will now be empty rather than filled with garbage, as well as the module
stream that'll fall back to procmaps.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@schopin-mozilla

Copy link
Copy Markdown
Collaborator Author

Note that this PR comes in this late in the stack because the tests for it are using things from previous patches. The fix itself could have been moved way earlier.

@schopin-mozilla
schopin-mozilla force-pushed the rdv-linker-status branch 2 times, most recently from 8babaee to 8e618c1 Compare September 1, 2026 14:22
@schopin-mozilla
schopin-mozilla force-pushed the rdv-linker-status branch 3 times, most recently from 26f2788 to 892f2ad Compare September 9, 2026 07:48
@schopin-mozilla
schopin-mozilla force-pushed the rdv-linker-status branch 2 times, most recently from 6be0613 to 1410291 Compare September 11, 2026 15:37
@schopin-mozilla
schopin-mozilla removed this pull request from stack #236 September 14, 2026 16:22
@schopin-mozilla
schopin-mozilla added this pull request to stack #242 September 14, 2026 16:31

@gabrielesvelto gabrielesvelto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from rdv-main to main September 17, 2026 11:37
While playing around with edge cases scenarii, one of them stood out:
what would happen if there was a crash *during* a dlopen() call? That's
what this patch is about.

Luckily for us, the libc folks know their stuff, and have a marker field
in the RT_DEBUG structure: `r_state`. It is present in both bionic and
glibc, with the same standard values, so we can probably assume it's
fairly standard, probably part of the SVR4 ABI – not that it's
documented anywhere besides random blog articles that lamented at the
same thing.

In any case, we can now bail early if the linker doesn't explicitly mark
its data as consistent. Note that this impacts the DSO data dump, that
will now be empty rather than filled with garbage, as well as the module
stream that'll fall back to procmaps.
@schopin-mozilla
schopin-mozilla merged commit a97f883 into main Sep 17, 2026
16 checks passed
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.

2 participants