Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on Mojave, on Big Sur: ccl-1.12 build-application generates a kernel without a saved image. #344

Open
informatimago opened this issue Sep 2, 2020 · 8 comments

Comments

@informatimago
Copy link

On Catalina: build-application generates an executable image, as expected:

$ ssh despina ls -l ~/Desktop/patchwork-10.1-0.597-ccl-1.12_dev_v1.12_dev.4_8_gf4a517fc_darwinx8664-darwin-apple-10.15.6-x86-64/Patchwork.app/Contents/MacOS/Patchwork
-rwxr-xr-x 1 pjb staff 109187312 Jul 24 23:48 /Users/pjb/Desktop/patchwork-10.1-0.597-ccl-1.12_dev_v1.12_dev.4_8_gf4a517fc_darwinx8664-darwin-apple-10.15.6-x86-64/Patchwork.app/Contents/MacOS/Patchwork*

On Mojave build-application generates a kernel without the image:

$ ssh larissa ls -l /Users/pjb/Desktop/patchwork-10.1-0.593-ccl-1.12_v1.12_32_g8778079b_darwinx8664-darwin-apple-10.14.6-x86-64/Patchwork.app/Contents/MacOS/Patchwork
-rwxr-xr-x 1 pjb staff 377620 Sep 2 08:25 /Users/pjb/Desktop/patchwork-10.1-0.593-ccl-1.12_v1.12_32_g8778079b_darwinx8664-darwin-apple-10.14.6-x86-64/Patchwork.app/Contents/MacOS/Patchwork
$ ssh larissa /Users/pjb/Desktop/patchwork-10.1-0.593-ccl-1.12_v1.12_32_g8778079b_darwinx8664-darwin-apple-10.14.6-x86-64/Patchwork.app/Contents/MacOS/Patchwork
Couldn't load lisp heap image from /Users/pjb/Desktop/patchwork-10.1-0.593-ccl-1.12_v1.12_32_g8778079b_darwinx8664-darwin-apple-10.14.6-x86-64/Patchwork.app/Contents/MacOS/../Resources/ccl/Patchwork.image: No such file or directory

The release ccl-1.12 has been compiled with Xcode 10.3 on Mojave.

@informatimago
Copy link
Author

The same still occurs on Big Sur with the latest git!

$ ccl -n
Clozure Common Lisp Version 1.12 (v1.12-39-g6c1a9458) DarwinX8664

For more information about CCL, please see http://ccl.clozure.com.

