U++ Forum - RDF feed
type: channel
description: Main place for discussions about U++ cross platform development framework.
items: Compilation warnings and random crashes
items: Re: Compilation warnings and random crashes

Compilation warnings and random crashes
type: item
description: I get a bunch of warnings like below when compiling on MacOS 10.15: /Users/XXX/dvlp/cpp/code/upp/git/uppsrc/ide/RepoSync.cpp:283:6: note: use non-reference type 'Upp::KeyValueRef<Upp::String, int>' for(const auto& w : ~work) { ^~~~~~~~~~~~~~~ Basically, a reference is pointing to a temporary object. And I'm getting random crashes with TheIDE when launching it on Linux (I'm not using a binary compiled on MacOS ) I guess, these crashes and references to temporary objects are related. TIA
creator: Novo
date: 2024-05-21T22:10:42-00:00

Re: Compilation warnings and random crashes
type: item
description: VectorMap<String, int> work; work is VectorMap ... MapKVRange<AMap, K, T> operator~() { return MapKVRange<AMap, K, T>(*this); } operator~() returns a newly created object. So, compiler is right: you are referencing temporary objects ...
creator: Novo
date: 2024-05-26T04:54:06-00:00

Re: Compilation warnings and random crashes
type: item
description: It is allowed. Range in for loop can be temporary. Here is the disscussion (note that it discusses UB case, but U++ use is the first legal one): https://www.sandordargo.com/blog/2022/04/20/range-base-p2012 I am currently testing with MacOS 14.5 and getting no such warning. Crashes in Linux are probably caused by something else. Mirek
creator: mirek
date: 2024-06-26T12:44:40-00:00

Re: Compilation warnings and random crashes
type: item
description: Hi, I think I can confirm Novo here. TheIDE crashes frequently on linux (gtk), on the main package selection screen if I close a project and try to open a new one. It appears to happen while TheIDE is trying to load the packages list. I am using the nightly builds. P.s.: One other point is, I don't get any crashes or warnings on debug builds. No matter how I tried, it just did not crash. (in release builds I get the invalid memory access error a lot.) Best regards, Oblivion
creator: Oblivion
date: 2024-10-13T10:50:49-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Sun, 13 October 2024 12:50 Hi, I think I can confirm Novo here. TheIDE crashes frequently on linux (gtk), on the main package selection screen if I close a project and try to open a new one. You mean completely close theide, then start it again? Or choose File / Open main package? If the first one, does it depend on the interval between closing and starting again? In both cases, does it crash without user inputs or do you do something?
creator: mirek
date: 2024-10-17T09:34:44-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Sun, 13 October 2024 12:50 P.s.: One other point is, I don't get any crashes or warnings on debug builds. No matter how I tried, it just did not crash. (in release builds I get the invalid memory access error a lot.) What about release build with full debug info, started from gdb?
creator: mirek
date: 2024-10-17T09:36:14-00:00

Re: Compilation warnings and random crashes
type: item
description: Hello Mirek, It does not happen when I completely exit TheIdE. It only happens when I try to open another project. The package selection screen comes up and the app crashes (not always, but most of the time). TheIDE on release mode (FULL_DEBUG flag) points to below line: Thread 1 "theide" received signal SIGSEGV, Segmentation fault. Upp::Image::Image (this=0x7ffffffe71e0, img=...) at /home/user/upp/devel/uppsrc/Draw/Image.cpp:295 295 data->Retain(); I hope this helps. Best regards, Oblivion
creator: Oblivion
date: 2024-10-17T09:47:20-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Thu, 17 October 2024 11:47 Hello Mirek, It does not happen when I completely exit TheIdE. It only happens when I try to open another project. The package selection screen comes up and the app crashes (not always, but most of the time). TheIDE on release mode (FULL_DEBUG flag) points to below line: Thread 1 "theide" received signal SIGSEGV, Segmentation fault. Upp::Image::Image (this=0x7ffffffe71e0, img=...) at /home/user/upp/devel/uppsrc/Draw/Image.cpp:295 295 data->Retain(); Excellent, that narrows it down probably to loading icons, but I bet there is a backtrace ("bt") ? Mirek
creator: mirek
date: 2024-10-17T10:03:05-00:00

