This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix that SIGWINCH crashes IOHandlerEditline when we are not using the editline backend
ClosedPublic

Authored by teemperor on Jun 12 2020, 4:41 AM.

Details

Summary

TerminalSizeChanged is called from our SIGWINCH signal handler but the
IOHandlerEditline currently doesn't check if we are actually using the real
editline backend. If we're not using the real editline backend, m_editline_up
won't be set and IOHandlerEditline::TerminalSizeChanged will access
the empty unique_ptr. In a real use case we don't use the editline backend
when we for example read input from a file. We also create some temporary
IOHandlerEditline's during LLDB startup it seems that are also treated
as non-interactive (apparently to read startup commands).

This patch just adds a nullptr check for`m_editline_up` as we do in the rest of
IOHandlerEditline.

Fixes rdar://problem/63921950

Diff Detail

Event Timeline

teemperor created this revision.Jun 12 2020, 4:41 AM
teemperor updated this revision to Diff 270379.Jun 12 2020, 6:53 AM
teemperor edited the summary of this revision. (Show Details)
  • Reworked test and reverted "dumb term" change (thanks Pavel!)
teemperor edited the summary of this revision. (Show Details)Jun 12 2020, 7:26 AM
teemperor set the repository for this revision to rLLDB LLDB.
friss accepted this revision.Jun 12 2020, 7:50 AM

LGTM, thanks!

This revision is now accepted and ready to land.Jun 12 2020, 7:50 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2020, 10:19 AM