Closed rpx99 closed 11 months ago
I'm sorry but I can't reproduce, I compiled Lem with the last commit, launch the editor and then call the command slime-self-connect
. Then enter the input that you provide, what it happens it that it goes into the debugger (which makes sense)
Hmm..strange. I'll try to find out more.
When LEM tries to start the debugger it seems to start another process. But there is an infinite loop that creates more and more threads / processes (?) in the background ?
At least it looks to me in htop like something like that is happening. That explains more and more resources are taken by the CPU.
Maybe we are using a different sdl2 version? That's quite an odd behaviour
tron$ doas pkg_info sdl2
Information for inst:sdl2-2.28.5
Comment: cross-platform multimedia library
Required by: ffmpeg-4.4.4p2v1 sdl2-image-2.6.3 sdl2-ttf-2.20.2p2
sbcl:
(:SDL2-TTF)
(:SDL2-IMAGE)
`
Only need to call
inspect
to make this happen:
Is it something like a null pointer in sdl2-ttf ?
Maybe the version is sdl2 is too high?
In my case, the output of the above command is:
CL-USER> (sdl2-ttf:linked-version)
2
0
15
CL-USER>
Okay, I find this symbol in src / lem / modeline.lisp:
(defun modeline-write-info (window) (let ((buffer (window-buffer window))) (cond ((buffer-read-only-p buffer) " 🔒 ") ((buffer-modified-p buffer) " * ") (t " "))))
There is a method:
(defmethod object-width ((drawing-object emoji-object) display) (* (display:display-char-width display) 2 (length (text-object-string drawing-object))))
in src / frontends / sdl2 / drawing.lisp
I wonder why it needs to get multiplied by the length of the text-object string of the drawing-object....
Suspect that it is 0...
I am at the right spot. If I replace the lock symbol in modeline with an ordinary Character the issue is gone and I get into the debugger. The replacement character is then shown in the modeline of the debugger.
Still looking into the real issue, i.e. why the lock symbol causes so much trouble...
Interesting! Thanks for doing the research, indeed this seems like a very specific sdl2 problem... I'm not that familiar with, so I'll ping @cxxxr so he maybe help in this error.
In html here it looks "ok", but when I see my screenshot the LOCK character does not look properly (like an additional space is used as a second symbol).
@Sasanidas What does this show on your system?
debugger invoked on a SDL2-TTF::SDL-TTF-ERROR in thread
SDL Error (#<SDL-SURFACE {#X00000000}>): Text has zero width
For me, it works correctly, it doesn't trigger any error:
CL-USER> (make-string 1 :initial-element #\GREEK_CAPITAL_LETTER_SIGMA)
"Σ"
CL-USER> (SDL2-TTF:RENDER-UTF8-BLENDED (sdl2-ttf:open-font #P"/home/fermin/quicklisp/local-projects/lem/frontends/sdl2/resources/fonts/NotoColorEmoji.ttf" 15) (make-string 1 :initial-element #\GREEK_CAPITAL_LETTER_SIGMA) 255 255 255 0)
#<SDL2-FFI:SDL-SURFACE {#X7F8ABC00F210}>
CL-USER> (make-string 1 :initial-element #\LOCK)
"🔒"
CL-USER> (SDL2-TTF:RENDER-UTF8-BLENDED (sdl2-ttf:open-font #P"/home/fermin/quicklisp/local-projects/lem/frontends/sdl2/resources/fonts/NotoColorEmoji.ttf" 15) (make-string 1 :initial-element #\LOCK) 255 255 255 0)
#<SDL2-FFI:SDL-SURFACE {#X7F8ABC009F00}>
(ignore the second line of t he screenshot, I just press enter with the path not fully changed)
Thanks a lot for testing!
A fresh installation with debian 12 works, too. Hmmm...
Hello,
I have the same problem as rpx99 :
When I entered the command, I got the same SDL error as well but it quickly disappeared, that's why it does not appear on the screenshot
SDL Error (#<SDL-SURFACE {#X00000000}>): Text has zero width
@badmrfrosty Yes, that is when you use this command. If you type in "inspect" it should get into a loop (You can abort with pressing q). Which OS do you have?
Yeah, more or less same behaviour but I had to kill the lem process (see pictures)
uname -r 6.6.7-arch1-1
CL-USER> (sdl2-ttf:linked-version) 2 20 2
Found out how to work around it on OpenBSD.
Followed this instructions on Reddit in order to recompile Xenocara.
Additionally I recompiled the SDL2-TTF port with added CONFIGURE_ARGS += --disable-freetype-builtin parameter in the Makefile.
Quite time consuming build process but at least a success...
* (SDL2-TTF:RENDER-UTF8-BLENDED (sdl2-ttf:open-font #P"/home/rpx/common-lisp/lem/frontends/sdl2/resources/fonts/NotoColorEmoji.ttf" 15) (make-string 1 :initial-element #\LOCK) 255 255 255 0)
#<SDL2-FFI:SDL-SURFACE {#XB3CB9A21960}>
I start a repl and enter:
(funcall (lambda (x) (+ x 100)) 2)
When I mistakenly miss the 2, i.e.
(funcall (lambda (x) (+ x 100)) )
the error occurs.
SDL Error (#SDL-SURFACE {#X00000000}>): Text h
LEM freezes "evaluating" and takes more and more CPU.