Re: Compilation warnings and random crashes
type: item
description: Oops, I forgot to attach that. #0 Upp::Image::Image (this=0x7ffffffe71e0, img=...) at /home/user/upp/devel/uppsrc/Draw/Image.cpp:295 #1 Upp::Iml::Get (this=<optimized out>, i=<optimized out>) at /home/user/upp/devel/uppsrc/Draw/Iml.cpp:154 #2 0x00005555556e76e9 in SelectPackageDlg::SyncList (this=this@entry=0x7ffffffe7750, find=...) at /home/user/upp/devel/uppsrc/ide/SelectPkg.cpp:677 #3 0x00005555556deead in SelectPackageDlg::Load (this=this@entry=0x7ffffffe7750, find=...) at /home/user/upp/devel/uppsrc/ide/SelectPkg.cpp:761 #4 0x00005555556e3ac4 in SelectPackageDlg::OnBase (this=0x7ffffffe7750) at /home/user/upp/devel/uppsrc/ide/SelectPkg.cpp:420 #5 0x0000555555996e1f in Upp::Function<void()>::operator() (this=0x7ffffffe8800) at /home/user/upp/devel/uppsrc/Core/Function.h:76 #6 Upp::ArrayCtrl::SetCursor0 (this=0x7ffffffe8290, i=8, dosel=<optimized out>) at /home/user/upp/devel/uppsrc/CtrlLib/ArrayCtrl.cpp:1487 #7 0x00005555556e6a76 in SelectPackageDlg::SyncBase (this=this@entry=0x7ffffffe7750, initvars=...) at /home/user/upp/devel/uppsrc/ide/SelectPkg.cpp:837 #8 0x00005555556e630d in SelectPackageDlg::Run (this=this@entry=0x7ffffffe7750, nest=..., startwith=...) at /home/user/upp/devel/uppsrc/ide/SelectPkg.cpp:362 #9 0x00005555556ecd3b in SelectPackage (nest=..., title=title@entry=0x7ffff25d4bc8 "Select main package (TheIDE 17514)", startwith=0x7ffff273f748 "examples/SshTerminalSplitterExample", selectvars=<optimized out>, main=<optimized out>) at /home/user/upp/devel/uppsrc/ide/SelectPkg.cpp:864 #10 0x000055555572ae45 in Ide::OpenMainPackage (this=0x7ffffffe9e10) at /home/user/upp/devel/uppsrc/ide/ide.cpp:215 #11 0x000055555572b0a2 in Ide::NewMainPackage (this=0x7ffffffe71e0) at /home/user/upp/devel/uppsrc/ide/ide.cpp:234 #12 0x0000555555cd932e in Upp::Function<void()>::operator() (this=<optimized out>) at /home/user/upp/devel/uppsrc/Core/Function.h:76 #13 Upp::Ctrl::Action (this=<optimized out>) at /home/user/upp/devel/uppsrc/CtrlCore/Ctrl.cpp:414 #14 0x00005555…
creator: Oblivion
date: 2024-10-17T10:11:20-00:00

