Closed ghost closed 1 year ago
I cannot repeat it on last version, both gtk2 and qt5. I removed 'settings' folder and run app 2 times (one_instance is true). second run with a file parameter. parameter was passed to 1st instance OK.
Can you check on another PC?
The cudatext used is built from source. When I compare the ldd output for this executable and a downloaded one, the downloaded one has these enties extra:
libpthread.so.0 /usr/lib/libpthread.so.0 libdl.so.2 /usr/lib/libdl.so.2 The rest is identical.
Version of fpc is 3.2.2 and lazarus 2.2.4.
Do any build/link flags have to be set?
Some flags are wrong on your IDE but I dont have idea which. threads-lib is always used on Linux
{$IFDEF UNIX}
cthreads,
{$ENDIF}
It's a batch install that installs lazarus and fpc in a clean chroot. For lazarus no options are set. For fpc only -Fl and -Fu The actual build is done with cudaup.sh -m -w qt5 -o Linux Where should I check for the IDE flags being set/used?
try to update your system. what glibc/musl version do you have?
It's a rolling distro - archi derivative - so up to date. glibc is version 2.37
maybe this will help:
https://wiki.lazarus.freepascal.org/Qt5_Interface#Systems_using_Wayland (also check libQt5Pas version.)
Thank you for the suggestion. I don't use Wayland nor gnome, just qt5 on xorg.
No matter what I try, these keep missing: libpthread.so.0 /usr/lib/libpthread.so.0 libdl.so.2 /usr/lib/libdl.so.2
I added -dUseCThreads to the fpc cfg and also modified {$IFDEF UNIX}cthreads,{$ENDIF} to cthreads, in cudatext.lpr, but that also does not help.
Do these files exist on your PC? libpthread.so.0 /usr/lib/libpthread.so.0 libdl.so.2 /usr/lib/libdl.so.2
Yes, both do exist : -rwxr-xr-x 1 root root 14416 Feb 3 23:43 /usr/lib/libdl.so.2 -rwxr-xr-x 1 root root 14424 Feb 3 23:43 /usr/lib/libpthread.so.0
I tried every fpc and lazarus flag I could find to have libdl.so libpthread.so linked into the cudatext executable but no luck so far. Is there any way to force this?
What does your comment mean, @z4ziggy ?
@Alexey-T This is the cause for the EAccessViolation
I cannot see the repro here, so I won't remove this line.
you shouldn't remove this line as it will cause a memory leak. Someone who cares for this editor should fix it. I don't have the time.
I should not react to such posts, where only line of code is given
Thx for the suggestion. I tested with a patch removing line 4054 in proc_globdata.pas and it does indeed prevent the error. To prevent a memory leak the statement should be present but executed only conditionally. Question is, on what condition?
I added the conditions cudatext is not setup for single instance, or not running already. That seems to work OK.
Applied the fix from @z4ziggy
Tested with fix; no more errors. Thx!
Related FPC bug: https://gitlab.com/freepascal.org/fpc/source/-/issues/40276
Error occurs with any recent version in cudatext-qt5, at least 1.189.x - 1.192.x:
Eg running: $ cudatext readme.txt Does open the file but also throws error [FORMS.PP] ExceptionOccurred Sender=EAccessViolation Exception=Access violation Stack trace: $00000000004301F1 $000000000052E7D1 $000000000052E777 $000000000052F54B $0000000000435C8B $000000000043A517 Exception at 00000000004301F1: EAccessViolation: Access violation.
There is no error when running: cudatext -n readme.txt
What does this error indicate?
Thank you in advance.