Home » Developing U++ » U++ Developers corner » theide with libclang
|
|
|
|
|
|
|
|
|
|
|
|
| Re: theide with libclang [message #58939 is a reply to message #58938] |
Tue, 27 September 2022 23:11   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
Klugier wrote on Tue, 27 September 2022 14:35Hello Lance,
I merged the changes related to display error prompt when libclan has not been detected. In your case it won't help, because your instance of theide has access to this library.
In order to have more reasonable callstack, you can build the newest TheIDE in debug mode with the older one that works on previos Assist++ version. For example to do it you can use TheIDE from the latest release 2022.2.
Klugier
Hi Klugier,
Thanks for the reply. I tried your method with upp version 16303 whose Assist++ are still working fine on my computer with same result. When the generated ide failed with segmentation fault, I was faced with the same Force Quit or Wait choices.
I will try it with the upp version you suggested. By the way, the version of uppsrc I used is 16446.
Regards,
Lance
------
Same result with upp 2022.2 (version 16270).
[Updated on: Tue, 27 September 2022 23:18] Report message to a moderator
|
|
|
|
|
|
| Re: theide with libclang [message #58956 is a reply to message #58940] |
Sat, 01 October 2022 18:46   |
Tom1
Messages: 1319 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi,
While, everything seems quite smooth in Windows, I tried to run this in Linux Mint 21 with 16G RAM. Every time it crashes with segmentation fault a few seconds after opening the main package. I tried to run it in gdb with the following results:
Starting program: /home/tom/out/uppsrc/CLANG.Debug.Debug_Full.Gui.Shared/ide
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff1eaf640 (LWP 6714)]
[New Thread 0x7ffff16ae640 (LWP 6715)]
[New Thread 0x7fffebfff640 (LWP 6716)]
[New Thread 0x7fffeb7fe640 (LWP 6717)]
[New Thread 0x7fffeaffd640 (LWP 6718)]
[New Thread 0x7fffea7fc640 (LWP 6719)]
[New Thread 0x7fffe9ffb640 (LWP 6720)]
[New Thread 0x7fffe97fa640 (LWP 6721)]
[New Thread 0x7fffe8ff9640 (LWP 6722)]
[New Thread 0x7fffe3fff640 (LWP 6723)]
[New Thread 0x7fffe37fe640 (LWP 6724)]
[New Thread 0x7fffe2ffd640 (LWP 6725)]
[New Thread 0x7fffd91fd640 (LWP 6726)]
[New Thread 0x7fffd89fc640 (LWP 6728)]
[New Thread 0x7fffd1fff640 (LWP 6729)]
[New Thread 0x7fffd17fe640 (LWP 6730)]
[New Thread 0x7fffd0ffd640 (LWP 6731)]
[New Thread 0x7fffc3fff640 (LWP 6732)]
[New Thread 0x7fffc37fe640 (LWP 6733)]
[New Thread 0x7fffc2ffd640 (LWP 6734)]
[Detaching after fork from child process 6735]
[Detaching after fork from child process 6736]
[Detaching after fork from child process 6737]
[Detaching after fork from child process 6738]
[Detaching after fork from child process 6739]
[Detaching after fork from child process 6740]
[Detaching after fork from child process 6741]
[Detaching after fork from child process 6742]
[Detaching after fork from child process 6743]
[Detaching after fork from child process 6744]
[Detaching after fork from child process 6745]
[Detaching after fork from child process 6746]
[Detaching after fork from child process 6747]
[Detaching after fork from child process 6748]
[New Thread 0x7fffc27fc640 (LWP 6749)]
[New Thread 0x7fffc1ffb640 (LWP 6750)]
[Thread 0x7fffd91fd640 (LWP 6726) exited]
[Thread 0x7fffc1ffb640 (LWP 6750) exited]
[New Thread 0x7fffc1ffb640 (LWP 6751)]
[New Thread 0x7fffd91fd640 (LWP 6752)]
[New Thread 0x7fffa29ff640 (LWP 6753)]
[New Thread 0x7fffa21fe640 (LWP 6754)]
[New Thread 0x7fffa19fd640 (LWP 6755)]
[New Thread 0x7fff9dd2b640 (LWP 6756)]
[Thread 0x7fffd91fd640 (LWP 6752) exited]
[New Thread 0x7fffd91fd640 (LWP 6757)]
[Thread 0x7fff9dd2b640 (LWP 6756) exited]
[Thread 0x7fffa29ff640 (LWP 6753) exited]
[New Thread 0x7fffa29ff640 (LWP 6758)]
[Thread 0x7fffa21fe640 (LWP 6754) exited]
[Thread 0x7fffa19fd640 (LWP 6755) exited]
[Thread 0x7fffc1ffb640 (LWP 6751) exited]
[New Thread 0x7fffc1ffb640 (LWP 6759)]
[New Thread 0x7fffa19fd640 (LWP 6760)]
[New Thread 0x7fffa21fe640 (LWP 6761)]
[New Thread 0x7fff9dd2b640 (LWP 6762)]
[Thread 0x7fffd91fd640 (LWP 6757) exited]
[New Thread 0x7fffd91fd640 (LWP 6763)]
[Thread 0x7fffa29ff640 (LWP 6758) exited]
[New Thread 0x7fffa29ff640 (LWP 6764)]
[Thread 0x7fffa19fd640 (LWP 6760) exited]
[Thread 0x7fff9dd2b640 (LWP 6762) exited]
[Thread 0x7fffc1ffb640 (LWP 6759) exited]
[Thread 0x7fffa21fe640 (LWP 6761) exited]
[Thread 0x7fffd91fd640 (LWP 6763) exited]
[Thread 0x7fffa29ff640 (LWP 6764) exited]
[New Thread 0x7fffa29ff640 (LWP 6765)]
[New Thread 0x7fffd91fd640 (LWP 6766)]
[New Thread 0x7fffa21fe640 (LWP 6767)]
[New Thread 0x7fffc1ffb640 (LWP 6768)]
[New Thread 0x7fffa19fd640 (LWP 6769)]
[New Thread 0x7fff9dd2b640 (LWP 6770)]
[Thread 0x7fffa29ff640 (LWP 6765) exited]
[Thread 0x7fffa21fe640 (LWP 6767) exited]
[Thread 0x7fffd91fd640 (LWP 6766) exited]
[Thread 0x7fff9dd2b640 (LWP 6770) exited]
[Thread 0x7fffc1ffb640 (LWP 6768) exited]
[New Thread 0x7fffc1ffb640 (LWP 6771)]
[Thread 0x7fffc1ffb640 (LWP 6771) exited]
[New Thread 0x7fffc1ffb640 (LWP 6772)]
[Thread 0x7fffc1ffb640 (LWP 6772) exited]
[New Thread 0x7fffc1ffb640 (LWP 6773)]
[Thread 0x7fffa19fd640 (LWP 6769) exited]
[New Thread 0x7fffa19fd640 (LWP 6774)]
[New Thread 0x7fff9dd2b640 (LWP 6775)]
[New Thread 0x7fffd91fd640 (LWP 6776)]
[New Thread 0x7fffa21fe640 (LWP 6777)]
[Thread 0x7fffa21fe640 (LWP 6777) exited]
[New Thread 0x7fffa21fe640 (LWP 6778)]
[Thread 0x7fffa21fe640 (LWP 6778) exited]
[New Thread 0x7fffa21fe640 (LWP 6779)]
[Thread 0x7fffa21fe640 (LWP 6779) exited]
[New Thread 0x7fffa21fe640 (LWP 6780)]
[Thread 0x7fffa21fe640 (LWP 6780) exited]
[New Thread 0x7fffa21fe640 (LWP 6781)]
[Thread 0x7fffa21fe640 (LWP 6781) exited]
[New Thread 0x7fffa21fe640 (LWP 6782)]
[Thread 0x7fffa21fe640 (LWP 6782) exited]
[New Thread 0x7fffa21fe640 (LWP 6783)]
[Thread 0x7fffa21fe640 (LWP 6783) exited]
[New Thread 0x7fffa21fe640 (LWP 6784)]
[Thread 0x7fffa21fe640 (LWP 6784) exited]
[New Thread 0x7fffa21fe640 (LWP 6785)]
[Thread 0x7fffa21fe640 (LWP 6785) exited]
[New Thread 0x7fffa21fe640 (LWP 6786)]
[Thread 0x7fffa21fe640 (LWP 6786) exited]
[New Thread 0x7fffa21fe640 (LWP 6787)]
[Thread 0x7fffa21fe640 (LWP 6787) exited]
[New Thread 0x7fffa21fe640 (LWP 6788)]
[Thread 0x7fffa21fe640 (LWP 6788) exited]
[New Thread 0x7fffa21fe640 (LWP 6789)]
[Thread 0x7fffa21fe640 (LWP 6789) exited]
[New Thread 0x7fffa21fe640 (LWP 6790)]
[Thread 0x7fffa21fe640 (LWP 6790) exited]
[New Thread 0x7fffa21fe640 (LWP 6791)]
[Thread 0x7fffa21fe640 (LWP 6791) exited]
[New Thread 0x7fffa21fe640 (LWP 6792)]
[New Thread 0x7fffa29ff640 (LWP 6793)]
[Thread 0x7fffd91fd640 (LWP 6776) exited]
[Thread 0x7fff9dd2b640 (LWP 6775) exited]
[Thread 0x7fffa19fd640 (LWP 6774) exited]
[Thread 0x7fffa21fe640 (LWP 6792) exited]
[New Thread 0x7fffa21fe640 (LWP 6794)]
[New Thread 0x7fffa19fd640 (LWP 6795)]
[New Thread 0x7fff9dd2b640 (LWP 6796)]
[Thread 0x7fffa29ff640 (LWP 6793) exited]
[New Thread 0x7fffa29ff640 (LWP 6797)]
[Thread 0x7fffa29ff640 (LWP 6797) exited]
[New Thread 0x7fffa29ff640 (LWP 6798)]
[Thread 0x7fffa29ff640 (LWP 6798) exited]
[New Thread 0x7fffa29ff640 (LWP 6799)]
[Thread 0x7fffa29ff640 (LWP 6799) exited]
[New Thread 0x7fffa29ff640 (LWP 6800)]
[Thread 0x7fffa29ff640 (LWP 6800) exited]
[New Thread 0x7fffa29ff640 (LWP 6801)]
[Thread 0x7fffa29ff640 (LWP 6801) exited]
[New Thread 0x7fffa29ff640 (LWP 6802)]
[Thread 0x7fffa29ff640 (LWP 6802) exited]
[New Thread 0x7fffa29ff640 (LWP 6803)]
[Thread 0x7fffa29ff640 (LWP 6803) exited]
[New Thread 0x7fffa29ff640 (LWP 6804)]
[Thread 0x7fffa29ff640 (LWP 6804) exited]
[New Thread 0x7fffa29ff640 (LWP 6805)]
[Thread 0x7fffa29ff640 (LWP 6805) exited]
[New Thread 0x7fffa29ff640 (LWP 6806)]
[Thread 0x7fffa29ff640 (LWP 6806) exited]
[New Thread 0x7fffa29ff640 (LWP 6807)]
[Thread 0x7fffa29ff640 (LWP 6807) exited]
[New Thread 0x7fffa29ff640 (LWP 6808)]
[Thread 0x7fffa29ff640 (LWP 6808) exited]
[New Thread 0x7fffa29ff640 (LWP 6809)]
[Thread 0x7fffa29ff640 (LWP 6809) exited]
[New Thread 0x7fffa29ff640 (LWP 6810)]
[Thread 0x7fffa29ff640 (LWP 6810) exited]
[New Thread 0x7fffa29ff640 (LWP 6811)]
[Thread 0x7fffa29ff640 (LWP 6811) exited]
[New Thread 0x7fffa29ff640 (LWP 6812)]
[Thread 0x7fffa29ff640 (LWP 6812) exited]
[New Thread 0x7fffa29ff640 (LWP 6813)]
[Thread 0x7fffa29ff640 (LWP 6813) exited]
[New Thread 0x7fffa29ff640 (LWP 6814)]
[Thread 0x7fffa29ff640 (LWP 6814) exited]
[New Thread 0x7fffa29ff640 (LWP 6815)]
[Thread 0x7fffa29ff640 (LWP 6815) exited]
[New Thread 0x7fffa29ff640 (LWP 6816)]
[Thread 0x7fffa29ff640 (LWP 6816) exited]
[New Thread 0x7fffa29ff640 (LWP 6817)]
[Thread 0x7fffa29ff640 (LWP 6817) exited]
[New Thread 0x7fffa29ff640 (LWP 6818)]
[Thread 0x7fffa29ff640 (LWP 6818) exited]
[New Thread 0x7fffa29ff640 (LWP 6819)]
[Thread 0x7fffa29ff640 (LWP 6819) exited]
[New Thread 0x7fffa29ff640 (LWP 6820)]
[Thread 0x7fffa29ff640 (LWP 6820) exited]
[New Thread 0x7fffa29ff640 (LWP 6821)]
[Thread 0x7fffa29ff640 (LWP 6821) exited]
[New Thread 0x7fffa29ff640 (LWP 6822)]
[Thread 0x7fffc1ffb640 (LWP 6773) exited]
[Thread 0x7fffa29ff640 (LWP 6822) exited]
[New Thread 0x7fffa29ff640 (LWP 6823)]
[Thread 0x7fffa29ff640 (LWP 6823) exited]
[New Thread 0x7fffa29ff640 (LWP 6824)]
[Thread 0x7fffa29ff640 (LWP 6824) exited]
[New Thread 0x7fffa29ff640 (LWP 6825)]
[Thread 0x7fffa29ff640 (LWP 6825) exited]
[New Thread 0x7fffa29ff640 (LWP 6826)]
[Thread 0x7fffa29ff640 (LWP 6826) exited]
[New Thread 0x7fffa29ff640 (LWP 6827)]
[Thread 0x7fffa29ff640 (LWP 6827) exited]
[New Thread 0x7fffa29ff640 (LWP 6828)]
[New Thread 0x7fffc1ffb640 (LWP 6829)]
[Thread 0x7fffa29ff640 (LWP 6828) exited]
[New Thread 0x7fffa29ff640 (LWP 6830)]
[Thread 0x7fffc1ffb640 (LWP 6829) exited]
[New Thread 0x7fffc1ffb640 (LWP 6831)]
[Thread 0x7fffa29ff640 (LWP 6830) exited]
[New Thread 0x7fffa29ff640 (LWP 6832)]
[Thread 0x7fffc1ffb640 (LWP 6831) exited]
[New Thread 0x7fffc1ffb640 (LWP 6833)]
[Thread 0x7fffa29ff640 (LWP 6832) exited]
[New Thread 0x7fffa29ff640 (LWP 6834)]
[Thread 0x7fffc1ffb640 (LWP 6833) exited]
[New Thread 0x7fffc1ffb640 (LWP 6835)]
[Thread 0x7fffa29ff640 (LWP 6834) exited]
[New Thread 0x7fffa29ff640 (LWP 6836)]
[Thread 0x7fffc1ffb640 (LWP 6835) exited]
[New Thread 0x7fffc1ffb640 (LWP 6837)]
[Thread 0x7fffa29ff640 (LWP 6836) exited]
[Thread 0x7fffc1ffb640 (LWP 6837) exited]
[New Thread 0x7fffc1ffb640 (LWP 6838)]
[New Thread 0x7fffa29ff640 (LWP 6839)]
[Thread 0x7fffc1ffb640 (LWP 6838) exited]
[Thread 0x7fffa29ff640 (LWP 6839) exited]
[New Thread 0x7fffa29ff640 (LWP 6840)]
[New Thread 0x7fffc1ffb640 (LWP 6841)]
[Thread 0x7fffa29ff640 (LWP 6840) exited]
[Thread 0x7fffc1ffb640 (LWP 6841) exited]
[New Thread 0x7fffc1ffb640 (LWP 6842)]
[New Thread 0x7fffa29ff640 (LWP 6843)]
[Thread 0x7fffa29ff640 (LWP 6843) exited]
[Thread 0x7fffc1ffb640 (LWP 6842) exited]
[New Thread 0x7fffc1ffb640 (LWP 6844)]
[New Thread 0x7fffa29ff640 (LWP 6845)]
[Thread 0x7fffc1ffb640 (LWP 6844) exited]
[Thread 0x7fffa29ff640 (LWP 6845) exited]
[New Thread 0x7fffa29ff640 (LWP 6846)]
[New Thread 0x7fffc1ffb640 (LWP 6847)]
[Thread 0x7fffa29ff640 (LWP 6846) exited]
[Thread 0x7fffc1ffb640 (LWP 6847) exited]
[New Thread 0x7fffc1ffb640 (LWP 6848)]
[New Thread 0x7fffa29ff640 (LWP 6849)]
[Thread 0x7fffa29ff640 (LWP 6849) exited]
[Thread 0x7fffc1ffb640 (LWP 6848) exited]
[New Thread 0x7fffa29ff640 (LWP 6850)]
[New Thread 0x7fffc1ffb640 (LWP 6851)]
[Thread 0x7fffa29ff640 (LWP 6850) exited]
[New Thread 0x7fffa29ff640 (LWP 6852)]
[Thread 0x7fffc1ffb640 (LWP 6851) exited]
[New Thread 0x7fffc1ffb640 (LWP 6853)]
[Thread 0x7fffa29ff640 (LWP 6852) exited]
[New Thread 0x7fffa29ff640 (LWP 6854)]
[Thread 0x7fffc1ffb640 (LWP 6853) exited]
[New Thread 0x7fffc1ffb640 (LWP 6855)]
[Thread 0x7fffa29ff640 (LWP 6854) exited]
[New Thread 0x7fffa29ff640 (LWP 6856)]
[Thread 0x7fffc1ffb640 (LWP 6855) exited]
[New Thread 0x7fffc1ffb640 (LWP 6857)]
Thread 19 "ide" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc3fff640 (LWP 6732)]
0x00007fffe122271b in ?? () from /usr/lib/llvm-14/lib/libclang.so
(gdb)
The above does not say much to me.
Anyway, uninstalling libclang allows me to run ide, so I can compile new versions for testing...
Best regards,
Tom
|
|
|
|
| Re: theide with libclang [message #58957 is a reply to message #58956] |
Sat, 01 October 2022 22:49   |
 |
Klugier
Messages: 1117 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Tom
You need to have TheIDE in debug mode in order to have reasonable callstack, release mode doesn't posses debug symbols. There are multiple ways to do, you can build newer ide in debug mode with the older one.
Klugier
U++ - one framework to rule them all.
[Updated on: Sat, 01 October 2022 22:49] Report message to a moderator
|
|
|
|
| Re: theide with libclang [message #58958 is a reply to message #58957] |
Sun, 02 October 2022 02:19   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
I did a clean installation of Ubuntu 22.04 LTS. After update and upgrade, first thing I did was download and ./Install UPP version 16450.
Turns out
bool LoadLibClangAutomatically()
{
String libdir = TrimBoth(Sys("llvm-config --libdir"));
if(LoadLibClang(libdir + "/libclang.so")) {
return true;
}
if(LoadLibClang("/usr/lib/libclang.so")) {
return true;
}
for(int i = 20; i >= 10; i--) {
if(LoadLibClang("/usr/lib/llvm-" + AsString(i) + "/lib/libclang.so")) {
return true;
}
}
return false;
}
failed even though a libclang is present in the system.
After I made the following change, libclang can be successfully located. It seems some expected symlinks were not present in the system.
bool LoadLibClangAutomatically()
{
String libdir = TrimBoth(Sys("llvm-config-14 --libdir"));
if(LoadLibClang(libdir + "/libclang.so.1")) {
return true;
}
if(LoadLibClang("/usr/lib/libclang.so")) {
return true;
}
for(int i = 20; i >= 10; i--) {
if(LoadLibClang("/usr/lib/llvm-" + AsString(i) + "/lib/libclang.so")) {
return true;
}
}
return false;
}
After that, Assist++ is up and running, parsing the sources and populating the right panel with class/function/etc info. I was even successful to invoke code completion with object name following by a dot(.). It went much further than it used to. Unfortunately segmentation fault follows. Yes, it's built in debug mode. No, gdb, run & bt would not produce anything useful, essentially very similar to what Tom and I have posted.
[Updated on: Sun, 02 October 2022 02:21] Report message to a moderator
|
|
|
|
| Re: theide with libclang [message #58959 is a reply to message #58958] |
Sun, 02 October 2022 11:57   |
 |
mirek
Messages: 14290 Registered: November 2005
|
Ultimate Member |
|
|
Lance wrote on Sun, 02 October 2022 02:19I did a clean installation of Ubuntu 22.04 LTS. After update and upgrade, first thing I did was download and ./Install UPP version 16450.
After that, Assist++ is up and running, parsing the sources and populating the right panel with class/function/etc info. I was even successful to invoke code completion with object name following by a dot(.). It went much further than it used to. Unfortunately segmentation fault follows. Yes, it's built in debug mode. No, gdb, run & bt would not produce anything useful, essentially very similar to what Tom and I have posted.
One thing worth testing: try with USEMALLOC...
(I will try to look into this mess ASAP).
[Updated on: Sun, 02 October 2022 11:58] Report message to a moderator
|
|
|
|
| Re: theide with libclang [message #58960 is a reply to message #58959] |
Sun, 02 October 2022 15:27   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
mirek wrote on Sun, 02 October 2022 05:57Lance wrote on Sun, 02 October 2022 02:19I did a clean installation of Ubuntu 22.04 LTS. After update and upgrade, first thing I did was download and ./Install UPP version 16450.
After that, Assist++ is up and running, parsing the sources and populating the right panel with class/function/etc info. I was even successful to invoke code completion with object name following by a dot(.). It went much further than it used to. Unfortunately segmentation fault follows. Yes, it's built in debug mode. No, gdb, run & bt would not produce anything useful, essentially very similar to what Tom and I have posted.
One thing worth testing: try with USEMALLOC...
(I will try to look into this mess ASAP).
I wasn't able to notice anything different with USEMALLOC defined.
Speed-wise, new Assist++ is reasonably OK. On my old laptop, in debug mode, I can notice a delay of a few seconds (code completion), but on new hardware and release mode, it should be quite smooth.
|
|
|
|
| Re: theide with libclang [message #58961 is a reply to message #58960] |
Sun, 02 October 2022 16:17   |
 |
mirek
Messages: 14290 Registered: November 2005
|
Ultimate Member |
|
|
Lance wrote on Sun, 02 October 2022 15:27mirek wrote on Sun, 02 October 2022 05:57Lance wrote on Sun, 02 October 2022 02:19I did a clean installation of Ubuntu 22.04 LTS. After update and upgrade, first thing I did was download and ./Install UPP version 16450.
After that, Assist++ is up and running, parsing the sources and populating the right panel with class/function/etc info. I was even successful to invoke code completion with object name following by a dot(.). It went much further than it used to. Unfortunately segmentation fault follows. Yes, it's built in debug mode. No, gdb, run & bt would not produce anything useful, essentially very similar to what Tom and I have posted.
One thing worth testing: try with USEMALLOC...
(I will try to look into this mess ASAP).
I wasn't able to notice anything different with USEMALLOC defined.
Excellent, good info, thanks.
|
|
|
|
| Re: theide with libclang [message #58962 is a reply to message #58961] |
Sun, 02 October 2022 19:03   |
Tom1
Messages: 1319 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi,
The same here, no help from USEMALLOC on Linux Mint 21.
As I just updated from GIT, I received also compilation issues:
----- ide/clang ( GUI CLANG SHARED POSIX LINUX ) (22 / 40)
libclang.cpp
clang.cpp
/home/tom/upp.src/uppsrc/ide/clang/clang.cpp:181:3: error: unknown type name 'CXDiagnosticSet'; did you mean 'CXDiagnostic'?
CXDiagnosticSet set = clang_getChildDiagnostics(diagnostic);
^~~~~~~~~~~~~~~
CXDiagnostic
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1919:15: note: 'CXDiagnostic' declared here
typedef void *CXDiagnostic;
^
/home/tom/upp.src/uppsrc/ide/clang/clang.cpp:181:25: error: use of undeclared identifier 'clang_getChildDiagnostics'; did you mean 'clang_getNumDiagnostics'?
CXDiagnosticSet set = clang_getChildDiagnostics(diagnostic);
^~~~~~~~~~~~~~~~~~~~~~~~~
clang_getNumDiagnostics
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1992:10: note: 'clang_getNumDiagnostics' declared here
unsigned clang_getNumDiagnostics(CXTranslationUnit Unit);
^
/home/tom/upp.src/uppsrc/ide/clang/clang.cpp:181:51: error: cannot initialize a parameter of type 'CXTranslationUnit' (aka 'CXTranslationUnitImpl *') with an lvalue of type 'CXDiagnostic' (aka 'void *')
CXDiagnosticSet set = clang_getChildDiagnostics(diagnostic);
^~~~~~~~~~
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1992:52: note: passing argument to parameter 'Unit' here
unsigned clang_getNumDiagnostics(CXTranslationUnit Unit);
^
/home/tom/upp.src/uppsrc/ide/clang/clang.cpp:182:11: error: use of undeclared identifier 'clang_getNumDiagnosticsInSet'; did you mean 'clang_getNumDiagnostics'?
int n = clang_getNumDiagnosticsInSet(set);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang_getNumDiagnostics
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1992:10: note: 'clang_getNumDiagnostics' declared here
unsigned clang_getNumDiagnostics(CXTranslationUnit Unit);
^
/home/tom/upp.src/uppsrc/ide/clang/clang.cpp:182:40: error: cannot initialize a parameter of type 'CXTranslationUnit' (aka 'CXTranslationUnitImpl *') with an lvalue of type 'CXDiagnostic' (aka 'void *')
int n = clang_getNumDiagnosticsInSet(set);
^~~
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1992:52: note: passing argument to parameter 'Unit' here
unsigned clang_getNumDiagnostics(CXTranslationUnit Unit);
^
/home/tom/upp.src/uppsrc/ide/clang/clang.cpp:184:21: error: use of undeclared identifier 'clang_getDiagnosticInSet'; did you mean 'clang_getDiagnostic'?
CXDiagnostic d = clang_getDiagnosticInSet(set, i);
^~~~~~~~~~~~~~~~~~~~~~~~
clang_getDiagnostic
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1993:14: note: 'clang_getDiagnostic' declared here
CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index);
^
/home/tom/upp.src/uppsrc/ide/clang/clang.cpp:184:46: error: cannot initialize a parameter of type 'CXTranslationUnit' (aka 'CXTranslationUnitImpl *') with an lvalue of type 'CXDiagnostic' (aka 'void *')
CXDiagnostic d = clang_getDiagnosticInSet(set, i);
^~~
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1993:52: note: passing argument to parameter 'Unit' here
CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index);
^
7 errors generated.
/home/tom/upp.src/uppsrc/ide/clang/libclang.cpp:242:1: error: unknown type name 'CXDiagnosticSet'; did you mean 'CXDiagnostic'?
CXDiagnosticSet clang_getChildDiagnostics(CXDiagnostic d)
^~~~~~~~~~~~~~~
CXDiagnostic
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1919:15: note: 'CXDiagnostic' declared here
typedef void *CXDiagnostic;
^
/home/tom/upp.src/uppsrc/ide/clang/libclang.cpp:244:20: error: no member named 'clang_getChildDiagnostics' in 'T_LibClang'; did you mean 'clang_disposeDiagnostic'?
return LibClang().clang_getChildDiagnostics(d);
^~~~~~~~~~~~~~~~~~~~~~~~~
clang_disposeDiagnostic
/home/tom/upp.src/uppsrc/ide/clang/clang.dli:50:10: note: 'clang_disposeDiagnostic' declared here
FN(void, clang_disposeDiagnostic, (CXDiagnostic Diagnostic))
^
/home/tom/upp.src/uppsrc/ide/clang/libclang.cpp:244:9: error: cannot initialize return object of type 'CXDiagnostic' (aka 'void *') with an rvalue of type 'void'
return LibClang().clang_getChildDiagnostics(d);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tom/upp.src/uppsrc/ide/clang/libclang.cpp:247:39: error: unknown type name 'CXDiagnosticSet'; did you mean 'CXDiagnostic'?
unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet diags)
^~~~~~~~~~~~~~~
CXDiagnostic
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1919:15: note: 'CXDiagnostic' declared here
typedef void *CXDiagnostic;
^
/home/tom/upp.src/uppsrc/ide/clang/libclang.cpp:249:20: error: no member named 'clang_getNumDiagnosticsInSet' in 'T_LibClang'
return LibClang().clang_getNumDiagnosticsInSet(diags);
~~~~~~~~~~ ^
/home/tom/upp.src/uppsrc/ide/clang/libclang.cpp:252:39: error: unknown type name 'CXDiagnosticSet'; did you mean 'CXDiagnostic'?
CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet diags, unsigned index)
^~~~~~~~~~~~~~~
CXDiagnostic
/home/tom/upp.src/uppsrc/ide/clang/libclang.h:1919:15: note: 'CXDiagnostic' declared here
typedef void *CXDiagnostic;
^
/home/tom/upp.src/uppsrc/ide/clang/libclang.cpp:254:20: error: no member named 'clang_getDiagnosticInSet' in 'T_LibClang'
return LibClang().clang_getDiagnosticInSet(diags, index);
~~~~~~~~~~ ^
7 errors generated.
ide/clang: 2 file(s) built in (0:03.45), 1726 msecs / file
There were errors. (0:03.48)
Best regards,
Tom
|
|
|
|
|
|
| Re: theide with libclang [message #58966 is a reply to message #58964] |
Mon, 03 October 2022 00:58   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
To Mirek:
Same result. Crashed with sigmentation fault. Initial parsing (with a dialog box prompting or something similar) didn't show up. One out of two run, I noticed the right panel populated with class/function info. Blank in the other: it crashed before anything could come out.
The code editor didn't respond to key stoke/mouse click. I intended to enter something in the code editor to see if code completion would work, but wasn't able to activate the code editor. Maybe it's working too hard at the background doing parsing.
It behaved somewhat differently from the previous version, in a sense, worse. But that should not matter once we figure out the reason for the segmentation fault.
gdb/run/bt produced similar information.
I was able to do some screen shots of supposed calling stack, hopefully it means something to you.

BTW: the generated ide is showing version 16466.
Update: in all following run(5-6), right panel were populated. And code editor could be actived. Code complete performed with similar response speed as previous tested version. So, no, it's not worth in this regard.
-
Attachment: clang.png
(Size: 253.43KB, Downloaded 579 times)
[Updated on: Mon, 03 October 2022 05:47] Report message to a moderator
|
|
|
|
| Re: theide with libclang [message #58967 is a reply to message #58966] |
Mon, 03 October 2022 09:34   |
Tom1
Messages: 1319 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi Mirek,
No change. It still crashes as before:
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Lclang.Shared/ide 03.10.2022 09:47:54, user: tom
09:47:54:552 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 09:47:14
****************** PANIC: Invalid memory access!
Anyway, it's nice to have the --noclang switch for testing.
BTW: I have also clang-14. Could this make any difference compared to your clang-10?
Best regards,
Tom
|
|
|
|
| Re: theide with libclang [message #58968 is a reply to message #58967] |
Mon, 03 October 2022 10:05   |
Tom1
Messages: 1319 Registered: March 2007
|
Ultimate Contributor |
|
|
Mirek,
I installed and had success with libclang-11! It does not crash with LCLANG flag.
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Lclang.Shared/ide 03.10.2022 11:02:44, user: tom
11:02:44:268 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 10:55:02
Without the flag it goes with libclang-14 and crashes:
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Shared/ide 03.10.2022 10:59:52, user: tom
10:59:52:892 INFO libclang path:/usr/lib/llvm-14/lib/libclang.so
10:59:52:893 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 10:59:10
****************** PANIC: Invalid memory access!
Best regards,
Tom
|
|
|
|
| Re: theide with libclang [message #58969 is a reply to message #58968] |
Mon, 03 October 2022 10:34   |
 |
mirek
Messages: 14290 Registered: November 2005
|
Ultimate Member |
|
|
Tom1 wrote on Mon, 03 October 2022 10:05Mirek,
I installed and had success with libclang-11! It does not crash with LCLANG flag.
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Lclang.Shared/ide 03.10.2022 11:02:44, user: tom
11:02:44:268 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 10:55:02
Without the flag it goes with libclang-14 and crashes:
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Shared/ide 03.10.2022 10:59:52, user: tom
10:59:52:892 INFO libclang path:/usr/lib/llvm-14/lib/libclang.so
10:59:52:893 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 10:59:10
****************** PANIC: Invalid memory access!
Best regards,
Tom
Can you try to LCLANG with libclang-14? (by changing build method paths)
Anyway, if this is holds true, it would be both great and sort of bad - there will be a lot of work fixing install process for clang, even maybe ide/Builders. Hopefully the community will help with that...
Mirek
[Updated on: Mon, 03 October 2022 10:37] Report message to a moderator
|
|
|
|
|
|
|
|
| Re: theide with libclang [message #58972 is a reply to message #58969] |
Mon, 03 October 2022 11:30   |
Tom1
Messages: 1319 Registered: March 2007
|
Ultimate Contributor |
|
|
mirek wrote on Mon, 03 October 2022 11:34Tom1 wrote on Mon, 03 October 2022 10:05Mirek,
I installed and had success with libclang-11! It does not crash with LCLANG flag.
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Lclang.Shared/ide 03.10.2022 11:02:44, user: tom
11:02:44:268 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 10:55:02
Without the flag it goes with libclang-14 and crashes:
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Shared/ide 03.10.2022 10:59:52, user: tom
10:59:52:892 INFO libclang path:/usr/lib/llvm-14/lib/libclang.so
10:59:52:893 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 10:59:10
****************** PANIC: Invalid memory access!
Best regards,
Tom
Can you try to LCLANG with libclang-14? (by changing build method paths)
Anyway, if this is holds true, it would be both great and sort of bad - there will be a lot of work fixing install process for clang, even maybe ide/Builders. Hopefully the community will help with that...
Mirek
Yes, this was my first test today and it failed. That's why I decided to try libclang-11 in the first place.
BR,
Tom
|
|
|
|
| Re: theide with libclang [message #58973 is a reply to message #58971] |
Mon, 03 October 2022 11:35   |
Tom1
Messages: 1319 Registered: March 2007
|
Ultimate Contributor |
|
|
[quote title=mirek wrote on Mon, 03 October 2022 11:48]Tom1 wrote on Mon, 03 October 2022 10:05Mirek,
I installed and had success with libclang-11! It does not crash with LCLANG flag.
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Lclang.Shared/ide 03.10.2022 11:02:44, user: tom
11:02:44:268 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 10:55:02
What about dynamically loaded libclang-11?
Mirek
Yes, libclang-11 works without crash when loading dynamically as well:
* /home/tom/out/uppsrc/CLANG.Blitz.Gui.Shared/ide 03.10.2022 12:33:52, user: tom
12:33:52:324 INFO libclang path:/usr/lib/llvm-11/lib/libclang.so
12:33:52:324 INFO GuiMainFn_(): Version: 16466 (64 bit) (wchar32) (CLANG) (C++14) (Gtk) Compiled: 10/03/2022 10:59:10
BR,
Tom
|
|
|
|
| Re: theide with libclang [message #58974 is a reply to message #58973] |
Mon, 03 October 2022 11:45   |
Tom1
Messages: 1319 Registered: March 2007
|
Ultimate Contributor |
|
|
Mirek,
Further on: libclang-11, libclang-12 and libclang-13 do not crash when loading dynamically. It's just libclang-14 that crashes here.
BR,
Tom
|
|
|
|
|
|
| Re: theide with libclang [message #58978 is a reply to message #58970] |
Mon, 03 October 2022 15:51   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
mirek wrote on Mon, 03 October 2022 04:37Lance wrote on Mon, 03 October 2022 00:58
I was able to do some screen shots of supposed calling stack, hopefully it means something to you.
You do not need to do it this way (if you are debugging with theide): There is a menu item in Debug that copies backtrace of all threads to clipboard.
Mirek
I see. Thanks.
----------------------------------
Thread: 1
futex_wait (private=0, expected=2, futex_word=0x555556869ca8 <Upp::sHeapLock2+8>) at ../sysdeps/nptl/futex-internal.h:146
./nptl/lowlevellock.c:49
----------------------------------
Thread: 2
../sysdeps/unix/sysv/linux/poll.c:29
----------------------------------
Thread: 3
../sysdeps/unix/sysv/linux/poll.c:29
----------------------------------
Thread: 4
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 5
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 6
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 7
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 8
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 9
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 10
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 11
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 12
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 13
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 15
syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
----------------------------------
Thread: 17
../sysdeps/unix/sysv/linux/poll.c:29
----------------------------------
Thread: 18
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 19
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 20
/lib/x86_64-linux-gnu/libclang-14.so.13
----------------------------------
Thread: 21
futex_wait (private=0, expected=2, futex_word=0x555556869ca8 <Upp::sHeapLock2+8>) at ../sysdeps/nptl/futex-internal.h:146
./nptl/lowlevellock.c:49
----------------------------------
Thread: 22
Upp::BlkHeap<Upp::HugeHeapDetail, 4096>::DbgFreeFill (p=<error reading variable: Cannot access memory at address 0x7fffc5fed1b8>, size=<error reading variable: Cannot access memory at address 0x7fffc5fed1b0>) at /home/lance/upp.src/uppsrc/Core/HeapImp.h:93
----------------------------------
Thread: 23
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 24
./nptl/futex-internal.c:57
./nptl/futex-internal.c:87
./nptl/futex-internal.c:139
----------------------------------
Thread: 25
futex_wait (private=0, expected=2, futex_word=0x5555568d01d8 <Upp::sGLock+8>) at ../sysdeps/nptl/futex-internal.h:146
./nptl/lowlevellock.c:49
----------------------------------
Thread: 29
futex_wait (private=0, expected=2, futex_word=0x555556869ca8 <Upp::sHeapLock2+8>) at ../sysdeps/nptl/futex-internal.h:146
./nptl/lowlevellock.c:49
----------------------------------
Thread: 31
futex_wait (private=0, expected=2, futex_word=0x555556869ca8 <Upp::sHeapLock2+8>) at ../sysdeps/nptl/futex-internal.h:146
./nptl/lowlevellock.c:49
----------------------------------
Thread: 32
futex_wait (private=0, expected=2, futex_word=0x555556869ca8 <Upp::sHeapLock2+8>) at ../sysdeps/nptl/futex-internal.h:146
./nptl/lowlevellock.c:49
|
|
|
|
| Re: theide with libclang [message #58979 is a reply to message #58978] |
Mon, 03 October 2022 23:20   |
 |
Klugier
Messages: 1117 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I just installed Ubuntu 22.04.01 (LTS) and I managed to reproduce the problem. After opening project, the crash happen after 4-5 seconds of running indexer. Thanks to --noclang option I managed to build TheIDE under debug mode. Here is the screenshot from the crash and callstack:

It seems that it crashes when calling clang_getCursorPrettyPrinted in ClangCursorInfo::RawId() method:
force_inline
String ClangCursorInfo::RawId()
{
if(!hasraw_id) {
raw_id = FetchString(clang_getCursorPrettyPrinted(cursor, pp_id)); // Last call in TheIDE code base before crash...
hasraw_id = true;
}
return raw_id;
}
-----
I have 14.0.0-1ubuntu1, on Manajaro I have 14.0.6 and there is no crash.
-----
Once change the line to:
raw_id = FetchString(clang_getCursorPrettyPrinted(cursor, nullptr));
Fixed the problem, however I am not sure what is this code doing, so there is a chance that it will break something...
Klugier
U++ - one framework to rule them all.
[Updated on: Mon, 03 October 2022 23:50] Report message to a moderator
|
|
|
|
|
|
| Re: theide with libclang [message #58993 is a reply to message #58992] |
Sat, 08 October 2022 21:29   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
Mirek:
No more crashes after the line is commented out. I have tested with both llvm-14 and llvm-15.
For some reason, neither llvm-14 nor llvm-15 generate some symlinks that should be in exist for ide to properly load libclang dynamically.
I have
and
but not
Also, I believe I also need to manually create
sudo ln -s /usr/lib/llvm-15/lib/libclang.so.1 /usr/lib/llvm-15/lib/libclang.so
As we cannot control how llvm installation creates symlinks, for smoother user experience, should we alter the detecting logic to accommodate this situation?
Regards,
Lance
BTW, the speed when built in release mode is quite good.
[Updated on: Sat, 08 October 2022 21:57] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: theide with libclang [message #59070 is a reply to message #59023] |
Wed, 26 October 2022 16:00   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
Not sure if this problem is unique to me: on Ubuntu 22.10+UPP.16512 (and some other recent versions),
"Find..." function cannot be used. Ctrl+F, type in string to search, won't work.
Another problem. Add new help topic will crash TheIDE. For a test,
* open "examples/AddressBook", navigate to "AddressBook.cpp" if not already in it.
* In the class "AddressBook", click any member variable or function to add cocumentation [a cyan square to the left of the function/variable line];
* in the popup menu, choose "New reference topic"
* in the "New Topic" dialog, in the Template field, change it to "Reference-en_us (in uppsrc)"
* Click "OK" button
The ide crash with invalid memory access.
I am sorry. I know Mirek has been tirelessly working on integrating libclang to theide. Not criticizing, not meaning to distract, just trying to bring awareness.
|
|
|
|
| Re: theide with libclang [message #59071 is a reply to message #59070] |
Wed, 26 October 2022 22:07   |
 |
mirek
Messages: 14290 Registered: November 2005
|
Ultimate Member |
|
|
Lance wrote on Wed, 26 October 2022 16:00Not sure if this problem is unique to me: on Ubuntu 22.10+UPP.16512 (and some other recent versions),
"Find..." function cannot be used. Ctrl+F, type in string to search, won't work.
Another problem. Add new help topic will crash TheIDE. For a test,
* open "examples/AddressBook", navigate to "AddressBook.cpp" if not already in it.
* In the class "AddressBook", click any member variable or function to add cocumentation [a cyan square to the left of the function/variable line];
* in the popup menu, choose "New reference topic"
* in the "New Topic" dialog, in the Template field, change it to "Reference-en_us (in uppsrc)"
* Click "OK" button
The ide crash with invalid memory access.
I am sorry. I know Mirek has been tirelessly working on integrating libclang to theide. Not criticizing, not meaning to distract, just trying to bring awareness.
Bug reports are always welcome!
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 24 18:32:22 GMT+2 2026
Total time taken to generate the page: 0.01415 seconds
|