mirror of
https://github.com/bitwiseworks/gcc-os2.git
synced 2026-04-24 23:10:00 +00:00
Cmake crash #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dmik on GitHub (Jan 16, 2020).
All 9.2.0 builds of STDCPP6.DLL cause
cmake --versionto crash like this:Doing
set LIBC_BREAKPOINT_ABORT=1to cause LIBC generate a full .TRP instead of issuing a meaningless message results into the following report (thanks Elbert): https://pastebin.com/h1GqQ649@dmik commented on GitHub (Jan 16, 2020):
I did some checks. First, some symbols in the above TRP are wrong (perhaps because of the wrong versions of -debuginfo packages installed). Installing correct packages gives this: 4ED9_01.TRP.txt.
This is the essential part:
What I see there is that CMAKE does some C++ which eventually calls
operator newwhich in turn callsmallocwhich in turn attempts to use the default (high-mem) heap, finds out that this heap's header is corrupt and then bails out.Given that many other C++ apps work with this new STDCPP6.DLL like a charm (including heavy Qt 4 apps such as Qt Creator), I more tend to think that there is some problem in cmake. It is necessary to debug cmake code to understand what it is trying to do there, exactly. A typical reason for heap corruption is writing beyond the bounds of allocated objects.
@dmik commented on GitHub (Jan 17, 2020):
Just rebuilding cmake with GCC 9.2.0 makes the issue go away. This makes things much harder to debug as source level debugging is not an option here. It's definitely some ABI break between the old and the new C++ DLL, but it must be something not documented. May be a bug of some sort (may be, OS/2 specific, may be not). I.e. the bug is present in GCC4 and it doesn't cause any problems when the code using its C++ DLL is also built with GCC4. Then it was fixed in GCC9 but since cmake still uses GCC4 stuffs, it blows now. Or it may be the other way around. It's just a wild guess.
But as I said, debugging such a problem is hard (it's deep in some C++ container code) and given that cmake is the only failing case so far (and it gets fixed by a rebuild), we will not invest time in it right now. If we face it again, we will deal with it.
By "the only failing case" I mean that I tested a lot of other apps built with the old GCC4 (and even with GCC3) running across the new C++ DLL from GCC9, including such monsters as Qt Creator (from Qt4) and Firefox 45.9, both of which heavily use a lot of C++. Both projects work smoothly so far.