This is an archive of the discontinued LLVM Phabricator instance.

[DFSan] Add flag to insert event callbacks.
ClosedPublic

Authored by morehouse on Feb 27 2020, 4:17 PM.

Details

Summary

For now just insert the callback for stores, similar to how MSan tracks
origins. In the future we may want to add callbacks for loads, memcpy,
function calls, CMPs, etc.

Diff Detail

Event Timeline

morehouse created this revision.Feb 27 2020, 4:17 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 27 2020, 4:17 PM
Herald added subscribers: Restricted Project, hiraditya. · View Herald Transcript
vitalybuka accepted this revision.Feb 27 2020, 4:24 PM
This revision is now accepted and ready to land.Feb 27 2020, 4:24 PM
kcc accepted this revision.Feb 27 2020, 4:38 PM

Code LGTM, but please add some comments near the flag definition.

Do you want to also pass the store address to the callback?

Do you want to also pass the store address to the callback?

Maybe? For the immediate use case (i.e. getting a stack trace) it's probably not needed, but maybe the address would be useful for something else?

I noticed MSan origins reports don't give the store address, so I figured it wasn't too important.

morehouse updated this revision to Diff 247140.Feb 27 2020, 5:08 PM
  • Add comment explaining the new flag.
eugenis accepted this revision.Feb 27 2020, 5:09 PM

If MSan remembered store addresses, it would very fast run out of origin ids.

Since this is an experimental API without a frontend flag, I'd say do what is useful right now, and add more info later if it becomes necessary.

LGTM

morehouse updated this revision to Diff 247141.Feb 27 2020, 5:10 PM
  • Fix diffbase.
This revision was automatically updated to reflect the committed changes.