This is an archive of the discontinued LLVM Phabricator instance.

[scan-build-py] intercepted executions persisted in JSON files
AbandonedPublic

Authored by rizsotto.mailinglist on Apr 8 2017, 3:54 AM.

Details

Summary

It's a chunk from D26390

Executions are intercepted by compiler wrapper or interception library. The intercepted executions are persisted in files. This file format previously was a kind of binary file.

This change:

  • introduce JSON as file format,
  • reduce the content of these files (don't record function name and parent PID),
  • single file contains a single execution report,
  • file names does not try to be ordered (using mkstemp).

Diff Detail

Event Timeline

Realized that these changes are related to environment access simplification. I hope it can be merged together.

The problem with environment access appears on OSX pre-loaded libraries. We can't access the environ variable in the pre-load phase. (Later when main is started it's not an issue anymore.) Before it was an accessor function which was called the "safe" _NSGetEnviron method or return environ on other platforms... Since exec functions are called after main started, it's safe to access the environ variable directly on OSX too.

tools/scan-build-py/libear/ear.c
42

This change is unrelated, but drifted in.

68

This change is unrelated, but drifted in.

148

This change is unrelated, but drifted in.

465

This change is unrelated, but drifted in.

521

This change is unrelated, but drifted in.