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












SourceForge.net Logo
Home » 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: 13975
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: 219
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: 13975
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: 13975
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: 526
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: 1075
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: 526
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: 526
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: 1212
Registered: March 2007
Senior 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: 1075
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: 526
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: 13975
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: 526
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: 13975
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: 1212
Registered: March 2007
Senior 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: 13975
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: 526
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 227 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: 1212
Registered: March 2007
Senior 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: 1212
Registered: March 2007
Senior 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 previous message
mirek is currently offline  mirek
Messages: 13975
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

Previous Topic: Impressive improvement in stl::vector when dealing with raw memory.
Next Topic: about unicode supporting
Goto Forum:
  


Current Time: Fri Mar 29 11:36:00 CET 2024

Total time taken to generate the page: 0.01908 seconds