Author Topic: codeblocks randomly crashes when writing  (Read 12284 times)

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
codeblocks randomly crashes when writing
« on: March 02, 2024, 10:27:11 pm »
i am using debian12.5 nighly version newly and now i am getting tired of codeblocks debug report problem,
this is what it looks like

i write some code and suddenly it says (debug report has been generated.
luckily the problem is able to reproduce.

i write cin then the code-completion shows me suggestions i click enter and everything is fine
but when i write cin without clicking enter
and then trying it again real fast the problem happens
i think this is related to code-completion

 

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks randomly crashes when writing
« Reply #1 on: March 02, 2024, 10:38:33 pm »
upd:
i disabled smart sense  from setting>>editor>>code-completion and it is working fine now,
i am wondering how to get code-completion working fine now

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2808
Re: codeblocks randomly crashes when writing
« Reply #2 on: March 03, 2024, 02:06:05 am »
What CodeBlocks version are you using.
What OS are you using?
Can you show us your code that causes the crash?

 

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks randomly crashes when writing
« Reply #3 on: March 05, 2024, 08:57:24 am »
i am currently using the lastest version on debian12.5 linux
it is not the code that caused the crash
it is writing it
while using SmartSense when i write "cout" without pressing enter
then writing "cout" again it crashes

but mostly when i write "ccin"  also it crashes

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks randomly crashes when writing
« Reply #4 on: March 06, 2024, 02:35:22 pm »
please help i am new to debian linux and trying to get something done
i don't know if my problem is  easy
i am using( svn build rev 13046 (2022-11-18 13:56:24) gcc 12.2.0 Linux/unicode - 64 bit )
i am on debian 12.5 linux
when i open a cpp file and write "ccin" without quotes it crashes saying (debug report)

the debug report contains this:

<?xml version="1.0" encoding="UTF-8"?>
<report version="1.0" kind="exception">
  <system description="Linux 6.1.0-18-amd64 x86_64"/>
  <modules>
    <module path="[heap]" address="0x5642aafa2000" size="0x27ea000"/>
    <module path="/memfd:gdk-wayland" address="0x7f78b20f8000" size="0x7ad000"/>
    <module path="/memfd:gdk-wayland" address="0x7f78b30a6000" size="0x7ad000"/>
    <module path="/memfd:gdk-wayland" address="0x7f78cb728000" size="0x8000"/>
    <module path="/memfd:wayland-cursor" address="0x7f78e0cdc000" size="0x120000"/>
    <module path="/run/user/1000/dconf/user" address="0x7f78e708f000" size="0x1000"/>
    <module path="[stack]" address="0x7ffeb6945000" size="0x21000"/>
  </modules>
  <stack>
    <frame level="0" offset="0xb7c3c" address="0x5642aa824c3c" module="codeblocks"/>
    <frame level="1" offset="0x1da860" address="0x7f78e57da860" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="2" offset="0x3c050" address="0x7f78e425b050" module="/lib/x86_64-linux-gnu/libc.so.6"/>
  </stack>
</report>

when i write "cin" without pressing enter to autocomplete
then write "ccin" it crashes
please  i can't work on any other text editor and this crash i game changing for me




Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
Re: codeblocks randomly crashes when writing
« Reply #5 on: March 06, 2024, 09:53:55 pm »
Are you using this work around for Wayland?
https://forums.codeblocks.org/index.php/topic,25206.msg171903.html#msg171903

As workaround I 'm launching codeblocks in wayland session  with
Code
[luca@archer ~]$  GDK_BACKEND=x11 codeblocks
It seems the problem is related to wayland session, in X session there is not error.

If not try it.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks randomly crashes when writing
« Reply #6 on: March 07, 2024, 01:17:59 pm »
it didn't work

but it gave a bit of help
it is now more flexible to that issue
but i can still make it happen

the debug report is as following

<?xml version="1.0" encoding="UTF-8"?>
<report version="1.0" kind="exception">
  <system description="Linux 6.1.0-18-amd64 x86_64"/>
  <modules>
    <module path="[heap]" address="0x559aa084a000" size="0x2f7d000"/>
    <module path="/SYSV00000000" address="0x7fd4e25fd000" size="0x800000"/>
    <module path="/run/user/1000/dconf/user" address="0x7fd5003e1000" size="0x1000"/>
    <module path="[stack]" address="0x7fff4a641000" size="0x22000"/>
  </modules>
  <stack>
    <frame level="0" offset="0xb7c3c" address="0x559aa0579c3c" module="codeblocks"/>
    <frame level="1" offset="0x1da860" address="0x7fd506fda860" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="2" offset="0x3c050" address="0x7fd505a5b050" module="/lib/x86_64-linux-gnu/libc.so.6"/>
    <frame level="3" function="wxSCIListBoxWin::OnSize(wxSizeEvent&amp;)" offset="0xa6" address="0x7fd5083c8bb6" module="/lib/libcodeblocks.so.0"/>
    <frame level="4" function="wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&amp;, wxEvtHandler*, wxEvent&amp;)" offset="0x72" address="0x7fd5070086d2" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="5" function="wxEventHashTable::HandleEvent(wxEvent&amp;, wxEvtHandler*)" offset="0xdb" address="0x7fd50700888b" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="6" function="wxEvtHandler::TryHereOnly(wxEvent&amp;)" offset="0x49" address="0x7fd507008ea9" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="7" function="wxEvtHandler::ProcessEventLocally(wxEvent&amp;)" offset="0x2a" address="0x7fd507008f2a" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="8" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="0xc1" address="0x7fd507009031" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="9" function="wxEvtHandler::SafelyProcessEvent(wxEvent&amp;)" offset="0x7" address="0x7fd50700a7c7" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="10" function="wxWindowBase::SendSizeEvent(int)" offset="0x113" address="0x7fd507771953" module="/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0"/>
    <frame level="11" offset="0x393670" address="0x7fd507593670" module="/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0"/>
    <frame level="12" function="g_closure_invoke" offset="0x160" address="0x7fd506c4a3b0" module="/lib/x86_64-linux-gnu/libgobject-2.0.so.0"/>
    <frame level="13" offset="0x29344" address="0x7fd506c5d344" module="/lib/x86_64-linux-gnu/libgobject-2.0.so.0"/>
    <frame level="14" function="g_signal_emit_valist" offset="0xf35" address="0x7fd506c63bf5" module="/lib/x86_64-linux-gnu/libgobject-2.0.so.0"/>
    <frame level="15" function="g_signal_emit" offset="0x8f" address="0x7fd506c63dbf" module="/lib/x86_64-linux-gnu/libgobject-2.0.so.0"/>
    <frame level="16" offset="0x452ed" address="0x7fd50713b2ed" module="/lib/x86_64-linux-gnu/libgdk-3.so.0"/>
    <frame level="17" offset="0x317e7" address="0x7fd5071277e7" module="/lib/x86_64-linux-gnu/libgdk-3.so.0"/>
    <frame level="18" offset="0x5519a" address="0x7fd50601b19a" module="/lib/x86_64-linux-gnu/libglib-2.0.so.0"/>
    <frame level="19" function="g_main_context_dispatch" offset="0x16f" address="0x7fd50601a67f" module="/lib/x86_64-linux-gnu/libglib-2.0.so.0"/>
    <frame level="20" offset="0x54a38" address="0x7fd50601aa38" module="/lib/x86_64-linux-gnu/libglib-2.0.so.0"/>
    <frame level="21" function="g_main_loop_run" offset="0x6f" address="0x7fd50601acef" module="/lib/x86_64-linux-gnu/libglib-2.0.so.0"/>
    <frame level="22" function="gtk_main" offset="0x75" address="0x7fd506608495" module="/lib/x86_64-linux-gnu/libgtk-3.so.0"/>
    <frame level="23" function="wxGUIEventLoop::DoRun()" offset="0x25" address="0x7fd50756df85" module="/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0"/>
    <frame level="24" function="wxEventLoopBase::Run()" offset="0x2d" address="0x7fd506ed7fad" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="25" function="wxAppConsoleBase::MainLoop()" offset="0x7b" address="0x7fd506ea2a9b" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="26" offset="0xb7b8c" address="0x559aa0579b8c" module="codeblocks"/>
    <frame level="27" function="wxEntry(int&amp;, wchar_t**)" offset="0x47" address="0x7fd506f1fec7" module="/lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0"/>
    <frame level="28" offset="0x9b27e" address="0x559aa055d27e" module="codeblocks"/>
    <frame level="29" offset="0x2724a" address="0x7fd505a4624a" module="/lib/x86_64-linux-gnu/libc.so.6"/>
    <frame level="30" function="__libc_start_main" offset="0x85" address="0x7fd505a46305" module="/lib/x86_64-linux-gnu/libc.so.6"/>
    <frame level="31" offset="0xadd31" address="0x559aa056fd31" module="codeblocks"/>
  </stack>
</report>

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: codeblocks randomly crashes when writing
« Reply #7 on: March 07, 2024, 01:53:18 pm »
Something related to the wxScintilla control, because I see something here:

Code
wxSCIListBoxWin::OnSize(wxSizeEvent&amp;)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2808
Re: codeblocks randomly crashes when writing
« Reply #8 on: March 07, 2024, 06:09:52 pm »
Something related to the wxScintilla control, because I see something here:

Code
wxSCIListBoxWin::OnSize(wxSizeEvent&amp;)

That looks llke the same error I fixed in rev 13473. It's caused by gtk3 issuing an OnSize() event that the original author (of our version of wxScintilla) did not expect.

The original author does not delete the codecompletion suggestion windows, but posts them to wxPendingDelete() queue instead. So there's no telling when the window(s) get deleted. Documentation says wxPendingDelete queue is run on the next available time. Who knows. I suspect either onIdle() or onYield(). Very dangerous. God-only-knows when the windows get freed.

The OnSize() code attempts to ask the ListWindow for an icon width, but the window evidently has already been freed.

The fix in cb rev 13473 cached the icon size so subsequent access to the window(s) pointer was no longer necessary.

The OP will need to update to at least rev 13473 to avoid this crash.

Edit: or maybe use one of the Linux's build for the nightly build.
https://forums.codeblocks.org/index.php/board,20.0.html

« Last Edit: March 08, 2024, 05:39:42 pm by Pecan »

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks randomly crashes when writing
« Reply #9 on: March 09, 2024, 01:30:29 pm »
i am using debian
i don't know why but the last version of codeblocks from apt is causing the crash
is there anyway to install  an updated version for me?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
Re: codeblocks randomly crashes when writing
« Reply #10 on: March 09, 2024, 06:10:10 pm »
i am using debian
i don't know why but the last version of codeblocks from apt is causing the crash
is there anyway to install  an updated version for me?

Report the problem and the fix to the Debian team and ask them to up date the package in sid.
Then install the updated sid package.

Edit: You should try the sid package before reporting the problem to the Debian team.

Tim S.
« Last Edit: March 09, 2024, 07:32:11 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks randomly crashes when writing
« Reply #11 on: March 09, 2024, 10:50:35 pm »
that's not what i meant
it would take ages to fix this for them

sorry for the inconvenience  i am newbie at linux and trying to get used
is there a simple way to install codeblocks without using apt ???

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks randomly crashes when writing
« Reply #12 on: March 09, 2024, 11:14:19 pm »
i sent issue info to debian team hope it gets fixed quickly

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BomberKing

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks randomly crashes when writing
« Reply #14 on: March 10, 2024, 04:08:15 pm »
i think my issue is closed at this point ,
thank you all for helping ! ;D