rabbibotton / clog

CLOG - The Common Lisp Omnificent GUI
Other
1.53k stars 106 forks source link

Once [Condition of type SB-INT:SIMPLE-PROGRAM-ERROR] I cannot get rid of it in Builder. #177

Closed aykaramba closed 2 years ago

aykaramba commented 2 years ago

Hi.

I am testing out dropping divs and other controls onto a panel, creating functions that change various properties of controls on the panel and then setting the on-click control events to call those functions.

I am running into a weird issue. Whenever I create a function that has the wrong number of arguments in it, the moment I trigger the [Condition of type SB-INT:SIMPLE-PROGRAM-ERROR] error I cannot get rid of it ever again. The only way to get rid of it is to delete ALL the panel .clog, .lisp, .back files, remove anything from the .asd file and delete all of my functions and restart the session from scratch loading up emacs, sly, the test app and then builder.

I have tried a number of permutations but I have no idea how to truly narrow it down. Effectively, it is FAR EASIER to just create a new app from scratch and create new panels than clean up the problem app. However, it doesn't take very long to trigger this issue. I could get a few functions perfect and everything works and the moment that I create one function that has the wrong number of arguments this issue is now there, it persists and I cannot really move forward testing and learning.

Here is a copy of the error:

invalid number of arguments: 1 [Condition of type SB-INT:SIMPLE-PROGRAM-ERROR]

Restarts: 0: [REPLACE-FUNCTION] Call a different function with the same arguments 1: [CALL-FORM] Call a different form 2: [ABORT] abort thread (#<THREAD "CLOG event handler p-CLOGB38671243564:mousedown" RUNNING {1006486203}>)

Backtrace: 0: (CLOG:COLOR #<CLOG:CLOG-LABEL {10072EFB83}>) [external] [No Locals] 1: ((LAMBDA (CLOG-TOOLS::CONTROL CLOG-TOOLS::TD1 CLOG-TOOLS::TD2) :IN "/home/***/common-lisp/clog/tools/clog-builder-settings.lisp") #<CLOG:CLOG-LABEL {10072EFB83}> # #<CLOG:CLOG-TAB.. Locals: CLOG-TOOLS::CONTROL = #<CLOG:CLOG-LABEL {10072EFB83}> CLOG-TOOLS::TD2 = #<CLOG:CLOG-TABLE-COLUMN {100662F153}> 2: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN CLOG-TOOLS::ON-POPULATE-CONTROL-PROPERTIES-WIN)) Locals: CLOG-TOOLS::CONTROL = #<CLOG:CLOG-LABEL {10072EFB83}> CLOG-TOOLS::PLACER = #<CLOG:CLOG-ELEMENT {10065A8A03}> CLOG-TOOLS::TABLE = #<CLOG:CLOG-TABLE {1007863C03}> CLOG-TOOLS::TD2 = #<CLOG:CLOG-TABLE-COLUMN {100662F153}> 3: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-THREAD::CALL-WITH-MUTEX)) Locals: GOT-IT = T MUTEX = #<SB-THREAD:MUTEX "Anonymous lock" owner: #<SB-THREAD:THREAD "CLOG event handler p-CLOGB38671243564:mousedown" RUNNING {1006486203}>> 4: (SB-THREAD::CALL-WITH-MUTEX #<FUNCTION (FLET SB-THREAD::WITH-MUTEX-THUNK :IN CLOG-TOOLS::ON-POPULATE-CONTROL-PROPERTIES-WIN) {7F5FC171E74B}> #<SB-THREAD:MUTEX "Anonymous lock" owner: #<SB-THREAD:THREA.. Locals: GOT-IT = T MUTEX = #<SB-THREAD:MUTEX "Anonymous lock" owner: #<SB-THREAD:THREAD "CLOG event handler p-CLOGB38671243564:mousedown" RUNNING {1006486203}>> SB-C::THING = #<FUNCTION (FLET SB-THREAD::WITH-MUTEX-THUNK :IN CLOG-TOOLS::ON-POPULATE-CONTROL-PROPERTIES-WIN) {7F5FC171E74B}> TIMEOUT = NIL WAITP = T 5: (CLOG-TOOLS::ON-POPULATE-CONTROL-PROPERTIES-WIN #<CLOG:CLOG-LABEL {10072EFB83}> :WIN NIL) Locals:

:.DEFAULTING-TEMP. = NIL

    OBJ = #<CLOG:CLOG-LABEL {10072EFB83}>

6: ((LAMBDA (CLOG:OBJ CLOG-TOOLS::DATA) :IN CLOG-TOOLS::SETUP-CONTROL) # (:EVENT-TYPE :MOUSE :X 25 :Y 15 ...)) Locals: CLOG-TOOLS::DATA = (:EVENT-TYPE :MOUSE :X 25 :Y 15 :SCREEN-X 3486 :SCREEN-Y 360 :WHICH-BUTTON 1 :ALT-KEY NIL :CTRL-KEY NIL :SHIFT-KEY NIL :META-KEY NIL :CLIENT-X 449 :CLIENT-Y 179 :PAGE-X 449 :PAGE-Y 179) 7: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS)) [No Locals] 8: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN)) [No Locals] Catch-tags: SB-THREAD::%RETURN-FROM-THREAD 9: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::RUN)) [No Locals] 10: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN)) [No Locals] Catch-tags: SB-THREAD::%ABORT-THREAD SB-IMPL::%END-OF-THE-WORLD SB-INT:TOPLEVEL-CATCHER 11: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::RUN)) [No Locals] 12: (SB-THREAD::RUN) [No Locals] 13: ("foreign function: call_into_lisp") [No Locals] 14: ("foreign function: funcall1") [No Locals]

The function that triggered it was:

(defun color (target panel) nil)

The onclick event that triggered it was:

(color target panel)

Any suggestions on whether or not this is an issue on my end or something on the CLOG side of things? I would be happy to perform testing to narrow this down if required, I just have no clue where this issue might lie.

Thanks.

aykaramba commented 2 years ago

I cannot replicate this issue now for some reason. No updates were done and nothing changed on the system. I suspect this may have been a user error. Will re-open if I can find a way to replicate the issue the way it was behaving yesterday.

I am going to close this issue for now.

aykaramba commented 2 years ago

Re-opening ticket once again. I had to create 20 controls on a panel before I could trigger it this time, yesterday it only took 3. So this is intermittent.

The trigger today was the following:

Function in .lisp file:

(defun color (target panel) (setf (background-color target) :teal))

Control event on image control: (color target panel)

All other controls before this one did not trigger the error and I was able to create different functions to control various properties of controls. Once the error is triggered, I end up in what looks like an endless loop selecing 2 to abort in sly and not being able to continue working.

Very strange.

rabbibotton commented 2 years ago

I will look at this soon, sorry, just finishing up the custom control tutorial

aykaramba commented 2 years ago

No probs at all. I am trying to make sure the issues are real and reproducable as best as I can. We don't want to waste any of your time.

rabbibotton commented 2 years ago

Try using a different function name than color. I have seen similar issues crop up when there are pre-existing methods with the same name and/or slot names in the same package and you end up redefining them with different arguments creating instability that requires shutting down the whole lisp image. If that doesn't end up solving issue re-open