This is an archive of the discontinued LLVM Phabricator instance.

Shorten sanitizer plugin names
ClosedPublic

Authored by labath on Jun 23 2017, 5:48 AM.

Details

Summary

The new UndefinedBehaviorSanitizer plugin was breaking file path length
limits, because it's (fairly long name) appears multiple times in the
path. Cmake ends up putting the object file at path
tools/lldb/source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/CMakeFiles/lldbPluginInstrumentationRuntimeUndefinedBehaviorSanitizer.dir/UndefinedBehaviorSanitizerRuntime.cpp.obj
which is 191 characters long and very dangerously close to the 260
character path limit on windows systems (also, just the include line for
that file was breaking the 80 character line limit).

This renames the sanitizer plugins to use shorter names (asan, ubsan,
tsan). I think this will still be quite understandable to everyone as
those are the names everyone uses to refer to them anyway.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Jun 23 2017, 5:48 AM
kubamracek edited edge metadata.Jun 23 2017, 8:02 AM

Oh wow, we really need to limit path lengths? What about files like ./packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py?

Oh wow, we really need to limit path lengths?

It's a bit annoying, but windows has issues with paths like that. It's actually possible to avoid it nowadays, if you use the right APIs, but not all programs have been updated to do that. Ironically enough, the error here comes from the MSVC linker, which means clang either succeeded in creating the object file, or failed silently doing that (I can't say which one as this was happening on the buildbot).

What about files like ./packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py?

That's another fine example of an incredibly long path, and it was causing some problems already (it broke dotest log file name length), but I've managed to work around those.

However, even without these limits, I feel that our file names/paths tend to be unnecessarily long.

Thanks for doing this. This seems a reasonable alternative to fixing all the build tools upstream. And overly long paths are difficult to read.

vsk added a comment.Jun 23 2017, 11:15 AM

Thanks, this lgtm. Our tools don't depend on these plugins having a particular file name.

jingham accepted this revision.Jun 23 2017, 11:22 AM

I try to avoid making cryptic file names just to get them under some character count, since that also makes code hard to comprehend particularly for new users. But in this case everybody calls these features ASAN, UBSAN, etc. So this change shouldn't cause any confusion.

This revision is now accepted and ready to land.Jun 23 2017, 11:22 AM

Looks good. It's easier to parse [at least for my eyes]: ubsan, asan, tsan etc than full-names.

This revision was automatically updated to reflect the committed changes.
lldb/trunk/source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/UndefinedBehaviorSanitizerRuntime.h