Re: posix_spawn

"Kirill A. Korinsky" <[email protected]>
Newsgroups gmane.lisp.gcl.devel
Message-ID <[email protected]>
A file fix-memory-corruption-on-macOS.patch contains two patches. I just removed the second one (vsystem -> system) in favour of posix_spawn and applied it on 33a195d5cec2a7f8f563e11c0f1a3011ea0b30a0 which allows me to build GCL on macOS 12. It requires something like 3 hours I guess, but I did it from clean system.

Summary: posix_spawn works but it requires one more patch:

--- o/main.c
+++ o/main.c
@@ -432,7 +432,11 @@ gcl_cleanup(int gc) {
   if (gc) {

     saving_system=TRUE;
+
+/* on macOS it leads to ERROR "Caught fatal error [memory may be damaged]" */
+#ifndef __APPLE__
     GBC(t_other);
+#endif
     saving_system=FALSE;

     minimize_image();

If I recall right I made this patch as result of git bisect that points that this issue was introduced by cb842e61fd2d0ff5baf51918112003a3a1b69b45 when this line was introduced.

From my point of view posix_spawn is the right move and it really fixes things. If you think to commit it, please do!

--
wbr, Kirill

> On 23. Dec 2023, at 01:20, Kirill A. Korinsky <[email protected]> wrote:
> 
> ha, it was false alarm.
> 
> I've waited for a while and it continue to working until it crashed as:
> 
> Warning: WILD-PATHNAME-P is being redefined.
> Warning: SBIT is being redefined.
> Warning: GETHASH is being redefined.
> GCL (GNU Common Lisp)  2.7.0 Thu Oct 26 12:00:01 PM EDT 2023  CLtL1    git: Version_2_7_0pre9
> Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
> Binary License:  GPL due to GPL'ed components: (UNEXEC)
> Modifications of this banner must retain notice of a compatible license
> Dedicated to the memory of W. Schelter
> 
> Use (help) to get some basic information on how to use GCL.
> Temporary directory for compiler files set to /var/folders/rq/wqy42lq543z9rwrlj7vf1h4r0000gn/T/
> 
> >;; Loading "boot.lisp"
> 
> Correctable error: The assertion (APPLY (QUOTE ARRAY-IN-BOUNDS-P) ARRAY ...) failed.
> Signalled by APPLY.
> If continued: Repeat assertion.The assertion (APPLY (QUOTE ARRAY-IN-BOUNDS-P) ARRAY ...) failed.
> 
> Broken at LET*.  Type :H for Help.
>     1 (continue) Repeat assertion.
>     2  Return to top level.
> COMPILER>>make: *** [unixport/saved_gcl0] Error 255
> 
> --
> wbr, Kirill
> 
>> On 23. Dec 2023, at 00:59, Camm Maguire <[email protected] <mailto:[email protected]>> wrote:
>> 
>> Too bad, because it is working for me and could be a generic solution.
>> Did it eliminate those C compiler warnings?  Can you run under gdb and
>> backtrace at the point asking for keyboard input?
>> 
>> cd unixport
>> make raw_pre_gcl
>> gdb raw_pre_gcl
>> (gdb) r ./ <foo
>> 
>> Take care,
>> 
>> "Kirill A. Korinsky" <[email protected] <mailto:[email protected]>> writes:
>> 
>>> something goes wrong here. It stuck like this:
>>> 
>>> loading /Users/catap/src/gcl/gcl/unixport/../cmpnew/gcl_cmpspecial.lsp
>>> loading /Users/catap/src/gcl/gcl/unixport/../cmpnew/gcl_cmplam.lsp
>>> loading /Users/catap/src/gcl/gcl/unixport/../cmpnew/gcl_cmplet.lsp
>>> loading /Users/catap/src/gcl/gcl/unixport/../cmpnew/gcl_cmpvs.lsp
>>> loading /Users/catap/src/gcl/gcl/unixport/../cmpnew/gcl_cmpwt.lsp
>>> loading /Users/catap/src/gcl/gcl/unixport/../cmpnew/gcl_cmpmain.lsp
>>> 
>>> NIL
>>> 
>>> COMPILER>
>>> (:SDEBUG
>>> :SETF :PRE-GCL :DYNAMIC-EXTENT :INTDIV :64BIT :C99 :UNEXEC
>>> :NATIVE-RELOC :EDITLINE :TRUNCATE_USE_C :CLX-LITTLE-ENDIAN :BSD
>>> :DARWIN21.6.0 :X86_64 :IEEE-FLOATING-POINT :DARWIN :UNIX :GMP :GCL
>>> :AKCL :COMMON :KCL)
>>> 
>>> COMPILER>
>>> #<"SYSTEM" package>
>>> 
>>> SYSTEM>
>>> T
>>> 
>>> SYSTEM>
>>> 
>>> and it expect my input via keyboard.
>> 
>> --
>> Camm Maguire			     		    [email protected] <mailto:[email protected]>
>> ==========================================================================
>> "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3/KLNtcfWfLw7JxqmNjZhndZIm4FAmWHNRkACgkQmNjZhndZ
Im5CxQ/+IPdxFxM3yRerEa2s0rGhNsbO6uzidx5VghNHjBoF/bHjVtjMTmTaeGRM
TkjitCvhjx6su2r/EfiieehkOS4Fnvlg+WMZluY4JXdAUFK9rlRwgPzZU0JgPWiX
iv5VdNNHn8Y1AH0XGaAZ2njTJKDXXQCHlZNQNJAB3QfPzdODRXyQjTrvoyJTC1as
Gs2QvB7NP1voibJWxi2FkG5IXfhQvl47Z9+wRHpnCvTyixsTINLnN95foqUOw8nD
JlRvRrQ3pG8vfmwu9W1StnxQxn5lEVWMl0hyH24ocDAMfH0i5ys4IE+eiNZUn1yX
cuW3T/zyjXvOvFsqz6ql1P3lJDav+xB5psw7SDb2WGlgeEqI6aXq2kdAjvWqFkkz
uj3pADrAJUlvGZdlbwmn68vQ/zD1EzmkPC0bE180DaxMDHZkHAh5DI5Jk/xSGCLz
sBAth9bxiokuqj9Cwpr4EoPZ4yORdm3tdcX1SD+w8YiWFSOPt5vI2KWEmo0rJx7q
edLlebQQQThKj5+YSkD+cyBzbBN8TQqnt7t3SCPCKTVseoWOZCQm5mBQric69C7z
mUVIMJcdV0jWNGCCOzuLAuLG3dVOtGdl20xtjeBzX1VqFOIqGrjSy/7Mk0/+cMZI
XNwiC6ntzbrbe2nfIjoqodhd/assBESrRW6NO7Bou095x8C2NB8=
=KK9I
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.