User forums > Using Code::Blocks
bug report: C::B crash when I remove the target from a cbp
Pecan:
--- Quote from: ollydbg on October 17, 2022, 02:54:18 pm ---Hi, AndrewCot, thanks for the help.
I run clangd_client in the debugger, and I found a call stack when crashed
But strange that my call-stack does not come from the clangd_client source code.
<partial quote>
--- End quote ---
@ ollydbg
Copy the clangd_client.dll with the debugger symbols over the clangd_client that you're using and see if you get the clangd_client entries in the crash report.
This is beginning to make some sense. Clangd_client doesn't handle the "target deleted" event.
After the crash would you guys look to see if you have a C:\temp\CBclangd_client-xxxxx.log where xxxxxx can be determined by issuing command this command after the project is loaded but before replicating the crash:
--- Code: ---tasklist /nh /fi "IMAGENAME eq clangd*"
<Output from command>
clangd.exe 35008 Console 18 20,264 K
clangd.exe 27712 Console 18 566,080 K <----- xxxxxx is pid 27712 for me.
--- End code ---
The last entry produced by this command should be the appropriate xxxxx to identify the .log file.
Example logs:
--- Code: ---C:\temp\CBclangd_client-23724.log
C:\temp\CBclangd_client-27712.log <--------
C:\temp\CBclangd_client-29996.log
C:\temp\CBclangd_client-35008.log
C:\temp\CBclangd_client-35252.log
C:\temp\CBclangd_LogsIndex.txt
C:\temp\CBclangd_server-23724.log
C:\temp\CBclangd_server-35252.log
--- End code ---
Or, after loading the project issue the command:
--- Code: ---del c:\temp\CBclangd*.log
It will not delete open logs. It will remove unneeded logs.
c:\temp\CBclangd_client-17072.log
The process cannot access the file because it is being used by another process.
c:\temp\CBclangd_client-35008.log
The process cannot access the file because it is being used by another process.
--- End code ---
Pecan:
@ ollydbg and Andrew
Nerver mind. I caught the crash.
It's happening when clangd_client calls:
pProjectFile->GetBuildTargets();
in UpdateCompilationDatabase()
It's actually handing back a list of targets which contains the target I just deleted.
Gotta figure this one out...... >:(
ollydbg:
Hi, Pecan, good news that you find the reason.
About the call stack, I was using cb to debug cb, and I do have debug information in generated dll and exe files, which also includes the clangd_client in the devel folder.
My previous post contains call stack from gdb, but still no info from clangd_client. :(
Pecan:
Fixed in Head 12982.
Modified cbProject - Fix crash in MacrosManager using bad m_LastTarget pointer.
Modified RemoveBuildTarget() to reset MacrosManager pointers.
The macro manager stores pointers to projects and targets, so we need to clear it to prevent dangling pointer bugs
Edit: Added the comment and forgot to add the code.
Done again.
ollydbg:
--- Quote from: Pecan on October 18, 2022, 02:44:04 am ---Fixed in Head 12982.
Modified cbProject - Fix crash in MacrosManager using bad m_LastTarget pointer.
Modified RemoveBuildTarget() to reset MacrosManager pointers.
The macro manager stores pointers to projects and targets, so we need to clear it to prevent dangling pointer bugs
Edit: Added the comment and forgot to add the code.
Done again.
--- End quote ---
Hi, Pecan, thanks for the fix.
I can confirm that with the rev 12982, the crash issue is gone. :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version