Re: Compilation warnings and random crashes
type: item
description: Can I ask for a little experiment: ide/SelectPkg.cpp:671 for(int i = 0; i < packages.GetCount(); i++) { const PkInfo& pkg = packages[i]; Image icon = IdeImg::Package(); /* Image icon = pkg.icon; if(IsNull(icon)) { if(pkg.main) icon = pkg.upphub ? IdeImg::HubMainPackage() : IdeImg::MainPackage(); else icon = pkg.upphub ? IdeImg::HubPackage() : IdeImg::Package(); } */ nest_list.Add(pkg.nest); clist.Add(pkg.package, DPI(icon, 16)); alist.Add(pkg.package, GetFileName(pkg.nest), pkg.description, icon); alist.SetDisplay(alist.GetCount() - 1, 0, pkg.main ? bpd : pd); } ide/SelectPkg.cpp:790 if(d.ispackage && 0) { String icon_path; if(IsUHDMode()) Does it crash with these? Mirek
creator: mirek
date: 2024-10-17T11:01:41-00:00

Re: Compilation warnings and random crashes
type: item
description: Done. No crashes.Tried it ovew 30 times. Usually it should have crashed at my every 2nd or 3rd attempt. If you need any more test, let me know. Best regards, Oblivion
creator: Oblivion
date: 2024-10-17T11:10:24-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Thu, 17 October 2024 13:10 Done. No crashes.Tried it ovew 30 times. Usually it should have crashed at my every 2nd or 3rd attempt. If you need any more test, let me know. Best regards, Oblivion Well, try to reactivate the first oneand leave the second one (... && 0) And then maybe reversed
creator: mirek
date: 2024-10-17T11:18:08-00:00

Re: Compilation warnings and random crashes
type: item
description: The first one crashes. The second one doesn't. Best regards, Oblivion
creator: Oblivion
date: 2024-10-17T11:22:55-00:00

Re: Compilation warnings and random crashes
type: item
description: What about (after reverting to master to remove both changes): ide/SelectPkg.cpp:787 if(d.ispackage) { String icon_path; if(IsUHDMode()) icon_path = AppendFileName(path, "icon32x32.png"); if(IsNull(icon_path) || !FileExists(icon_path)) icon_path = AppendFileName(path, "icon16x16.png"); tm = FileGetTime(icon_path); if(IsNull(tm)) // package icon does not exist d.icon = Null; else if(tm != d.itm || d.icon.GetSize().cx != DPI(16)) { // chached package icon outdated d.icon = StreamRaster::LoadFileAny(icon_path); d.itm = tm; } d.icon.Clear(); } (added d.icon.Clear to make it Null)
creator: mirek
date: 2024-10-17T11:30:51-00:00

Re: Compilation warnings and random crashes
type: item
description: No, reverting to master and clearing the icon didn't help. Crashes returned. Best regards, Oblivion
creator: Oblivion
date: 2024-10-17T11:53:46-00:00

Re: Compilation warnings and random crashes
type: item
description: What about this: DLOG("=================="); for(int i = 0; i < packages.GetCount(); i++) { const PkInfo& pkg = packages[i]; Image icon = pkg.icon; RDUMP(IdeImg::HubMainPackage().GetSize()); RDUMP(IdeImg::MainPackage().GetSize()); RDUMP(IdeImg::HubPackage().GetSize()); RDUMP(IdeImg::Package().GetSize()); RDUMP(~IdeImg::HubMainPackage()); RDUMP(~IdeImg::MainPackage()); RDUMP(~IdeImg::HubPackage()); RDUMP(~IdeImg::Package()); if(IsNull(icon)) { if(pkg.main) icon = pkg.upphub ? IdeImg::HubMainPackage() : IdeImg::MainPackage(); else icon = pkg.upphub ? IdeImg::HubPackage() : IdeImg::Package(); } nest_list.Add(pkg.nest); clist.Add(pkg.package, DPI(icon, 16)); alist.Add(pkg.package, GetFileName(pkg.nest), pkg.description, icon); alist.SetDisplay(alist.GetCount() - 1, 0, pkg.main ? bpd : pd); } (log after crash...) Mirek
creator: mirek
date: 2024-10-17T12:00:52-00:00

Re: Compilation warnings and random crashes
type: item
description: ================== IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 ****************** PANIC: Invalid memory access!
creator: Oblivion
date: 2024-10-17T12:40:37-00:00

Re: Compilation warnings and random crashes
type: item
description: This time I get another error LOG ================== IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7ffff25a8850 ~IdeImg::MainPackage() = 0x7ffff24edb50 ~IdeImg::HubPackage() = 0x7ffff2731750 ~IdeImg::Package() = 0x7ffff2579a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7ffff25a8850 ~IdeImg::MainPackage() = 0x7ffff24edb50 ~IdeImg::HubPackage() = 0x7ffff2731750 ~IdeImg::Package() = 0x7ffff2579a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7ffff25a8850 ~IdeImg::MainPackage() = 0x7ffff24edb50 ~IdeImg::HubPackage() = 0x7ffff2731750 ~IdeImg::Package() = 0x7ffff2579a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7ffff25a8850 ~IdeImg::MainPackage() = 0x7ffff24edb50 ~IdeImg::HubPackage() = 0x7ffff2731750 ~IdeImg::Package() = 0x7ffff2579a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7ffff25a8850 ~IdeImg::MainPackage() = 0x7ffff24edb50 ~IdeImg::HubPackage() = 0x7ffff2731750 ~IdeImg::Package() = 0x7ffff2579a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7ffff25a8850 ~IdeImg::MainPackage() = 0x7ffff24edb50 ~IdeImg::HubPackage() = 0x7ffff2731750 ~IdeImg::Packag…
creator: Oblivion
date: 2024-10-17T12:48:19-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Thu, 17 October 2024 14:40 ================== IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 IdeImg::HubMainPackage().GetSize() = (16, 16) IdeImg::MainPackage().GetSize() = (16, 16) IdeImg::HubPackage().GetSize() = (16, 16) IdeImg::Package().GetSize() = (16, 16) ~IdeImg::HubMainPackage() = 0x7e845c9a8850 ~IdeImg::MainPackage() = 0x7e845c8edb50 ~IdeImg::HubPackage() = 0x7e845cb31750 ~IdeImg::Package() = 0x7e845c979a50 ****************** PANIC: Invalid memory access! Weird... What about for(int i = 0; i < packages.GetCount(); i++) { const PkInfo& pkg = packages[i]; Image icon = pkg.icon; #define DD(x) RDUMP(x.GetSize()); RLOGHEXDUMP(~x, min(32, int(x.GetLength() * sizeof(RGBA)))); DD(IdeImg::HubMainPackage());…
creator: mirek
date: 2024-10-17T13:08:02-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Thu, 17 October 2024 14:48 This time I get another error After a lot of thinking I believe that the only plausible explanation is that another thread calls Iml::Reset somehow. Can you crash it and then send backtrace of ALL threads?
creator: mirek
date: 2024-10-18T07:29:17-00:00

Re: Compilation warnings and random crashes
type: item
description: Quote: After a lot of thinking I believe that the only plausible explanation is that another thread calls Iml::Reset somehow. Can you crash it and then send backtrace of ALL threads? Thank you for your efforts. Will do, but this weekend. I am away from my computer today. Best regards, Oblivion
creator: Oblivion
date: 2024-10-18T07:42:04-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Fri, 18 October 2024 09:42 Quote: After a lot of thinking I believe that the only plausible explanation is that another thread calls Iml::Reset somehow. Can you crash it and then send backtrace of ALL threads? Thank you for your efforts. Will do, but this weekend. I am away from my computer today. Best regards, Oblivion Also, can you try with this attempt at fix (but it would explain it just partly, still would like to have bt of all threads after the crash without the fix): void Iml::Reset() { for(IImage& m : map) m.loaded = false; }
creator: mirek
date: 2024-10-19T07:54:32-00:00

Re: Compilation warnings and random crashes
type: item
description: I have attached TheIDe's log and full backtrace. Quote: Also, can you try with this attempt at fix (but it would explain it just partly, still would like to have bt of all threads after the crash without the fix): void Iml::Reset() { for(IImage& m : map) m.loaded = false; } Tried but didn't fix it. One interesting thing I've noticed is that the crash seems to be triggered in certain assemblies. But to be sure, it needs more test... Best regards, Oblivion
creator: Oblivion
date: 2024-10-19T08:20:54-00:00

Re: Compilation warnings and random crashes
type: item
description: (maybe those specific assemblies have custom icons to display in package list?) Anyway, from backtraces it looks like indexer/libclang is running full steam. Can you try with assist++ off? Also, can you please update logging to: https://www.ultimatepp.org/forums/index.php?t=msg&th=122 73&goto=61004&#msg_61004 and perhaps separately try setting Image icon = Null;
creator: mirek
date: 2024-10-19T09:01:51-00:00

Re: Compilation warnings and random crashes
type: item
description: Quote: (maybe those specific assemblies have custom icons to display in package list?) No. Quote: Anyway, from backtraces it looks like indexer/libclang is running full steam. Can you try with assist++ off? I have attached the logs. However, I noticed that it crashes less frequently when the indexer/assist++ is off. Quote: and perhaps separately try setting Image icon = Null; Will try. Best regards, Oblivion
creator: Oblivion
date: 2024-10-19T11:24:52-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Sat, 19 October 2024 13:24 Quote: (maybe those specific assemblies have custom icons to display in package list?) No. Quote: Anyway, from backtraces it looks like indexer/libclang is running full steam. Can you try with assist++ off? I have attached the logs. However, I noticed that it crashes less frequently when the indexer/assist++ is off. Quote: and perhaps separately try setting Image icon = Null; Will try. Best regards, Oblivion And the last obligatory question: It really is crashing only on opening new main package, right? And BTW, when you test, do you test like for(;;) { Ctrl+M, Esc } or like for(;;) { Ctrl+M, select package, Enter } ?
creator: mirek
date: 2024-10-19T14:26:35-00:00

Re: Compilation warnings and random crashes
type: item
description: Quote: And the last obligatory question: It really is crashing only on opening new main package, right? Yes, while TheIDE is loading the main packages list. Quote: And BTW, when you test, do you test like for(;;) { Ctrl+M, Esc } or like for(;;) { Ctrl+M, select package, Enter } ? Doesn't make any difference, TheIDE crashes after it switches to the package selection dialog. However, I'm suspecting this is a compiler error now. (maybe O3 optimization level related?). I'll try other options (O2 and GCC), report back asap. Best regards, Oblivion
creator: Oblivion
date: 2024-10-19T15:09:02-00:00

Re: Compilation warnings and random crashes
type: item
description: [quote title=Oblivion wrote on Sat, 19 October 2024 17:09]Quote: And the last obligatory question: It really is crashing only on opening new main package, right? However, I'm suspecting this is a compiler error now. (maybe O3 optimization level related?). I'll try other options (O2 and GCC), report back asap. Well, clang got picky over unaligned access undefined behaviour, simply ignoring code like dword x[2]; dword y = *(dword )((const char *)x + 1); which caused some problems, but I think compiler error there would appear with some regularity. Irregular pattern like this is usually a race condition or uninitialised data... Anyway, other things to try for(int i = 0; i < packages.GetCount(); i++) { const PkInfo& pkg = packages[i]; DDUMP(IdeImg::GetCount()); Adding this log should might help to resolve whether IdeImg iml indeed gets damaged And possibly // alist.SetDisplay(alist.GetCount() - 1, 0, pkg.main ? bpd : pd); Comment display out, just to test if it is somehow related (the only other thing that does something with icons in the loop).
creator: mirek
date: 2024-10-19T15:32:50-00:00

Re: Compilation warnings and random crashes
type: item
description: And maybe for(int i = 0; i < packages.GetCount(); i++) { const PkInfo& pkg = packages[i]; DDUMP(IdeImg::GetCount()); DDUMP(pkg.package); (Just to check whether maybe it is always the same package that causes problems)
creator: mirek
date: 2024-10-19T15:57:09-00:00

Re: Compilation warnings and random crashes
type: item
description: I've attached the logs (3)
creator: Oblivion
date: 2024-10-19T15:58:34-00:00

Re: Compilation warnings and random crashes
type: item
description: Noticed something: #2 0x00005555557a129f in IdeImg::Get (i=225) at /home/maldoror/Geliştirme/upp/devel/uppsrc/Draw/iml_source. h:113 If gdb gets it right, 225 is out of range. Which would be consistent with random crashes in release mode and probably a compiler bug. Can you try DLOG("======== LOAD"); for(int i = 0; i < packages.GetCount(); i++) { const PkInfo& pkg = packages[i]; Image icon = pkg.icon; if(IsNull(icon)) { if(pkg.main) icon = pkg.upphub ? IdeImg::HubMainPackage() : IdeImg::MainPackage(); else icon = pkg.upphub ? IdeImg::HubPackage() : IdeImg::Package(); } nest_list.Add(pkg.nest); clist.Add(pkg.package, DPI(icon, 16)); alist.Add(pkg.package, GetFileName(pkg.nest), pkg.description, icon); alist.SetDisplay(alist.GetCount() - 1, 0, pkg.main ? bpd : pd); } DLOG("~~~ LOAD"); Image Iml::Get(int i) { DDUMP(i); IImage& m = map[i]; if(!m.loaded) { Mutex::Lock __(sImlLock); if(!m.loaded) { m.image = MakeImlImage(GetId(i), [&](int mode, const String& id) { return GetRaw(mode, id); }, global_flags); m.loaded = true; } } return m.image; } If it really dumps out of range numbers in the loop, can you send me disassembly of void SelectPackageDlg::SyncList(const String& find) ?
creator: mirek
date: 2024-10-20T07:23:45-00:00

Re: Compilation warnings and random crashes
type: item
description: Ok, I will do that later today. But in the meantime I have found out that TheIDE compiled with GCC with the same level of optimization (O3) didn't crash, however I tried since yesterday (on the same machine/setup). Not once. It does "appear" to be a compiler bug, but with the above tests -hopefully- we'll see. Best regards, Oblivion
creator: Oblivion
date: 2024-10-20T07:45:40-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Sun, 20 October 2024 09:45 Ok, I will do that later today. But in the meantime I have found out that TheIDE compiled with GCC with the same level of optimization (O3) didn't crash, however I tried since yesterday (on the same machine/setup). Not once. It does "appear" to be a compiler bug, but with the above tests -hopefully- we'll see. Best regards, Oblivion I already have a workaround in the mind (just move image constants from inline to offline functions so that compiler does not try to optimise it), but frankly I am feeling pretty uneasy about bugged compilers... Maybe we should move to gcc?
creator: mirek
date: 2024-10-20T07:55:23-00:00

Re: Compilation warnings and random crashes
type: item
description: mirek wrote on Sun, 20 October 2024 10:55 Maybe we should move to gcc? Hi, I hope that 'moving to gcc' does not mean dropping support for clang. My policy with platforms (including compilers) is to try to support more than one. When intermittent issues appear on one compiler, it is then easier to switch to another working compiler until the issue is resolved. When the code base is built to be compatible with MSC, CLANG and GCC (avoiding the known weak spots and/or bugs of each), the capability to handle new issues and avoid down time in such situations is far better. Best regards, Tom
creator: Tom1
date: 2024-10-20T11:45:06-00:00

Re: Compilation warnings and random crashes
type: item
description: Tom1 wrote on Sun, 20 October 2024 13:45 mirek wrote on Sun, 20 October 2024 10:55 Maybe we should move to gcc? Hi, I hope that 'moving to gcc' does not mean dropping support for clang. My policy with platforms (including compilers) is to try to support more than one. When intermittent issues appear on one compiler, it is then easier to switch to another working compiler until the issue is resolved. When the code base is built to be compatible with MSC, CLANG and GCC (avoiding the known weak spots and/or bugs of each), the capability to handle new issues and avoid down time in such situations is far better. Best regards, Tom Definitely not. Just swap preference in POSIX install script from clang to gcc. if clang++ --version >/dev/null; then echo $UMK ./uppsrc ide CLANG -brs ./theide $UMK ./uppsrc ide CLANG -brs ./theide $UMK ./uppsrc umk CLANG -brs ./umk else echo $UMK ./uppsrc ide GCC -brs ./theide $UMK ./uppsrc ide GCC -brs ./theide $UMK ./uppsrc umk GCC -brs ./umk fi -> if g++ --version >/dev/null; then echo $UMK ./uppsrc ide GCC -brs ./theide $UMK ./uppsrc ide GCC -brs ./theide $UMK ./uppsrc umk GCC -brs ./umk else echo $UMK ./uppsrc ide CLANG -brs ./theide $UMK ./uppsrc ide CLANG -brs ./theide $UMK ./uppsrc umk CLANG -brs ./umk fi Still install both build methods. Also keep CLANG in win32 where we do have a control about clang version.
creator: mirek
date: 2024-10-20T12:01:13-00:00

Re: Compilation warnings and random crashes
type: item
description: Hello Mirek, I have attached the new logs. Assuming that this is a compiler bug, I still wouldn't change the default on Linux. My reasons: 1) I didn't encounter it anywhere else. I have a lot of apps, tests etc, some have heavy inlining, and built with the same clang config. They are all stable (at least, they have yet to crash because of a really puzzling error.) 2) I tend to use ArchLinux on my machines (and other distros on VM), which ships the latest LLVM/clang, so this might be a bug in the latest version of the compiler. (At least, I did not have such crashes several months ago.) 3) GCC has significantly slower compilation speed. 4) I don't know of anyone else complaining about this bug, and I am fine with using the GCC build, it works as expected. Best regards, Oblivion
creator: Oblivion
date: 2024-10-21T18:07:49-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Mon, 21 October 2024 20:07 Hello Mirek, I have attached the new logs. Assuming that this is a compiler bug, I still wouldn't change the default on Linux. My reasons: 1) I didn't encounter it anywhere else. I have a lot of apps, tests etc, some have heavy inlining, and built with the same clang config. They are all stable (at least, they have yet to crash because of a really puzzling error.) 2) I tend to use ArchLinux on my machines (and other distros on VM), which ships the latest LLVM/clang, so this might be a bug in the latest version of the compiler. (At least, I did not have such crashes several months ago.) 3) GCC has significantly slower compilation speed. 4) I don't know of anyone else complaining about this bug, and I am fine with using the GCC build, it works as expected. Best regards, Oblivion ======== LOAD i = 39 i = 39 i = 39 i = 39 i = 39 i = 335 i = 335 Yep, out of range... What is clang --version? Should we file this in clang's bugzilla? I have also pushed a bunch of changes which I suppose should fix this. Can you try master?
creator: mirek
date: 2024-10-21T20:54:42-00:00

