Open marktsuchida opened 6 months ago
Deep in Clang, that's wild. :/
Yes, I can reproduce it. The crash is in Cling calculating the offset of v
into the struct S
(it's 0
here). Such offsets are needed to address the data member for access.
Yeah, I expected this to be an upstream issue, but wasn't sure where/how best to report it other than here (or how to test whether it is still broken in upstream). Thanks for looking at it.
In DeclCollector::HandleInterestingDecl(DeclGroupRef DGR)
, the current transaction (m_CurTransaction
) is nullptr.
@vgvassilev: any idea how this could happen?
tclingdatamemberinfo::Offset needs PushTrabsactionRAII
Ah, quite. I checked upstream and it had grown one already. Yes, I confirm that that fixes it!
Fix and test are in repo. Thanks all!
I'm getting a crash when trying to access a type defined as
struct S { std::vector<unsigned> v; };
:macOS arm64, cppyy 3.1.2, Python 3.12.
On macOS arm64, it crashed when the
vector
element type was one ofchar
,int
,unsigned
(shown above), ordouble
, but not with[un]signed char
,[unsigned] short
,[unsigned] long
,[unsigned] long long
,float
, orbool
.On macOS x86-64 (Rosetta 2), the crash occurred with element types
char
orunsigned
only (among the same set of types tested).On Linux and Windows I was unable to reproduce the crash.
If I defined instead
template <typename T> struct S { std::vector<T> v; };
, then I got a crash fromcppyy.gbl.S["unsigned"]
. Interestingly, the set of types that caused the crash for the template matched the set of types that caused the non-template version to crash, for each of arm64 and x86-64.Just accessing
std::vector
(as incppyy.gbl.std.vector["unsigned"]
) did not crash. Furthermore, doing so before running the crashing case prevented the crash: the following does not crash:Here is a stack trace on macOS arm64 for the first example above: