Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Compilation warnings and random crashes
Re: Compilation warnings and random crashes [message #61008 is a reply to message #61007] Fri, 18 October 2024 09:42 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
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


Re: Compilation warnings and random crashes [message #61013 is a reply to message #61008] Sat, 19 October 2024 09:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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;
}
Re: Compilation warnings and random crashes [message #61014 is a reply to message #61013] Sat, 19 October 2024 10:20 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
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
  • Attachment: logs.zip
    (Size: 11.12KB, Downloaded 58 times)


Re: Compilation warnings and random crashes [message #61015 is a reply to message #61014] Sat, 19 October 2024 11:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
(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;

[Updated on: Sat, 19 October 2024 11:02]

Report message to a moderator

Re: Compilation warnings and random crashes [message #61016 is a reply to message #61015] Sat, 19 October 2024 13:24 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
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
  • Attachment: logs2.zip
    (Size: 6.72KB, Downloaded 68 times)


Re: Compilation warnings and random crashes [message #61019 is a reply to message #61016] Sat, 19 October 2024 16:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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 } ?
Re: Compilation warnings and random crashes [message #61020 is a reply to message #61019] Sat, 19 October 2024 17:09 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
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




Re: Compilation warnings and random crashes [message #61021 is a reply to message #61020] Sat, 19 October 2024 17:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
[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).

[Updated on: Sat, 19 October 2024 17:33]

Report message to a moderator

Re: Compilation warnings and random crashes [message #61022 is a reply to message #61021] Sat, 19 October 2024 17:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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)
Re: Compilation warnings and random crashes [message #61023 is a reply to message #61007] Sat, 19 October 2024 17:58 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
I've attached the logs (3)
  • Attachment: logs3.zip
    (Size: 8.77KB, Downloaded 61 times)


Re: Compilation warnings and random crashes [message #61025 is a reply to message #61023] Sun, 20 October 2024 09:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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) ?
Re: Compilation warnings and random crashes [message #61026 is a reply to message #61025] Sun, 20 October 2024 09:45 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
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


[Updated on: Sun, 20 October 2024 09:45]

Report message to a moderator

Re: Compilation warnings and random crashes [message #61027 is a reply to message #61026] Sun, 20 October 2024 09:55 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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?
Re: Compilation warnings and random crashes [message #61028 is a reply to message #61027] Sun, 20 October 2024 13:45 Go to previous messageGo to next message
Tom1
Messages: 1303
Registered: March 2007
Ultimate Contributor
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
Re: Compilation warnings and random crashes [message #61029 is a reply to message #61028] Sun, 20 October 2024 14:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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.
Re: Compilation warnings and random crashes [message #61042 is a reply to message #60585] Mon, 21 October 2024 20:07 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
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

  • Attachment: log4.zip
    (Size: 15.76KB, Downloaded 65 times)


Re: Compilation warnings and random crashes [message #61043 is a reply to message #61042] Mon, 21 October 2024 22:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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?
Re: Compilation warnings and random crashes [message #61045 is a reply to message #61043] Mon, 21 October 2024 23:24 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
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. Sad

Quote:

Should we file this in clang's bugzilla?


At this point, yes.

Best regards,
Oblivion


Re: Compilation warnings and random crashes [message #61048 is a reply to message #61045] Tue, 22 October 2024 11:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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. Sad



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 Sad

Mirek
Re: Compilation warnings and random crashes [message #61141 is a reply to message #61048] Sat, 23 November 2024 12:33 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
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
Previous Topic: fix Core\Diag.h
Next Topic: Help & Topics (in window) dark mode toolbar icon
Goto Forum:
  


Current Time: Tue Jun 10 04:40:30 CEST 2025

Total time taken to generate the page: 0.08586 seconds