rabbibotton / clog

CLOG - The Common Lisp Omnificent GUI
Other
1.48k stars 101 forks source link

Clog gui-app runs fine from repl, but throws join-thread-error when trying to run from executable. #304

Closed sabracrolleton closed 10 months ago

sabracrolleton commented 10 months ago

My clog application runs fine from the repl, but when I try to create an executable and run that, it throws an error sb-thread:join-thread-error. I am going to assume that the error is mine since I have never tried to create an executable before this and I am just blindly following the https://lispcookbook.github.io/cl-cookbook/scripting.html recipes. I have used both sb-ext:save-lisp-and-die and deploy. I am using sbcl 2.3.7 on linux.

Any pointers would be appreciated. Both sets of executables generate the same error:

Hunchentoot server is started. Listening on 0.0.0.0:8080. HTTP listening on : 0.0.0.0:8080 HTML root : /home/sabra/quicklisp/local-projects/postmodern-kitsch/www/ Long poll first : no Boot function added : no Boot html source use : compiled version, when no file Boot js source use : compiled version Boot file for path / : /boot.html Unhandled SB-THREAD:JOIN-THREAD-ERROR in thread #<SB-THREAD:THREAD tid=1636070 "clack-handler-hunchentoot" RUNNING {1005F8FDF3}>: Joining thread failed: thread #<THREAD "hunchentoot-listener-0.0.0.0:8080" ABORTED {1006881B23}> did not return normally.

Backtrace for: #<SB-THREAD:THREAD tid=1636070 "clack-handler-hunchentoot" RUNNING {1005F8FDF3}> 0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SB-THREAD:JOIN-THREAD-ERROR {1006CFF2C3}> # :QUIT NIL) 1: ((LAMBDA (SB-THREAD::C SB-THREAD::H) :IN SB-THREAD::%EXIT-OTHER-THREADS) #<SB-THREAD:JOIN-THREAD-ERROR {1006CFF2C3}> #<FUNCTION (LAMBDA (SB-THREAD::C SB-THREAD::H) :IN SB-THREAD::%EXIT-OTHER-THREADS) {5338186B}>) 2: (SB-DEBUG::RUN-HOOK INVOKE-DEBUGGER-HOOK #<SB-THREAD:JOIN-THREAD-ERROR {1006CFF2C3}>) 3: (INVOKE-DEBUGGER #<SB-THREAD:JOIN-THREAD-ERROR {1006CFF2C3}>) 4: (ERROR SB-THREAD:JOIN-THREAD-ERROR :THREAD #<SB-THREAD:THREAD "hunchentoot-listener-0.0.0.0:8080" ABORTED {1006881B23}> :PROBLEM :ABORT) 5: (SB-THREAD:JOIN-THREAD #<SB-THREAD:THREAD "hunchentoot-listener-0.0.0.0:8080" ABORTED {1006881B23}> :DEFAULT NIL :TIMEOUT NIL) 6: ((:METHOD HUNCHENTOOT:SHUTDOWN (HUNCHENTOOT:ONE-THREAD-PER-CONNECTION-TASKMASTER)) #<HUNCHENTOOT:ONE-THREAD-PER-CONNECTION-TASKMASTER {10064067B3}>) [fast-method] 7: ((:METHOD HUNCHENTOOT:STOP (HUNCHENTOOT:ACCEPTOR)) #<CLACK.HANDLER.HUNCHENTOOT::CLACK-ACCEPTOR (host 0.0.0.0, port 8080)> :SOFT NIL) [fast-method] 8: ((FLET "CLEANUP-FUN-3" :IN CLACK.HANDLER.HUNCHENTOOT:RUN)) [cleanup] 9: (CLACK.HANDLER.HUNCHENTOOT:RUN #<FUNCTION (LAMBDA (LACK.MIDDLEWARE.BACKTRACE::ENV) :IN "/home/sabra/quicklisp/dists/quicklisp/software/lack-20230618-git/src/middleware/backtrace.lisp") {10053DFE5B}> :ALLOW-OTHER-KEYS T :ADDRESS "0.0.0.0" :PORT 8080 :DEBUG T :USE-THREAD T :ADDRESS "0.0.0.0") 10: ((LABELS BORDEAUX-THREADS::%BINDING-DEFAULT-SPECIALS-WRAPPER :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS)) 11: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN)) 12: ((FLET "WITHOUT-INTERRUPTS-BODY-174" :IN SB-THREAD::RUN)) 13: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN)) 14: ((FLET "WITHOUT-INTERRUPTS-BODY-167" :IN SB-THREAD::RUN)) 15: (SB-THREAD::RUN) 16: ("foreign function: call_intolisp")

unhandled condition in --disable-debugger mode, quitting

aykaramba commented 10 months ago

Have you looked at this thread? Link: https://github.com/rabbibotton/clog/discussions/74

I ran into something similar originally, if I understood your descriptions correctly. It required dumping the image in a way that is aware of how to deal with open threads. I use the info from that thread to dump my images to an executable, which with CLOG is really kind of fun to have a web app to carry around like that.

sabracrolleton commented 10 months ago

Thank you! This did resolve the issue.