Page MenuHomeFreeBSD

x86: clear %db registers in new process
ClosedPublic

Authored by kib on Mar 30 2021, 3:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 7 2024, 8:44 AM
Unknown Object (File)
Oct 7 2024, 8:44 AM
Unknown Object (File)
Oct 7 2024, 8:44 AM
Unknown Object (File)
Oct 7 2024, 8:44 AM
Unknown Object (File)
Oct 7 2024, 8:22 AM
Unknown Object (File)
Oct 4 2024, 2:44 PM
Unknown Object (File)
Oct 4 2024, 1:51 PM
Unknown Object (File)
Oct 4 2024, 5:35 AM

Details

Summary

Reported by: Michał Górny <mgorny@gentoo.org>
PR: 254661

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Mar 30 2021, 3:59 PM
kib created this revision.

Clearing %db registers seems to be the right thing to do for forked process.

What is the opinion about new thread? Should we inherit or clear db state? [Patch currently clears]

In D29496#661038, @kib wrote:

Clearing %db registers seems to be the right thing to do for forked process.

What is the opinion about new thread? Should we inherit or clear db state? [Patch currently clears]

I don't have a strong opinion. Because of the other bug I've reported earlier, in LLDB we have to copy them anyway, so clearing is fine for me.

That said, I haven't tested other arches, they may be affected as well.

In D29496#661038, @kib wrote:

Clearing %db registers seems to be the right thing to do for forked process.

What is the opinion about new thread? Should we inherit or clear db state? [Patch currently clears]

I don't have a strong opinion.

Do you know what Linux does?

Do you know what Linux does?

I don't know for sure but I haven't seen any dbreg copying code in the Linux plugin, so I think threads inherit dbregs on Linux.

kib retitled this revision from x86: clear %db registers in new thread/process to x86: clear %db registers in new process.

Only clear %dbX for new process, keep new thread inherit them.

LGTM. We can switch back to the per-thread case if we get new information.

This revision is now accepted and ready to land.Mar 30 2021, 10:58 PM
This revision was automatically updated to reflect the committed changes.