This is an archive of the discontinued LLVM Phabricator instance.

Revert "[lldb] Disable minimal import mode for RecordDecls that back FieldDecls"
ClosedPublic

Authored by rupprecht on Nov 8 2021, 6:28 PM.

Details

Summary

This reverts commit 3bf96b0329be554c67282b0d7d8da6a864b9e38f. It causes crashes as reported in PR52257 and a few other places. A reproducer is bundled with this commit to verify any fix forward.

Diff Detail

Event Timeline

rupprecht created this revision.Nov 8 2021, 6:28 PM
rupprecht requested review of this revision.Nov 8 2021, 6:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2021, 6:28 PM

Given that this patch has been in tree for half a year, it'd be good to get confirmation here this can be reverted given there is now a test case for causing a crash. I got an offline comment that this is OK to revert, so if nobody has objections, I'll land sometime tomorrow.

teemperor accepted this revision.Nov 9 2021, 2:30 PM

LGTM, thanks for this!

This revision is now accepted and ready to land.Nov 9 2021, 2:30 PM
teemperor added inline comments.Nov 9 2021, 2:32 PM
lldb/test/Shell/SymbolFile/DWARF/PR52257.cpp
21 ↗(On Diff #385670)

FWIW, I think probably should be an API test (for a bunch of reasons from not relying on formatting output to remote device testing), but given this is just a revert I won't insist on that. Thanks again!

rupprecht added inline comments.Nov 9 2021, 4:56 PM
lldb/test/Shell/SymbolFile/DWARF/PR52257.cpp
21 ↗(On Diff #385670)

Makes sense -- this was just the easiest way to copy/paste the repro from the bug. I'll convert it to an API test when landing.

rupprecht updated this revision to Diff 386114.Nov 10 2021, 3:45 AM
  • Switch crash repro from shell -> api test

I actually didn't see that the patch deleted the TestCppReferenceToOuterClass test. Could you just add a @skipIf # Crashes or so above its def test... method? The test itself is still valid user code that we shouldn't crash on.

I left some nits and the test source probably needs to be made a bit more expressive in terms of what's its trying to test, but this can all be done later. Let's just land this to get the regression fixed.

lldb/test/API/commands/expression/pr52257/TestExprCrash.py
18

nit: self.createTestTarget() (which generates useful error messages on failure)

19

nit: self.expect_expr("b", result_type="B", result_children=[ValueCheck(name="tag_set_")])

  • Use better test APIs, add test back w/ a @expectedFailure

I actually didn't see that the patch deleted the TestCppReferenceToOuterClass test. Could you just add a @skipIf # Crashes or so above its def test... method? The test itself is still valid user code that we shouldn't crash on.

I assume you mean something like expectedFailure, as this should unconditionally fail.

I left some nits and the test source probably needs to be made a bit more expressive in terms of what's its trying to test, but this can all be done later. Let's just land this to get the regression fixed.

OK, retesting real quick against trunk and submitting now. Thanks!