This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Print errno for report file open failure
ClosedPublic

Authored by tejohnson on Oct 25 2020, 8:33 AM.

Details

Summary

To help debug failures, specifically the llvm-avr-linux bot failure from
5c20d7db9f2791367b9311130eb44afecb16829c:

http://lab.llvm.org:8011/#/builders/112/builds/407/steps/5/logs/FAIL__MemProfiler-x86_64-linux-dynamic__log_path_t

Also re-enable the failing test which I temporarily disabled, to
see if this change will help identify why that particular log file can't
be opened for write on that bot (when another log file in the same
directory could earlier in the test).

Diff Detail

Event Timeline

tejohnson created this revision.Oct 25 2020, 8:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 25 2020, 8:33 AM
Herald added subscribers: Restricted Project, pengfei, dylanmckay. · View Herald Transcript
tejohnson requested review of this revision.Oct 25 2020, 8:33 AM
vitalybuka accepted this revision.Oct 28 2020, 2:30 AM
vitalybuka added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_file.cpp
68
This revision is now accepted and ready to land.Oct 28 2020, 2:30 AM
This revision was automatically updated to reflect the committed changes.

Yep, saw that one fail too. And finally figured out the issue after staring at the paths again. Its due to macro expansion of the "linux" in the path name with "1" in the path specified to PROFILE_VAR_NAME, since the bot has "-linux" in its name and therefore the path. I've disabled the test again in rGd124ac0c223a, with an explanation of what is going on. I can reproduce it locally on my linux box when I manually compile the test with -DPROFILE_VAR_NAME set to a path with "-linux" in it. I'm not sure how to prevent multiple levels of macros from being expanded in the stringizing sequence. I might just have it pass a hardcoded bad path and test that it gets passed through (via one of the errors like I am checking with CHECK-INVALID).