Home » Community » U++ community news and announcements » Win32 nightly builds now using mingw
|
|
Re: Win32 nightly builds now using mingw [message #46278 is a reply to message #46277] |
Thu, 07 April 2016 10:25   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
Nice!
I've been trying to integrate more and more GCC in my stuff, but it is not that easy.
This is not related to U++, but me doing funky stuff on program terminate, but often with GCC I have a weird problem: the program crashes on the atexit stage, where I do a pre-global destructor cleanup. And the weird part is that this only happens on a fresh compile after a clean. I compile in optimized mode, crashes. Recompile without optimal mode, no crash. After this, no mater how many times I compile in optimized mode, no more crash and the problem goes away for hours or until I shut down everything and clean the build folder.
This happens on Windows only, and anyway I can't Valgrind, since it is in optimized mode.
But without the cleanup, GCC looks like it works well and I try to compile once a week.
|
|
|
|
|
|
|
|
Re: Win32 nightly builds now using mingw [message #46302 is a reply to message #46301] |
Mon, 11 April 2016 16:34   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
mirek wrote on Mon, 11 April 2016 15:01That sounds BLITZ related. Sometimes, BLITZ can hide error.
As I said, very random. But I think I'm finally detecting the pattern: external build method modifies source file time, but content is unchanged, I load up TheIDE, build mode is MSC (not sure if build is needed or not), I switch to GCC and it crashes. I think it doesn't rebuild something. I need a bit of more testing, but I think this pattern is 100% reproducible. Apparently, the atexit code is not the source of the trouble, but I still feel like your solution is better than my hack. Neither is -03 the problem since I checked and TheIDE pushes for -O2.
|
|
|
Re: Win32 nightly builds now using mingw [message #46497 is a reply to message #46278] |
Mon, 16 May 2016 13:27  |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
cbpporter wrote on Thu, 07 April 2016 11:25Nice!
I've been trying to integrate more and more GCC in my stuff, but it is not that easy.
This is not related to U++, but me doing funky stuff on program terminate, but often with GCC I have a weird problem: the program crashes on the atexit stage, where I do a pre-global destructor cleanup. And the weird part is that this only happens on a fresh compile after a clean. I compile in optimized mode, crashes. Recompile without optimal mode, no crash. After this, no mater how many times I compile in optimized mode, no more crash and the problem goes away for hours or until I shut down everything and clean the build folder.
This happens on Windows only, and anyway I can't Valgrind, since it is in optimized mode.
But without the cleanup, GCC looks like it works well and I try to compile once a week.
There are two problems here.
First, a TheIDE related linking error. If you change the build method from MSC it can happen.
But sometimes it persisted no matter what.
But I finally found something: removing a single inline from a function fixed this. It appears that maybe TDM has some problems with too aggressive inline-ing. The following code crashes:
inline void _free(void** p) {
if (*p) {
STDLIB_GC--;
free(*p);
}
*p = 0;
}
Do you guys see anything wrong with this code? It crashes when freeing some members from global variables.
|
|
|
Goto Forum:
Current Time: Mon May 12 06:10:30 CEST 2025
Total time taken to generate the page: 0.03457 seconds
|