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)
Wed, Apr 17, 3:26 PM
Unknown Object (File)
Jan 14 2024, 7:07 AM
Unknown Object (File)
Dec 20 2023, 7:13 AM
Unknown Object (File)
Dec 13 2023, 6:59 PM
Unknown Object (File)
Oct 25 2023, 3:45 PM
Unknown Object (File)
Oct 3 2023, 5:02 PM
Unknown Object (File)
Sep 6 2023, 1:53 AM
Unknown Object (File)
Sep 6 2023, 1:27 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.