Re: Compilation warnings and random crashes
type: item
description: Quote: What is clang --version? clang version 18.1.8 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Quote: I have also pushed a bunch of changes which I suppose should fix this. Can you try master? If you mean commit 509e32c, I just tried it and no, unfortunately, TheIDE is still crashing with the same behaviour. Quote: Should we file this in clang's bugzilla? At this point, yes. Best regards, Oblivion
creator: Oblivion
date: 2024-10-21T21:24:02-00:00

Re: Compilation warnings and random crashes
type: item
description: Oblivion wrote on Mon, 21 October 2024 23:24 Quote: What is clang --version? clang version 18.1.8 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Quote: I have also pushed a bunch of changes which I suppose should fix this. Can you try master? If you mean commit 509e32c, I just tried it and no, unfortunately, TheIDE is still crashing with the same behaviour. Weird. Any chance of getting the .log? Quote: Quote: Should we file this in clang's bugzilla? At this point, yes. That would mean isolating the issue into some small example, which we are still far from Mirek
creator: mirek
date: 2024-10-22T09:37:17-00:00

Re: Compilation warnings and random crashes
type: item
description: After digging deeper, I have fixed a bunch of errors related to handling non-existent files which in theory might fix the issue. Please retest master... Mirek
creator: mirek
date: 2024-11-23T11:33:49-00:00

Re: Compilation warnings and random crashes
type: item
description: Hi Mirek, I've been testing it since yesterday, and all seems fine. No crashes anymore on CLANG. Best regards, Oblivion
creator: Oblivion
date: 2024-11-24T07:57:50-00:00