This is an archive of the discontinued LLVM Phabricator instance.

[lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementation
ClosedPublic

Authored by mib on Mar 3 2023, 11:57 AM.

Details

Summary

When using SBProcess::GetScriptedImplementation in python, if the
process has a valid implementation, we returned a reference of the
object without incrementing the reference counting. That causes the
interpreter to crash after accessing the reference several times.

This patch address this by incrementing the reference count when passing
the valid object reference.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Diff Detail

Event Timeline

mib created this revision.Mar 3 2023, 11:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 11:57 AM
mib requested review of this revision.Mar 3 2023, 11:57 AM
JDevlieghere accepted this revision.Mar 3 2023, 12:00 PM

LGTM. Can we turn that crash into a small test case?

This revision is now accepted and ready to land.Mar 3 2023, 12:00 PM
mib updated this revision to Diff 502222.Mar 3 2023, 12:36 PM

Add test

bulbazord accepted this revision.Mar 3 2023, 1:00 PM