U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » U++ Developers corner » theide with libclang
Re: theide with libclang [message #58932 is a reply to message #58930] Sun, 25 September 2022 16:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Klugier wrote on Sun, 25 September 2022 15:47

        // Above operation fails and we are starting to use libclang, it can not end good...



It is accounted for in the code, should continue working without assist.

That said, a prompt with information is a must here.

Mirek
Re: theide with libclang [message #58933 is a reply to message #58929] Sun, 25 September 2022 21:50 Go to previous messageGo to next message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 227
Registered: June 2011
Experienced Member
Lance wrote on Sun, 25 September 2022 15:30

As you can see, I can either Wait(and it eventually bring me to the same screen) or Force Quit the generated debug-mode theide which end the generated debug-mode theide completely,leaving me no chance to check the call stack.


Times like that you pretty much have no choice but to run gdb directly and get a call stack.

gdb <appname>
run

then when it crashes type bt for a backtrace
quit (or q) to quit.

I'm not an expert with gdb but it could get you further. It has a help section, a tui (if you run it with -tui) and I think they even added python scripting support a while ago.
Re: theide with libclang [message #58934 is a reply to message #58917] Sun, 25 September 2022 23:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
jjacksonRIAB wrote on Sat, 24 September 2022 11:10
Mirek,

The problem appears to manifest with assist_cursor in Assist.cpp line 502.

It gathers all of the potential include files appropriately but assist_cursor never matches current pos so it returns before performing the completion.



And the whole time I thought the problem is with C++ autocomplete in header files.... Smile

Thanks, good catch.

Mirek
Re: theide with libclang [message #58935 is a reply to message #58933] Sun, 25 September 2022 23:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
jjacksonRIAB wrote on Sun, 25 September 2022 21:50
Lance wrote on Sun, 25 September 2022 15:30

As you can see, I can either Wait(and it eventually bring me to the same screen) or Force Quit the generated debug-mode theide which end the generated debug-mode theide completely,leaving me no chance to check the call stack.


Times like that you pretty much have no choice but to run gdb directly and get a call stack.

gdb <appname>
run

then when it crashes type bt for a backtrace
quit (or q) to quit.

I'm not an expert with gdb but it could get you further. It has a help section, a tui (if you run it with -tui) and I think they even added python scripting support a while ago.


You can post the backtrace here...
Re: theide with libclang [message #58937 is a reply to message #58935] Tue, 27 September 2022 01:48 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
mirek wrote on Sun, 25 September 2022 17:26
jjacksonRIAB wrote on Sun, 25 September 2022 21:50
Lance wrote on Sun, 25 September 2022 15:30

As you can see, I can either Wait(and it eventually bring me to the same screen) or Force Quit the generated debug-mode theide which end the generated debug-mode theide completely,leaving me no chance to check the call stack.


[code]


Times like that you pretty much have no choice but to run gdb directly and get a call stack.

gdb <appname>
run

then when it crashes type bt for a backtrace
quit (or q) to quit.

I'm not an expert with gdb but it could get you further. It has a help section, a tui (if you run it with -tui) and I think they even added python scripting support a while ago.


You can post the backtrace here...


Reading symbols from ./ide...
(gdb) run
Starting program: /home/lance/.cache/upp.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 0x7ffff3dc5640 (LWP 66838)]
[New Thread 0x7ffff35c4640 (LWP 66839)]
[New Thread 0x7fffebfff640 (LWP 66840)]
[New Thread 0x7fffeb7fe640 (LWP 66841)]
[New Thread 0x7fffeaffd640 (LWP 66842)]
[New Thread 0x7fffea7fc640 (LWP 66843)]
[New Thread 0x7fffe9ffb640 (LWP 66844)]
[New Thread 0x7fffe97fa640 (LWP 66845)]
[New Thread 0x7fffe8ff9640 (LWP 66846)]
[New Thread 0x7fffe3fff640 (LWP 66847)]
[New Thread 0x7fffe37fe640 (LWP 66848)]
[New Thread 0x7fffe2ffd640 (LWP 66849)]
[New Thread 0x7fffda1fd640 (LWP 66850)]
[New Thread 0x7fffd99fc640 (LWP 66851)]
[New Thread 0x7fffd91fb640 (LWP 66852)]
[New Thread 0x7fffd89fa640 (LWP 66854)]
[Thread 0x7fffd91fb640 (LWP 66852) exited]
[Thread 0x7fffd99fc640 (LWP 66851) exited]
[New Thread 0x7fffd99fc640 (LWP 66855)]
[New Thread 0x7fffd91fb640 (LWP 66856)]
[New Thread 0x7fffb77ff640 (LWP 66857)]
[New Thread 0x7fffb6ffe640 (LWP 66858)]
[New Thread 0x7fffb67fd640 (LWP 66859)]
[New Thread 0x7fffb5ffc640 (LWP 66860)]
[New Thread 0x7fffb57fb640 (LWP 66861)]
[Detaching after fork from child process 66862]
[Detaching after fork from child process 66863]
[Detaching after fork from child process 66864]
[Detaching after fork from child process 66865]
[Detaching after fork from child process 66866]
[Detaching after fork from child process 66867]
[Detaching after fork from child process 66868]
[Detaching after fork from child process 66869]
[Detaching after fork from child process 66870]
[Detaching after fork from child process 66871]
[Detaching after fork from child process 66872]
[Detaching after fork from child process 66873]
[Detaching after fork from child process 66874]
[Detaching after fork from child process 66875]
[New Thread 0x7fffb4ffa640 (LWP 66876)]
[New Thread 0x7fff9ffff640 (LWP 66877)]
[New Thread 0x7fff8f77e640 (LWP 66879)]
[New Thread 0x7fff8ef7d640 (LWP 66880)]
[New Thread 0x7fff8e77c640 (LWP 66881)]
[New Thread 0x7fff8df7b640 (LWP 66882)]
[New Thread 0x7fff89c7a640 (LWP 66883)]
[New Thread 0x7fff89479640 (LWP 66884)]
[Thread 0x7fff9ffff640 (LWP 66877) exited]
[Thread 0x7fffda1fd640 (LWP 66850) exited]
[Thread 0x7fff8f77e640 (LWP 66879) exited]
[Thread 0x7fff8e77c640 (LWP 66881) exited]
[Thread 0x7fff8df7b640 (LWP 66882) exited]
[Thread 0x7fff89c7a640 (LWP 66883) exited]
[Thread 0x7fff89479640 (LWP 66884) exited]
[Thread 0x7fff8ef7d640 (LWP 66880) exited]
[New Thread 0x7fff8ef7d640 (LWP 66888)]
[New Thread 0x7fff89479640 (LWP 66889)]

Thread 21 "ide" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb6ffe640 (LWP 66858)]
0x00007fffe122271b in ?? () from /usr/lib/llvm-14/lib/libclang.so
(gdb) bt
#0  0x00007fffe122271b in  () at /usr/lib/llvm-14/lib/libclang.so
(gdb) 

Re: theide with libclang [message #58938 is a reply to message #58937] Tue, 27 September 2022 20:35 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1117
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello 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


U++ - one framework to rule them all.
Re: theide with libclang [message #58939 is a reply to message #58938] Tue, 27 September 2022 23:11 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
Klugier wrote on Tue, 27 September 2022 14:35
Hello 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 #58940 is a reply to message #58933] Tue, 27 September 2022 23:12 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
jjacksonRIAB wrote on Sun, 25 September 2022 15:50
Lance wrote on Sun, 25 September 2022 15:30

As you can see, I can either Wait(and it eventually bring me to the same screen) or Force Quit the generated debug-mode theide which end the generated debug-mode theide completely,leaving me no chance to check the call stack.


Times like that you pretty much have no choice but to run gdb directly and get a call stack.

gdb <appname>
run

then when it crashes type bt for a backtrace
quit (or q) to quit.

I'm not an expert with gdb but it could get you further. It has a help section, a tui (if you run it with -tui) and I think they even added python scripting support a while ago.


I forgot to thank you for your reply Smile
Re: theide with libclang [message #58956 is a reply to message #58940] Sat, 01 October 2022 18:46 Go to previous messageGo to next message
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 Go to previous messageGo to next message
Klugier is currently offline  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 Go to previous messageGo to next message
Lance is currently offline  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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Lance wrote on Sun, 02 October 2022 02:19
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.

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 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
mirek wrote on Sun, 02 October 2022 05:57
Lance wrote on Sun, 02 October 2022 02:19
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.

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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Lance wrote on Sun, 02 October 2022 15:27
mirek wrote on Sun, 02 October 2022 05:57
Lance wrote on Sun, 02 October 2022 02:19
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.

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 Go to previous messageGo to next message
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 #58964 is a reply to message #58962] Sun, 02 October 2022 22:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
I have made some additions trying to ease (and help resolve) current problems:

- there is now --noclang commandline option that simply switches libclang loading off. should help with those crashes without uninstalling libclang
- the path of libclang loaded is written to theide log
- there are also improved message boxes informing about missing libclang (or that it is now detected if it was missing)

- most importantly:

One of likely culprits here is dynamic loading. I would like you to test with linked libclang. In order to make it easier, I have added another theide mainconfig with new "LCLANG" that forces the "normal" linking of libclang. Downside is that you probably will have to manually alter build method with include and library paths (on mine, it is /usr/lib/llvm-10/include and /usr/lib/llvm-10/lib). Can you (Tom1 and Lance) test this for me?
Re: theide with libclang [message #58966 is a reply to message #58964] Mon, 03 October 2022 00:58 Go to previous messageGo to next message
Lance is currently offline  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.

index.php?t=getfile&id=6669&private=0


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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Tom1 wrote on Mon, 03 October 2022 10:05
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


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 #58970 is a reply to message #58966] Mon, 03 October 2022 10:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Lance 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
Re: theide with libclang [message #58971 is a reply to message #58968] Mon, 03 October 2022 10:48 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
[quote title=Tom1 wrote on Mon, 03 October 2022 10:05]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


What about dynamically loaded libclang-11?

Mirek
Re: theide with libclang [message #58972 is a reply to message #58969] Mon, 03 October 2022 11:30 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
mirek wrote on Mon, 03 October 2022 11:34
Tom1 wrote on Mon, 03 October 2022 10:05
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


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 Go to previous messageGo to next message
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:05
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


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 Go to previous messageGo to next message
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 #58976 is a reply to message #58974] Mon, 03 October 2022 13:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Tom1 wrote on Mon, 03 October 2022 11:45
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


Thank you, very helpful. So I guess we can rule out dynamic loading and it now appears to be 14 specific.

I guess there is some bug in using the API.

Mirek
Re: theide with libclang [message #58978 is a reply to message #58970] Mon, 03 October 2022 15:51 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
mirek wrote on Mon, 03 October 2022 04:37
Lance 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 Go to previous messageGo to next message
Klugier is currently offline  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:
index.php?t=getfile&id=6670&private=0

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 #58992 is a reply to message #58979] Sat, 08 October 2022 19:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Klugier wrote on Mon, 03 October 2022 23:20
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:
index.php?t=getfile&id=6670&private=0


I now strongly believe this is libclang bug. When I comment out ide/clang/Visitor.cpp:378

// CXPrintingPolicy_FullyQualifiedName,


, there seems to be no more crashes.

And it always crashes on the same node (standard library to_pointer method).

Can you (I mean everybody with crashing libclang) check above (while I am thinking about how to fix this).

Mirek
Re: theide with libclang [message #58993 is a reply to message #58992] Sat, 08 October 2022 21:29 Go to previous messageGo to next message
Lance is currently offline  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
/usr/bin/llvm-config-15

and
/usr/bin/llvm-config-14

but not
/usr/bin/llvm-config


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 #58994 is a reply to message #58992] Sat, 08 October 2022 21:54 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
Hi Mirek,

Same here: No more crashes after commenting out.

BR,

Tom

Update: And by the way: I'm really seriously missing the auto completion for macros...

[Updated on: Sat, 08 October 2022 22:11]

Report message to a moderator

Re: theide with libclang [message #58995 is a reply to message #58994] Sat, 08 October 2022 23:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Tom1 wrote on Sat, 08 October 2022 21:54
Hi Mirek,

Same here: No more crashes after commenting out.

BR,

Tom

Update: And by the way: I'm really seriously missing the auto completion for macros...


It is in todo list for now.

Mirek

Re: theide with libclang [message #58997 is a reply to message #58995] Sun, 09 October 2022 20:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Workaround is in master.

I have also tried to

- do something with Linux performance - hopefully indexer threads now should have lower priority, maybe
- changed default Assist settings - lower the number of threads etc... (but if you have already started theide, settings are already in config)

Let is hope this will move us past linux issues....
Re: theide with libclang [message #58998 is a reply to message #58997] Sun, 09 October 2022 21:19 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
Hi Mirek,

Seems to run fine now in Linux Mint 21 here. Smile

However, should this workaround be POSIX only, or what are the consequences in Windows?:
#define UBUNTU2204_WORKAROUND // there appears to be a bug in Ubuntu 22.04.1LTS libclang 14

Best regards,

Tom
Re: theide with libclang [message #58999 is a reply to message #58998] Sun, 09 October 2022 23:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Tom1 wrote on Sun, 09 October 2022 21:19
Hi Mirek,

Seems to run fine now in Linux Mint 21 here. Smile

However, should this workaround be POSIX only, or what are the consequences in Windows?:
#define UBUNTU2204_WORKAROUND // there appears to be a bug in Ubuntu 22.04.1LTS libclang 14

Best regards,

Tom


Workaround basically implements what is crashing in another way. I will be better to keep the code the same for both platforms.

I could probably do without #define, it more or less for documentation purposes...

Mirek
Re: theide with libclang [message #59022 is a reply to message #58579] Sat, 15 October 2022 11:33 Go to previous messageGo to next message
peterh is currently offline  peterh
Messages: 108
Registered: November 2018
Location: Germany
Experienced Member
libclangd seems to have a problem with header files.
It expects a "}" at the end of the header file and it thinks the opening bracket is at a negative line number.
I see this with other header files too.
Upp Version 16497 on Windows 10 64 bit.

In "CurrentContext.cpp" there is no matching bracket for
namespace Upp {


index.php?t=getfile&id=6683&private=0



  • Attachment: ide.png
    (Size: 69.93KB, Downloaded 636 times)

[Updated on: Sat, 15 October 2022 13:39]

Report message to a moderator

Re: theide with libclang [message #59023 is a reply to message #59022] Sun, 16 October 2022 13:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
peterh wrote on Sat, 15 October 2022 11:33
libclangd seems to have a problem with header files.
It expects a "}" at the end of the header file and it thinks the opening bracket is at a negative line number.
I see this with other header files too.
Upp Version 16497 on Windows 10 64 bit.

In "CurrentContext.cpp" there is no matching bracket for
namespace Upp {


index.php?t=getfile&id=6683&private=0





Thanks. I am aware of that, this is one of bugs to address. Work in progress.
Re: theide with libclang [message #59070 is a reply to message #59023] Wed, 26 October 2022 16:00 Go to previous messageGo to next message
Lance is currently offline  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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Lance wrote on Wed, 26 October 2022 16:00
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.


Bug reports are always welcome!
Re: theide with libclang [message #59075 is a reply to message #59070] Thu, 27 October 2022 12:21 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Lance wrote on Wed, 26 October 2022 16:00

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


This part should be now fixed in master.
Previous Topic: Impressive improvement in stl::vector when dealing with raw memory.
Next Topic: about unicode supporting
Goto Forum:
  


Current Time: Fri Apr 24 18:32:22 GMT+2 2026

Total time taken to generate the page: 0.01415 seconds