CudaText: Cud freezes on startup with Terminal+ / GitStatus
OS: Windows 11 x64
i’m debugging like crazy and finally coming closer to what is happening with strange occasional freezes on Cuda’s start. ( i wrote about it here https://github.com/CudaText-addons/cuda_git_status/issues/38 )
it is hard to reproduce but i’ve found that Cuda hangs when this line is executed:
ed.decor(DECOR_SET, line=l, tag=DIFF_TAG, text='', color=MY_DECOR_COLOR)
or this one:
ed.decor(DECOR_SET, line=line__, tag=DIFF_TAG, text='', color=MY_DECOR_COLOR)
( it’s inside cuda_git_status/git_manager.py
file, diff
procedure. )
to make them execute AND FREEZE Cuda we need some preconditions. they may not be required for reproducing, but they will increase the chance:
- install cuda_git_status (obviously).
- install Terminal+ (make it floating window; activate its button, so it will reappear on Cuda’s start automatically; set shell to cmd.exe)
- set ui_reopen_session = true, so files can reopen automatically
- open some file (inside some git repository) and change something in it. (this will trigger ed.decor lines inside diff proc!) now restart Cuda 10-20 times. if you are lucky, you will catch freeze.
now to some screenshots and debugging results. i had to install fpc+lazarus to step into pascal domain. I was too curious.
cuda_git_status/git_manager.py
,diff
procedure
frommain_py_api.inc
, functionapi_ed_decor
atsynedit.pas
,Update
procedure
atsynedit.pas
,UpdateCursor
procedure
control.inc
, …
- then
WndProc
, theninherited WndProc(message);
, and finallyDispatch(TheMessage);
after all of this i tried to comment out following lines in hope that it will eliminate freeze and it did! but now mouse cursor is not changing to i-beam obviously:
From here I can’t do anything more. Asking you, @Alexey-T to say what you think and how we can make this work. i’m thinking of making these lines thread-safe somehow and building test version for me so i can try to reproduce it again with thread-safe facilities turned on.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 47 (46 by maintainers)
Commits related to this issue
- change on_timer from https://github.com/Alexey-T/CudaText/issues/4153#issuecomment-1140174345 — committed to CudaText-addons/cuda_git_status by Alexey-T 2 years ago
Standard GDB
C:\fpcupdeluxe\fpcupdeluxe\fpcbootstrap\gdb\$(TargetCPU)-$(TargetOS)\gdb.exe
I see the freeze. even w/out TErminal+ activated.
Hint for you:
I guess i must stop timer ticks until some initing is done