SClang: PyrGC calls own methods in its constructor before fully initialised. #6268
Labels
bug
Issues that relate to unexpected/unwanted behavior. Don't use for PRs.
comp: sclang
sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"
Environment
Steps to reproduce
This isn't a problem in current use. However, #6261 introduces a limit on the number of objects to be scanned, which when set absurdly low (<1000) triggers the constructor of PyrGC to call its own member functions in the constructor before it is fully initialised, leading to a segfault. This is during the initialisation of the
mProcess
member (a PyrProcess).Specifically:
The circular call into itself starts on this line,
supercollider/lang/LangSource/GC.cpp
Line 281 in 28a0b12
requiring
mStack
andg-> sp
to be set, which don't happen until the next line or so.This is less of a bug, because the behaviour will never be triggered, and more a case of incorrect design, albeit, quite a nuanced issue as dealing with an allocator that needs to call itself to allocate its component parts is circular.
As an improvement I suggest, either:
Alternatively, this could just be ignored, but if the 'magic' number of the GC change, this issue might be triggered.
The text was updated successfully, but these errors were encountered: