Skip to content

Trap SIGBUS when Configure checks for va_copy #18148

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

Conversation

afresh1
Copy link
Contributor

@afresh1 afresh1 commented Sep 17, 2020

On several systems the attempt to determine if we "need va_copy() or
similar" results in a SIGBUS instead of a SIGSEGV because the fault
happens pointing at an io device address.

While reviewing accounting logs during the OpenBSD system build, bluhm@
noticed a core dump and deraadt@ tracked it down.

While researching it was discovered that this is a fairly common case in
other systems as well.

Original diff by deraadt@

This was committed to OpenBSD already.

On several systems the attempt to determine if we "need va_copy() or
similar" results in a SIGBUS instead of a SIGSEGV because the fault
happens pointing at an io device address.

While reviewing accounting logs during the OpenBSD system build, bluhm@
noticed a core dump and deraadt@ tracked it down.

While researching it was discovered that this is a fairly common case in
other systems as well.

Original diff by deraadt@
@jkeenan
Copy link
Contributor

jkeenan commented Sep 17, 2020

I extracted try.c from Configure and ran it on OpenBSD (without contributor's patch), FreeBSD, NetBSD and Linux. I got the segfault in the first two cases. Contributor's patch eliminated the segfaults in those cases. So, +1.

@Leont
Copy link
Contributor

Leont commented Sep 17, 2020

What are the consequences exactly? Is this just a minor inconvenience, or should it be backported to maintenance releases of perl.

@afresh1
Copy link
Contributor Author

afresh1 commented Sep 17, 2020

I believe just inconvenience, it fails the try either way so the results are the same, just a message about it on the console and a core file that is deleted automatically.

Tux added a commit that referenced this pull request Sep 22, 2020
On several systems the attempt to determine if we "need va_copy() or
similar" results in a SIGBUS instead of a SIGSEGV because the fault
happens pointing at an io device address.

While reviewing accounting logs during the OpenBSD system build, bluhm@
noticed a core dump and deraadt@ tracked it down.

While researching it was discovered that this is a fairly common case in
other systems as well.

Original diff by deraadt@
@Tux
Copy link
Contributor

Tux commented Sep 22, 2020

Updated the metaunit and regenerated Configure.
Note that PR's directly to Configure can generally not be "pulled", as Configure is generated
Thanks and sorry for the delay.

@Tux Tux closed this Sep 22, 2020
steve-m-hay pushed a commit that referenced this pull request Dec 26, 2020
On several systems the attempt to determine if we "need va_copy() or
similar" results in a SIGBUS instead of a SIGSEGV because the fault
happens pointing at an io device address.

While reviewing accounting logs during the OpenBSD system build, bluhm@
noticed a core dump and deraadt@ tracked it down.

While researching it was discovered that this is a fairly common case in
other systems as well.

Original diff by deraadt@

(cherry picked from commit bec07c3)
@afresh1 afresh1 deleted the Trap-SIGBUS-in-Configure-va_copy branch March 5, 2023 19:38
khwilliamson pushed a commit to khwilliamson/perl5 that referenced this pull request Jul 28, 2023
On several systems the attempt to determine if we "need va_copy() or
similar" results in a SIGBUS instead of a SIGSEGV because the fault
happens pointing at an io device address.

While reviewing accounting logs during the OpenBSD system build, bluhm@
noticed a core dump and deraadt@ tracked it down.

While researching it was discovered that this is a fairly common case in
other systems as well.

Original diff by deraadt@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants