[Ecls-list] Issue with ext:system on MacOS (ECHILD)

Sylvain Ageneau ageneau at gmail.com
Wed Apr 13 22:42:50 UTC 2011


Hello,

I have the following issue on macOS with latest git:

I'm compiling ecl with:
ABI=32 CFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix=/opt/ecl/tmp --enable-threads=yes


This test fails about 50% of the time:

(defun safe-system (string)
;;  (cmpnote "Invoking external command:~%  ~A~%" string)
 (let ((result (ext:system string)))
   (unless (zerop result)
     (cerror "Continues anyway."
             "(SYSTEM ~S) returned non-zero value ~D"
             string result))
   result))

(safe-system "sh -c 'echo OK'")
(si:quit 0)


$ /opt/ecl/tmp/bin/ecl -load test.lsp 
;;; Loading "/Users/sylvain/src/lisp/ecl/test.lsp"
OK
$ /opt/ecl/tmp/bin/ecl -load test.lsp 
;;; Loading "/Users/sylvain/src/lisp/ecl/test.lsp"
OK
An error occurred during initialization:
(SYSTEM "sh -c 'echo OK'") returned non-zero value -1.
$ /opt/ecl/tmp/bin/ecl -load test.lsp 
;;; Loading "/Users/sylvain/src/lisp/ecl/test.lsp"
OK

* The call to "system" is failing with ECHILD (The calling process has no existing unwaited-for child processes).
* I could pinpoint it to commit a7000ca0f9f360fc1e0697b1c879096aa189e10e (Reimplementation of the SIGCHILD handler).
* It doesn't happen when compiling 64 bits or compiling with threads disabled

Unrelated to this, the following patch should fix an issue that "ar" is called in some build steps instead of $(AR). This can cause some problems when cross-compiling:

diff --git a/src/c/Makefile.in b/src/c/Makefile.in
index 495f205..1636a16 100644
--- a/src/c/Makefile.in
+++ b/src/c/Makefile.in
@@ -21,6 +21,7 @@ RM	= @RM@
EXE	= @EXEEXT@
DPP	= ./dpp$(EXE)
RANLIB	= @RANLIB@
+AR	= @AR@

# Data for installation
#
@@ -101,7 +102,7 @@ ffi_x86_64.c: $(srcdir)/arch/ffi_x86_64.d $(DPP) $(HFILES)

../libeclmin.a: $(OBJS) all_symbols.o all_symbols2.o
	$(RM) $@
-	ar cr $@ $(OBJS)
+	$(AR) cr $@ $(OBJS)
	$(RANLIB) $@

clean:
diff --git a/src/compile.lsp.in b/src/compile.lsp.in
index 0c437ac..e92bee1 100755
--- a/src/compile.lsp.in
+++ b/src/compile.lsp.in
@@ -104,9 +104,9 @@
	(concatenate 'string
"sh -c 'rm -rf tmp; mkdir tmp;"
"cp @LIBPREFIX at eclmin.@LIBEXT@ @LIBPREFIX at ecl.@LIBEXT@;"
-"cd tmp; ar -x ../@LIBPREFIX at lsp.@LIBEXT@;"
+"cd tmp; @AR@ -x ../@LIBPREFIX at lsp.@LIBEXT@;"
"for i in *. at OBJEXT@; do mv $i lsp_`basename $i`; done;"
-"ar -r ../@LIBPREFIX at ecl.@LIBEXT@ *. at OBJEXT@ ../c/all_symbols2. at OBJEXT@; rm *. at OBJEXT@;"
+"@AR@ -r ../@LIBPREFIX at ecl.@LIBEXT@ *. at OBJEXT@ ../c/all_symbols2. at OBJEXT@; rm *. at OBJEXT@;"
"@RANLIB@ ../@LIBPREFIX at ecl.@LIBEXT@'"))

#+:wants-dlopen


Regards,
Sylvain



More information about the ecl-devel mailing list