CCL is free software.  It is distributed under the terms of the Apache
Licence, Version 2.0.
? (require :build-application)
;Loading #P"ccl:mac-ui;fasls;cf-utils.dx64fsl.newest"...
;Loading #P"ccl:mac-ui;fasls;libdispatch.dx64fsl.newest"...
;Loading #P"ccl:mac-ui;fasls;ccl-application.dx64fsl.newest"...
;Loading #P"ccl:mac-ui;fasls;event-process.dx64fsl.newest"...
;Loading #P"ccl:mac-ui;fasls;cg.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;constants.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;ide-application.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-utils.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-defaults.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-typeout.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;console-window.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;console-log.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-window.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-doc.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;compile-hemlock.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;hemlock.dx64fsl.newest"...
;;; Compiling Hemlock ...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/package.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;package.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/hemlock-ext.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;hemlock-ext.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/decls.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;decls.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/struct.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;struct.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/charmacs.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;charmacs.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/key-event.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;key-event.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/keysym-defs.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;keysym-defs.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/cocoa-hemlock.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;cocoa-hemlock.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/rompsite.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;rompsite.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/macros.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;macros.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/views.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;views.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/line.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;line.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/ring.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;ring.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/vars.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;vars.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/interp.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;interp.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/syntax.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;syntax.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/htext1.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;htext1.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/buffer.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;buffer.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/charprops.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;charprops.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/htext2.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;htext2.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/htext3.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;htext3.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/htext4.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;htext4.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/files.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;files.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/search1.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;search1.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/search2.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;search2.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/table.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;table.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/modeline.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;modeline.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/pop-up-stream.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;pop-up-stream.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/font.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;font.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/streams.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;streams.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/main.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;main.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/echo.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;echo.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/echocoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;echocoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/command.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;command.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/indent.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;indent.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/morecoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;morecoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/undo.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;undo.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/killcoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;killcoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/searchcoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;searchcoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/isearchcoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;isearchcoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/filecoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;filecoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/doccoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;doccoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/fill.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;fill.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/text.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;text.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/lispmode.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;lispmode.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/listener.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;listener.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/comments.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;comments.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/defsyn.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;defsyn.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/edit-defs.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;edit-defs.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/register.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;register.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/completion.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;completion.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/symbol-completion.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;symbol-completion.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/bindings.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;bindings.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-git/cocoa-ide/hemlock/src/display.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;display.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-editor.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-listener.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-grep.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-backtrace.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;inspector.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;cocoa-remote-lisp.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;preferences-views.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;preferences.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;processes-window.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;apropos-window.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;xapropos.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;hemlock-commands.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;file-dialogs.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;menus.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;app-delegate.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;ide-self-update.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;search-files.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;start.dx64fsl.newest"...
;Loading #P"ccl:cocoa-ide;fasls;xinspector.dx64fsl.newest"...
:BUILD-APPLICATION
("IDE-BUNDLE" "OBJC-PACKAGE" "SEQUENCE-UTILS" "NAME-TRANSLATION" "OBJC-CLOS" "OBJC-RUNTIME" "BRIDGE" "OBJC-SUPPORT" "COMPILE-HEMLOCK" "HEMLOCK" "COCOA" "BUILDER-UTILITIES" "BUILD-APPLICATION")
? 2021-05-31 13:51:38.612 dx86cl64[40123:12388431] +[NSSavePanel _warmUp] attempted warmup
(ccl::build-application :name "Foo"
                        :directory (merge-pathnames #P"Desktop/" (user-homedir-pathname))
                        :copy-ide-resources t)

$ ls -l ~/Desktop/Foo.app/Contents/MacOS/
total 356
drwxr-xr-x 3 pjb staff     96 May 31 13:52 ./
drwxr-xr-x 6 pjb staff    192 May 31 13:52 ../
-rwxr-xr-x 1 pjb staff 361424 May 31 13:52 Foo*

$ ~/Desktop/Foo.app/Contents/MacOS/Foo
Couldn't load lisp heap image from /Users/pjb/Desktop/Foo.app/Contents/MacOS/../Resources/ccl/Foo.image: No such file or directory

$ 

@informatimago
Copy link
Author

informatimago commented May 31, 2021

The problem seems to be in ccl:save-application, since this:

      (ccl:save-application (merge-pathnames name directory)
                            :toplevel-function nil
			                :init-file nil
                            :error-handler nil
                            :application-class application-class-name
			                :clear-clos-caches t
			                :mode #o755
			                :prepend-kernel t)

produce the same executable without an image.

It's the same if we s/:prepend-kernel/:native/
And the same with the HEAD 596fdac.

@informatimago
Copy link
Author

Now, setting a break point on save_application in image.c, and calling ccl:save-application, leads to the creation of the executable with the kernel, but save_application is NOT called!

@informatimago
Copy link
Author

Tracing ccl::%save-application ccl::save-application shows that ccl::%save-application is not called.

[pjb@despina org.xquartz:0 ccl-pjb-debug 14Gi]$ PATH=/usr/bin:/usr/sbin:/bin:/sbin ./dx86cl64 -n
Clozure Common Lisp Version 1.12.1 (v1.12.1-7-g4912320e) DarwinX8664

For more information about CCL, please see http://ccl.clozure.com.

CCL is free software.  It is distributed under the terms of the Apache
Licence, Version 2.0.
? (trace ccl::%save-application ccl::save-application)
NIL
? (require :build-application)
;Compiling "/usr/local/src/ccl-pjb-debug/mac-ui/cf-utils.lisp"...
;Loading #P"ccl:mac-ui;fasls;cf-utils.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/mac-ui/libdispatch.lisp"...
;Loading #P"ccl:mac-ui;fasls;libdispatch.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/mac-ui/ccl-application.lisp"...
;Loading #P"ccl:mac-ui;fasls;ccl-application.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/mac-ui/event-process.lisp"...
;Loading #P"ccl:mac-ui;fasls;event-process.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/mac-ui/cg.lisp"...
;Loading #P"ccl:mac-ui;fasls;cg.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/constants.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/constants.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/ide-application.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/ide-application.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-utils.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-utils.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-defaults.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-defaults.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-typeout.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-typeout.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/console-window.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/console-window.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/console-log.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/console-log.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-window.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-window.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-doc.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-doc.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/compile-hemlock.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/compile-hemlock.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/hemlock.dx64fsl"...
;;; Compiling Hemlock ...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/package.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;package.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/hemlock-ext.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;hemlock-ext.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/decls.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;decls.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/struct.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;struct.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/charmacs.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;charmacs.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/key-event.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;key-event.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/keysym-defs.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;keysym-defs.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/cocoa-hemlock.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;cocoa-hemlock.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/rompsite.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;rompsite.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/macros.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;macros.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/views.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;views.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/line.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;line.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/ring.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;ring.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/vars.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;vars.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/interp.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;interp.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/syntax.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;syntax.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/htext1.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;htext1.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/buffer.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;buffer.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/charprops.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;charprops.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/htext2.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;htext2.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/htext3.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;htext3.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/htext4.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;htext4.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/files.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;files.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/search1.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;search1.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/search2.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;search2.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/table.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;table.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/modeline.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;modeline.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/pop-up-stream.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;pop-up-stream.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/font.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;font.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/streams.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;streams.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/main.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;main.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/echo.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;echo.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/echocoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;echocoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/command.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;command.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/indent.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;indent.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/morecoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;morecoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/undo.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;undo.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/killcoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;killcoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/searchcoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;searchcoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/isearchcoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;isearchcoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/filecoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;filecoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/doccoms.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;doccoms.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/fill.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;fill.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/text.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;text.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/lispmode.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;lispmode.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/listener.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;listener.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/comments.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;comments.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/defsyn.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;defsyn.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/edit-defs.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;edit-defs.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/register.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;register.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/completion.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;completion.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/symbol-completion.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;symbol-completion.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/bindings.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;bindings.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock/src/display.lisp"...
;Loading #P"ccl:cocoa-ide;hemlock;bin;openmcl;display.dx64fsl.newest"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-editor.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-editor.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-listener.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-listener.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-grep.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-grep.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-backtrace.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-backtrace.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/inspector.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/inspector.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/cocoa-remote-lisp.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/cocoa-remote-lisp.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/preferences-views.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/preferences-views.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/preferences.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/preferences.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/processes-window.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/processes-window.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/apropos-window.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/apropos-window.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/xapropos.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/xapropos.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/hemlock-commands.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/hemlock-commands.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/file-dialogs.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/file-dialogs.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/menus.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/menus.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/app-delegate.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/app-delegate.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/ide-self-update.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/ide-self-update.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/search-files.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/search-files.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/start.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/start.dx64fsl"...
;Compiling "/usr/local/src/ccl-pjb-debug/cocoa-ide/xinspector.lisp"...
;Loading #P"/usr/local/src/ccl-pjb-debug/cocoa-ide/fasls/xinspector.dx64fsl"...
:BUILD-APPLICATION
("IDE-BUNDLE" "OBJC-PACKAGE" "SEQUENCE-UTILS" "NAME-TRANSLATION" "OBJC-CLOS" "OBJC-RUNTIME" "BRIDGE" "OBJC-SUPPORT" "COMPILE-HEMLOCK" "HEMLOCK" "COCOA" "BUILDER-UTILITIES" "BUILD-APPLICATION")
? 2021-06-01 11:10:19.805 dx86cl64[13787:13264083] +[NSSavePanel _warmUp] attempted warmup
1
1
? (ccl:save-application #P"~/Desktop/Bar"
                      :toplevel-function nil
		      :init-file nil
                      :error-handler nil
                      :application-class 'gui::cocoa-ide
		      :clear-clos-caches t
		      :mode #o755
		      :prepend-kernel t)
0> Calling (SAVE-APPLICATION #P"/Users/pjb/Desktop/Bar" :TOPLEVEL-FUNCTION NIL :INIT-FILE NIL :ERROR-HANDLER NIL :APPLICATION-CLASS GUI::COCOA-IDE :CLEAR-CLOS-CACHES T :MODE 493 :PREPEND-KERNEL T) 

[pjb@despina org.xquartz:0 ccl-pjb-debug 14Gi]$ 

@informatimago
Copy link
Author

informatimago commented Jun 1, 2021

It looks like toplevel is not called after %set-toplevel in process-exit-application. Could killing the tty process have an impact on the saving process?

[pjb@despina org.xquartz:0 ccl-pjb-debug 14Gi]$ PATH=/usr/bin:/usr/sbin:/bin:/sbin ./dx86cl64 -n
Clozure Common Lisp Version 1.12.1 (v1.12.1-7-g4912320e) DarwinX8664

For more information about CCL, please see http://ccl.clozure.com.

CCL is free software.  It is distributed under the terms of the Apache
Licence, Version 2.0.
? (defparameter *output* (with-output-to-string (*standard-output*) (let ((*trace-output* *standard-output*))  (require :build-application))))
*OUTPUT*
2021-06-01 11:21:06.169 dx86cl64[14311:13273363] +[NSSavePanel _warmUp] attempted warmup
? (trace ccl::toplevel ccl::%set-toplevel ccl::%save-application ccl::save-application ccl::%save-application-internal ccl::process-kill ccl::process-interrupt ccl::process-exit-application ccl::open-dumplisp-file ccl::toplevel-function ccl::make-mcl-listener-process ccl::make-application-error-handler ccl::clear-clos-caches ccl::save-image)
NIL
? (ccl:save-application #P"~/Desktop/Bar"
                      :toplevel-function nil
		      :init-file nil
                      :error-handler nil
                      :application-class 'gui::cocoa-ide
		      :clear-clos-caches t
		      :mode #o755
		      :prepend-kernel t)
0> Calling (SAVE-APPLICATION #P"/Users/pjb/Desktop/Bar" :TOPLEVEL-FUNCTION NIL :INIT-FILE NIL :ERROR-HANDLER NIL :APPLICATION-CLASS GUI::COCOA-IDE :CLEAR-CLOS-CACHES T :MODE 493 :PREPEND-KERNEL T) 
 1> Calling (CCL::OPEN-DUMPLISP-FILE #P"/Users/pjb/Desktop/Bar" :MODE 493 :PREPEND-KERNEL T) 
 <1 CCL::OPEN-DUMPLISP-FILE returned 26
 1> Calling (PROCESS-INTERRUPT #<APPKIT-PROCESS Initial(0) [Reset] #x3020000B30ED> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x302002254BFF>) 
 <1 PROCESS-INTERRUPT returned NIL
 1> Calling (PROCESS-KILL #<TTY-LISTENER listener(1) [Active] #x30200043B84D>) 
  2> Calling (PROCESS-INTERRUPT #<TTY-LISTENER listener(1) [Active] #x30200043B84D> 
0> Calling (CCL::PROCESS-EXIT-APPLICATION #<APPKIT-PROCESS Initial(0) [Reset] #x3020000B30ED> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x3020020BFF7F>) 
 1> Calling (%SET-TOPLEVEL #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION#<) Compiled-function #x3020020BFF7F>) CCL
:
 <:1 %PROCESS-RESET%SET-TOPLEVEL  returned #x3000004C998FNIL
> :KILL) 
 1> Calling (PROCESS-KILL #<COCOA-LISTENER-PROCESS Listener(3) [Toplevel Read] #x302002011A4D>) 
  2> Calling (PROCESS-INTERRUPT #<COCOA-LISTENER-PROCESS Listener(3) [Toplevel Read] #x302002011A4D> #<Compiled-function CCL::%PROCESS-RESET #x3000004C998F> :KILL) 
  <2 PROCESS-INTERRUPT returned NIL
 <1 PROCESS-KILL returned NIL
 1> Calling (PROCESS-KILL #<PROCESS housekeeping(2) [Sleep] #x302001F031AD>) 
  2> Calling (PROCESS-INTERRUPT #<PROCESS housekeeping(2) [Sleep] #x302001F031AD> #<Compiled-function CCL::%PROCESS-RESET #x3000004C998F> :KILL) 
  <2 PROCESS-INTERRUPT returned NIL
 <1 PROCESS-KILL returned NIL

[pjb@despina org.xquartz:0 ccl-pjb-debug 14Gi]$ 

@informatimago informatimago changed the title on Mojave, ccl-1.12 build-application generates a kernel without a saved image. on Mojave, on Big Sur: ccl-1.12 build-application generates a kernel without a saved image. Jun 1, 2021
@informatimago
Copy link
Author

informatimago commented Jun 1, 2021

The TOPLEVEL function is not reached in process-exit-application
Current test file:

(write-line ";;; Loading :build-application")
(defparameter *output*
  (with-output-to-string (*standard-output*)
    (let ((*trace-output* *standard-output*))
      (require :build-application))))

(write-line ";;; Tracing interesting functions")
(trace
 ccl::%save-application
 ccl::%save-application-internal
 ccl::%set-toplevel
 ccl::clear-clos-caches
 ccl::make-application-error-handler
 ccl::make-mcl-listener-process
 ccl::open-dumplisp-file
 ccl::process-exit-application
 ccl::process-interrupt
 ccl::process-kill
 ccl::save-application
 ccl::save-image
 ccl::toplevel
 ccl::toplevel-function)

(trace (ccl::%set-toplevel :break-after t))
(trace (ccl::toplevel      :break-before t))

(write-line ";;; Saving application ~/Desktop/Bar")
(ccl:save-application #P"~/Desktop/Bar"
                      :toplevel-function nil
		      :init-file nil
                      :error-handler nil
                      :application-class 'gui::cocoa-ide
		      :clear-clos-caches t
		      :mode #o755
		      :prepend-kernel t)

Test command:

PATH=/usr/bin:/usr/sbin:/bin:/sbin ./dx86cl64 --no-init --quiet --batch --load test-sa.lisp

Output:


[pjb@despina org.xquartz:0 ccl-pjb-debug 14Gi]$ PATH=/usr/bin:/usr/sbin:/bin:/sbin ./dx86cl64 --no-init --quiet --batch --load test-sa.lisp
;;; Loading :build-application
;;; Tracing interesting functions
0> Calling (%SET-TOPLEVEL NIL) 
<0 %SET-TOPLEVEL returned #<Compiled-function (:INTERNAL GUI::COCOA-STARTUP GUI::START-COCOA-IDE) (Non-Global)  #x302001409F7F>
;;; Saving application ~/Desktop/Bar
0> Calling (SAVE-APPLICATION #P"/Users/pjb/Desktop/Bar" :TOPLEVEL-FUNCTION NIL :INIT-FILE NIL :ERROR-HANDLER NIL :APPLICATION-CLASS GUI::COCOA-IDE :CLEAR-CLOS-CACHES T :MODE 493 :PREPEND-KERNEL T) 
 1> Calling (CCL::OPEN-DUMPLISP-FILE #P"/Users/pjb/Desktop/Bar" :MODE 493 :PREPEND-KERNEL T) 
 <1 CCL::OPEN-DUMPLISP-FILE returned 8
 1> Calling (PROCESS-INTERRUPT #<APPKIT-PROCESS Initial(0) [Reset] #x3020000B338D> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x3020023621FF>) 
 <1 PROCESS-INTERRUPT returned NIL
 1> Calling (PROCESS-KILL #<TTY-LISTENER listener(1) [Active] #x30200043BC0D>) 
  2> Calling (PROCESS-INTERRUPT #<TTY-LISTENER listener(1) [Active] #x30200043BC0D> #<Compiled-function CCL::%PROCESS-RESET #x3000004C998F> :KILL) 
0> Calling (CCL::MAKE-MCL-LISTENER-PROCESS "Listener" #<GUI::COCOA-LISTENER-INPUT-STREAM #x30200239E0FD> #<GUI::COCOA-LISTENER-OUTPUT-STREAM #x30200239D8BD> #<Compiled-function (:INTERNAL GUI::NEW-COCOA-LISTENER-PROCESS) (Non-Global)  #x302001DA08BF> :INITIAL-FUNCTION #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::NEW-COCOA-LISTENER-PROCESS) #x3020023948DF> :ECHOING NIL :CLASS GUI::COCOA-LISTENER-PROCESS :INITARGS (:LISTENER-INPUT-STREAM #<GUI::COCOA-LISTENER-INPUT-STREAM #x30200239E0FD> :LISTENER-OUTPUT-STREAM #<GUI::COCOA-LISTENER-OUTPUT-STREAM #x30200239D8BD> :LISTENER-WINDOW #<HEMLOCK-LISTENER-FRAME <HemlockListenerFrame: 0x2261a090> (#x2261A090)>)) 
<0 CCL::MAKE-MCL-LISTENER-PROCESS returned #<COCOA-LISTENER-PROCESS Listener(3) [Reset] #x30200239398D>
0> Calling (CCL::PROCESS-EXIT-APPLICATION #<APPKIT-PROCESS Initial(0) [Reset] #x3020000B338D> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x30200225DC9F>) 
 1> Calling (%SET-TOPLEVEL #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x30200225DC9F>) 
 <1 %SET-TOPLEVEL returned NIL
 1> Calling (PROCESS-KILL #<COCOA-LISTENER-PROCESS Listener(3) [Active] #x302002200F1D>) 
  2> Calling (PROCESS-INTERRUPT #<COCOA-LISTENER-PROCESS Listener(3) [Active] #x302002200F1D> #<Compiled-function CCL::%PROCESS-RESET #x3000004C998F> :KILL) 
  <2 PROCESS-INTERRUPT returned NIL
 <1 PROCESS-KILL returned NIL
 1> Calling (PROCESS-KILL #<PROCESS housekeeping(2) [Sleep] #x3020020D572D>) 
  2> Calling (PROCESS-INTERRUPT #<PROCESS housekeeping(2) [Sleep] #x3020020D572D> #<Compiled-function CCL::%PROCESS-RESET #x3000004C998F> :KILL) 
  <2 PROCESS-INTERRUPT returned NIL
 <1 PROCESS-KILL returned NIL

[pjb@despina org.xquartz:0 ccl-pjb-debug 14Gi]$ ls -l ~/Desktop/Bar
-rwxr-xr-x 1 pjb staff 361424 Jun  1 20:12 /Users/pjb/Desktop/Bar*

@informatimago
Copy link
Author

Perhaps the problem is in the code generated for that method?

cl-user> (disassemble (closer-mop:method-function (find-method (function ccl::process-exit-application)  '() '(ccl::process t))))
;; "ccl:l1;l1-processes.lisp.newest":22140-22979
    (recover-fn-from-rip)                   ;     [0]
    (cmpl ($ 16) (% nargs))                 ;     [7]
    (jne L1005)                             ;    [10]
    (pushq (% rbp))                         ;    [16]
    (movq (% rsp) (% rbp))                  ;    [17]
    (pushq (% arg_y))                       ;    [20]
    (pushq (% arg_z))                       ;    [21]

;;; (eq process *initial-process*)
    (movq (@ 'ccl::*initial-process* (% fn)) (% temp0)) ;    [22]
    (movq (@ 2 (% temp0)) (% arg_z))        ;    [29]
    (movq (@ -8 (% rbp)) (% arg_y))         ;    [33]
    (cmpq (% arg_z) (% arg_y))              ;    [37]
    (jne L988)                              ;    [40]

;;; (with-standard-abort-handling "Exit Lisp" (prepare-to-quit) ;; We may have abruptly terminated a thr
    (pushq ($ #x230))                       ;    [46]
    (pushq (@ '(restart . #<ccl::class-wrapper restart #x30004002744D>) (% fn))) ;    [51]
    (pushq (@ 'ccl:abort-break (% fn)))     ;    [58]
    (pushq ($ 8))                           ;    [65]
    (pushq ($ #x1300B))                     ;    [67]
    (pushq ($ #x1300B))                     ;    [72]
    (pushq ($ #x1300B))                     ;    [77]
    (movl ($ 56) (% nargs))                 ;    [82]
    (leaq (@ (:^ L101) (% fn)) (% temp2))   ;    [87]
    (jmp (@ .SPSTKGVECTOR))                 ;    [94]
L101                                        ;  [@116]
    (recover-fn-from-rip)                   ;   [101]
    (pushq (% arg_z))                       ;   [108]
    (pushq ($ #x230))                       ;   [109]
    (pushq (@ '(restart . #<ccl::class-wrapper restart #x30004002744D>) (% fn))) ;   [114]
    (pushq (@ 'abort (% fn)))               ;   [121]
    (pushq ($ 0))                           ;   [128]
    (movq (@ '#<Compiled-function (:internal (ccl::process-exit-application (ccl:process t))) (Non-Global)  #x3000004EF50F> (% fn)) (% arg_z)) ;   [130]
    (pushq (% arg_z))                       ;   [137]
    (pushq ($ #x1300B))                     ;   [138]
    (pushq ($ #x1300B))                     ;   [143]
    (movl ($ 56) (% nargs))                 ;   [148]
    (leaq (@ (:^ L173) (% fn)) (% temp2))   ;   [153]
    (jmp (@ .SPSTKGVECTOR))                 ;   [166]
L173                                        ;  [@188]
    (recover-fn-from-rip)                   ;   [173]
    (pushq (% arg_z))                       ;   [180]
    (pushq (@ -32 (% rbp)))                 ;   [181]
    (pushq (@ -24 (% rbp)))                 ;   [184]
    (movl ($ 16) (% nargs))                 ;   [187]
    (leaq (@ (:^ L213) (% fn)) (% temp2))   ;   [192]
    (jmp (@ .SPSTKCONSLIST))                ;   [206]
L213                                        ;  [@228]
    (recover-fn-from-rip)                   ;   [213]
    (pushq (% arg_z))                       ;   [220]
    (movq (@ -40 (% rbp)) (% arg_z))        ;   [221]
    (leaq (@ (:^ L717) (% fn)) (% temp1))   ;   [225]
    (lisp-call  (@ .SPMKCATCH1V))           ;   [238]
    (recover-fn-from-rip)                   ;   [245]
    (movq (@ 'ccl::%restarts% (% fn)) (% arg_z)) ;   [252]
    (lisp-call  (@ .SPSPECREFCHECK))        ;   [262]
    (recover-fn-from-rip)                   ;   [269]
    (movq (@ -40 (% rbp)) (% arg_y))        ;   [276]
    (subq ($ 32) (@ #x158 (% rcontext)))    ;   [280]
    (movq (@ #x158 (% rcontext)) (% imm0))  ;   [288]
    (movapd (% fpzero) (@ (% imm0)))        ;   [295]
    (movapd (% fpzero) (@ 16 (% imm0)))     ;   [300]
    (movq (@ 72 (% rcontext)) (% imm2))     ;   [306]
    (movq (% imm2) (@ (% imm0)))            ;   [310]
    (movq (% rbp) (@ 8 (% imm0)))           ;   [313]
    (movq (% imm0) (@ 72 (% rcontext)))     ;   [317]
    (leaq (@ 19 (% imm0)) (% imm0))         ;   [321]
    (movq (% arg_y) (@ 5 (% imm0)))         ;   [325]
    (movq (% arg_z) (@ -3 (% imm0)))        ;   [329]
    (movq (% imm0) (% arg_z))               ;   [333]
    (movq (@ 'ccl::%restarts% (% fn)) (% arg_y)) ;   [336]
    (leaq (@ (:^ L357) (% fn)) (% temp2))   ;   [343]
    (jmp (@ .SPBIND))                       ;   [350]
L357                                        ;  [@372]
    (recover-fn-from-rip)                   ;   [357]
    (movq (@ ':abort (% fn)) (% arg_z))     ;   [364]
    (leaq (@ (:^ L605) (% fn)) (% temp1))   ;   [371]
    (lisp-call  (@ .SPMKCATCH1V))           ;   [382]
    (recover-fn-from-rip)                   ;   [389]
    (movq (@ ':cancel (% fn)) (% arg_z))    ;   [396]
    (leaq (@ (:^ L573) (% fn)) (% temp1))   ;   [403]
    (lisp-call  (@ .SPMKCATCH1V))           ;   [414]
    (recover-fn-from-rip)                   ;   [421]

;;; (prepare-to-quit)
    (xorl (% nargs) (% nargs))              ;   [428]
    (movq (@ 'ccl::prepare-to-quit (% fn)) (% temp0)) ;   [430]
    (lisp-call (@ 10 (% temp0)))            ;   [442]
    (recover-fn-from-rip)                   ;   [445]

;;; (flush-stream *stdout*)
    (movq (@ 'ccl::*stdout* (% fn)) (% arg_z)) ;   [452]
    (lisp-call  (@ .SPSPECREFCHECK))        ;   [462]
    (recover-fn-from-rip)                   ;   [469]
    (movl ($ 8) (% nargs))                  ;   [476]
    (movq (@ '#<Compiled-function (:internal ccl::flush-stream (ccl::process-exit-application (ccl:process t))) (Non-Global)  #x3000004EEB3F> (% fn)) (% temp0)) ;   [481]
    (lisp-call (% temp0))                   ;   [491]
    (recover-fn-from-rip)                   ;   [493]

;;; (flush-stream *stderr*)
    (movq (@ 'ccl::*stderr* (% fn)) (% arg_z)) ;   [500]
    (lisp-call  (@ .SPSPECREFCHECK))        ;   [510]
    (recover-fn-from-rip)                   ;   [517]
    (movl ($ 8) (% nargs))                  ;   [524]
    (movq (@ '#<Compiled-function (:internal ccl::flush-stream (ccl::process-exit-application (ccl:process t))) (Non-Global)  #x3000004EEB3F> (% fn)) (% temp0)) ;   [529]
    (lisp-call (% temp0))                   ;   [539]
    (recover-fn-from-rip)                   ;   [541]

;;; (with-standard-abort-handling "Exit Lisp" (prepare-to-quit) ;; We may have abruptly terminated a thr
    (movl ($ 8) (% imm0.l))                 ;   [548]
    (leaq (@ (:^ L573) (% fn)) (% temp2))   ;   [553]
    (jmp (@ .SPNTHROW1VALUE))               ;   [560]
L573                                        ;  [@588]
    (recover-fn-from-rip)                   ;   [573]
    (movl ($ 8) (% imm0.l))                 ;   [580]
    (leaq (@ (:^ L605) (% fn)) (% temp2))   ;   [585]
    (jmp (@ .SPNTHROW1VALUE))               ;   [592]
L605                                        ;  [@620]
    (recover-fn-from-rip)                   ;   [605]
    (movl ($ 8) (% imm0.l))                 ;   [612]
    (leaq (@ (:^ L637) (% fn)) (% temp2))   ;   [617]
    (jmp (@ .SPNTHROW1VALUE))               ;   [624]
L637                                        ;  [@652]
    (recover-fn-from-rip)                   ;   [637]
    (addq ($ 24) (% rsp))                   ;   [644]
    (movq (@ 72 (% rcontext)) (% imm0))     ;   [648]
    (movq (@ (% imm0)) (% imm0))            ;   [652]
    (movq (% imm0) (@ 72 (% rcontext)))     ;   [655]
    (movq (% imm0) (@ #x158 (% rcontext)))  ;   [659]
    (movq (@ 72 (% rcontext)) (% imm0))     ;   [666]
    (movq (@ (% imm0)) (% imm0))            ;   [670]
    (movq (% imm0) (@ 72 (% rcontext)))     ;   [673]
    (movq (% imm0) (@ #x158 (% rcontext)))  ;   [677]
    (movq (@ 72 (% rcontext)) (% imm0))     ;   [684]
    (movq (@ (% imm0)) (% imm0))            ;   [688]
    (movq (% imm0) (@ 72 (% rcontext)))     ;   [691]
    (movq (% imm0) (@ #x158 (% rcontext)))  ;   [695]
    (jmpq L945)                             ;   [702]
L717                                        ;  [@732]
    (recover-fn-from-rip)                   ;   [717]
    (addq ($ 24) (% rsp))                   ;   [724]
    (movq (@ 72 (% rcontext)) (% imm0))     ;   [728]
    (movq (@ (% imm0)) (% imm0))            ;   [732]
    (movq (% imm0) (@ 72 (% rcontext)))     ;   [735]
    (movq (% imm0) (@ #x158 (% rcontext)))  ;   [739]
    (movq (@ 72 (% rcontext)) (% imm0))     ;   [746]
    (movq (@ (% imm0)) (% imm0))            ;   [750]
    (movq (% imm0) (@ 72 (% rcontext)))     ;   [753]
    (movq (% imm0) (@ #x158 (% rcontext)))  ;   [757]
    (movq (@ 72 (% rcontext)) (% imm0))     ;   [764]
    (movq (@ (% imm0)) (% imm0))            ;   [768]
    (movq (% imm0) (@ 72 (% rcontext)))     ;   [771]
    (movq (% imm0) (@ #x158 (% rcontext)))  ;   [775]
    (pushq (% arg_z))                       ;   [782]
    (movq (@ -24 (% rbp)) (% arg_z))        ;   [783]
    (movl (% arg_z.l) (% imm0.l))           ;   [787]
    (andl ($ 7) (% imm0.l))                 ;   [789]
    (cmpl ($ 3) (% imm0.l))                 ;   [792]
    (jne L1013)                             ;   [795]
    (movq (@ 5 (% arg_z)) (% arg_z))        ;   [801]
    (pushq (% arg_z))                       ;   [805]
    (movq (@ -24 (% rbp)) (% arg_z))        ;   [806]
    (movq (@ -3 (% arg_z)) (% arg_z))       ;   [810]
    (movq (% arg_z) (@ -24 (% rbp)))        ;   [814]
    (popq (% arg_z))                        ;   [818]
    (pushq (% arg_z))                       ;   [819]
    (movq (@ -32 (% rbp)) (% arg_z))        ;   [820]
    (cmpq ($ 0) (@ -32 (% rbp)))            ;   [824]
    (jne L886)                              ;   [829]
    (pushq ($ 82))                          ;   [831]
    (pushq ($ 82))                          ;   [833]
    (pushq (@ -24 (% rbp)))                 ;   [835]
    (movl ($ #x1300B) (% arg_x.l))          ;   [838]
    (xorl (% arg_y.l) (% arg_y.l))          ;   [844]
    (xorl (% arg_z.l) (% arg_z.l))          ;   [846]
    (movl ($ 32) (% nargs))                 ;   [848]
    (movq (@ 'ccl::prepare-to-destructure (% fn)) (% temp0)) ;   [853]
    (lisp-call (@ 10 (% temp0)))            ;   [866]
    (recover-fn-from-rip)                   ;   [869]
    (movq (% arg_z) (% arg_y))              ;   [876]
    (pushq (% arg_y))                       ;   [879]
    (addq ($ 8) (% rsp))                    ;   [880]
    (jmp L937)                              ;   [884]
L886                                        ;  [@901]
    (pushq ($ 82))                          ;   [886]
    (pushq ($ 82))                          ;   [888]
    (pushq (@ -24 (% rbp)))                 ;   [890]
    (movl ($ #x1300B) (% arg_x.l))          ;   [893]
    (xorl (% arg_y.l) (% arg_y.l))          ;   [899]
    (xorl (% arg_z.l) (% arg_z.l))          ;   [901]
    (movl ($ 32) (% nargs))                 ;   [903]
    (movq (@ 'ccl::prepare-to-destructure (% fn)) (% temp0)) ;   [908]
    (lisp-call (@ 10 (% temp0)))            ;   [922]
    (recover-fn-from-rip)                   ;   [925]
    (pushq (% arg_z))                       ;   [932]
    (addq ($ 8) (% rsp))                    ;   [933]

    (:align 3)
L937                                        ;  [@952]
    (addq ($ 8) (% rsp))                    ;   [937]
    (addq ($ 8) (% rsp))                    ;   [941]

;;; (%set-toplevel thunk)

    (:align 4)
L945                                        ;  [@960]
    (movq (@ -16 (% rbp)) (% arg_z))        ;   [945]
    (movl ($ 8) (% nargs))                  ;   [949]
    (movq (@ 'ccl:%set-toplevel (% fn)) (% temp0)) ;   [954]
    (lisp-call (@ 10 (% temp0)))            ;   [962]
    (recover-fn-from-rip)                   ;   [965]

;;; (toplevel)
    (xorl (% nargs) (% nargs))              ;   [972]
    (movq (@ 'ccl:toplevel (% fn)) (% temp0)) ;   [974]
    (movq (% rbp) (% rsp))                  ;   [981]
    (popq (% rbp))                          ;   [984]
    (jmpq (@ 10 (% temp0)))                 ;   [985]

;;; (when (eq process *initial-process*) (with-standard-abort-handling "Exit Lisp" (prepare-to-quit) ;; 
L988                                        ; [@1003]
    (movl ($ #x1300B) (% arg_z.l))          ;   [988]
    (movq (% rbp) (% rsp))                  ;   [993]
    (popq (% rbp))                          ;   [996]
    (retq)                                  ;   [997]

;;; #<no source text>

    (:align 2)
L1005                                       ; [@1020]
    (uuo-error-wrong-number-of-args)        ;  [1005]

    (:align 2)
L1013                                       ; [@1028]
    (uuo-error-reg-not-list (% arg_z))      ;  [1013]
nil
cl-user> 

@informatimago
Copy link
Author

informatimago commented Jun 14, 2021

%SET-TOPLEVEL seems to be working normally.

[pjb@despina org.xquartz:0 ccl-pjb-debug 20Gi]$ ./dx86cl64  -n -l test-sa.lisp
;;; Loading :build-application
;;; Tracing interesting functions
;;; Saving application ~/Desktop/Bar
0> Calling (SAVE-APPLICATION #P"/Users/pjb/Desktop/Bar" :TOPLEVEL-FUNCTION NIL :INIT-FILE NIL :ERROR-HANDLER NIL :APPLICATION-CLASS GUI::COCOA-IDE :CLEAR-CLOS-CACHES T :MODE 493 :PREPEND-KERNEL T) 
 1> Calling (CCL::OPEN-DUMPLISP-FILE #P"/Users/pjb/Desktop/Bar" :MODE 493 :PREPEND-KERNEL T) 
 <1 CCL::OPEN-DUMPLISP-FILE returned 9
 1> Calling (PROCESS-INTERRUPT #<APPKIT-PROCESS Initial(0) [Reset] #x3020000B250D> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x302002123BAF>) 
 <1 PROCESS-INTERRUPT returned NIL
 1> Calling (PROCESS-KILL #<TTY-LISTENER listener(1) [Active] #x30200043A80D>) 
  2> Calling (PROCESS-INTERRUPT #<TTY-LISTENER listener(1) [Active] #x30200043A80D> #<Compiled-function CCL::%PROCESS-RESET #x3000004C998F> :KILL) 
0> Calling (CCL::MAKE-MCL-LISTENER-PROCESS "Listener" #<GUI::COCOA-LISTENER-INPUT-STREAM #x30200214583D> #<GUI::COCOA-LISTENER-OUTPUT-STREAM #x302002144FFD> #<Compiled-function (:INTERNAL GUI::NEW-COCOA-LISTENER-PROCESS) (Non-Global)  #x302001BFDF4F> :INITIAL-FUNCTION #<COMPILED-LEXICAL-CLOSURE (:INTERNAL GUI::NEW-COCOA-LISTENER-PROCESS) #x30200217B26F> :ECHOING NIL :CLASS GUI::COCOA-LISTENER-PROCESS :INITARGS (:LISTENER-INPUT-STREAM #<GUI::COCOA-LISTENER-INPUT-STREAM #x30200214583D> :LISTENER-OUTPUT-STREAM #<GUI::COCOA-LISTENER-OUTPUT-STREAM #x302002144FFD> :LISTENER-WINDOW #<HEMLOCK-LISTENER-FRAME <HemlockListenerFrame: 0x7397f0> (#x7397F0)>)) 
<0 CCL::MAKE-MCL-LISTENER-PROCESS returned #<COCOA-LISTENER-PROCESS Listener(3) [Reset] #x30200217A31D>
0> Calling (CCL::PROCESS-EXIT-APPLICATION #<APPKIT-PROCESS Initial(0) [Reset] #x3020000B250D> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x302002176FCF>) 
 1> (CCL::%TCR-TOPLEVEL-FUNCTION (CCL::%CURRENT-TCR)) = NIL
 1> Calling (%SET-TOPLEVEL #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x302002176FCF>) 
 <1 %SET-TOPLEVEL returned NIL
 1> (CCL::%TCR-TOPLEVEL-FUNCTION (CCL::%CURRENT-TCR)) = #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SAVE-APPLICATION) #x302002176FCF>
 1> Calling (PROCESS-KILL #<COCOA-LISTENER-PROCESS Listener(3) [Active] #x30200217A31D>) 
  2> Calling (PROCESS-INTERRUPT #<COCOA-LISTENER-PROCESS Listener(3) [Active] #x30200217A31D> #<Compiled-function CCL::%PROCESS-RESET #x3000004C998F> :KILL) 
  <2 PROCESS-INTERRUPT returned NIL
 <1 PROCESS-KILL returned NIL
 1> Calling (PROCESS-KILL #<PROCESS housekeeping(2) [Sleep] #x302001F7AB5D>) 
  2> Calling (PROCESS-INTERRUPT #<PROCESS housekeeping(2) [Sleep] #x302001F7AB5D> #<Compiled-function CCL::%PROCESS-RESET #x3000004C998F> :KILL) 
  <2 PROCESS-INTERRUPT returned NIL
 <1 PROCESS-KILL returned NIL
    3.8.15.16.32-2.8           
[pjb@despina org.xquartz:0 ccl-pjb-debug 20Gi]$ ls -l ~/Desktop/Bar
-rwxr-xr-x 1 pjb staff 361424 Jun 14 10:45 /Users/pjb/Desktop/Bar*
    3.8.15.16.32-2.8           
[pjb@despina org.xquartz:0 ccl-pjb-debug 20Gi]$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant