This is an archive of the discontinued LLVM Phabricator instance.

Editline: Fix an msan error
ClosedPublic

Authored by labath on Apr 26 2019, 8:10 AM.

Details

Summary

Despite the documentation for the el_get(EL_GETTC) function claiming the
vararg part is (const char *name, void *value), in reality the function
expects the vararg list to be terminated by a null pointer, which can be
clearly seen by examining the source code. Although this is mostly
bening because the extra values are not used it any way, it still lights
up as an error when running the tests under msan.

Work around this quirk by adding an explicit nullptr to the end of the
argument list.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

labath created this revision.Apr 26 2019, 8:10 AM

You can see the relevant part of the source code here https://github.com/cdesjardins/libedit/blob/master/src/eln.c#L310 (not the canonical source, but at least it's easy to link to).

@christos, any chance of getting this fixed (either the docs, or the source code)?

davide accepted this revision.Apr 26 2019, 8:15 AM

LGTM but this should really be fixed upstream (in libedit)

This revision is now accepted and ready to land.Apr 26 2019, 8:15 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 29 2019, 6:52 AM
Herald added a subscriber: abidh. · View Herald Transcript