Page MenuHomeFreeBSD

x86: clear %db registers in new process
ClosedPublic

Authored by kib on Tue, Mar 30, 3:59 PM.

Details

Summary

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

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib requested review of this revision.Tue, Mar 30, 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.Tue, Mar 30, 10:58 PM
This revision was automatically updated to reflect the committed changes.