euslisp / EusLisp

EusLisp is an integrated programming system for the research on intelligent robots based on Common Lisp and Object-Oriented programming. [Manual](http://euslisp.github.io/EusLisp/manual.html ) [マニュアル](http://euslisp.github.io/EusLisp/jmanual.html )
Other
57 stars 50 forks source link

Update argparse tests #467

Closed Affonso-Gui closed 3 years ago

Affonso-Gui commented 3 years ago

Start subprocesses using the same eus program as the parent and use the less volatile lisp-implementation-type instead of lisp-implementation-version for testing compiled functions with no argument.

This is because currently parse-overall.2 fails when invoked with irteus or roseus.

k-okada commented 3 years ago

it fails on test https://app.travis-ci.com/github/euslisp/EusLisp/jobs/540748788

tart testing [parse-error.2]
[ERROR] test (= 256 (unix:system eusgl /tmp/tmp-argparse-test-parse-error-2.l --arg 2>/dev/null 1>/dev/null)) failed ... ( ^[0mmstart testing [parse-error.2]
]
ated on 0e0d142978f1(Fri Oct 1 09:54:11 UTC 2021)^[0m*).
TEST-NAME: parse-error.3
  now testing...
start testing [parse-error.3]
[ERROR] test (= 256 (unix:system eusgl /tmp/tmp-argparse-test-parse-error-3.l --arg 2>/dev/null 1>/dev/null)) failed ... ( ^[0mmstart testing [parse-error.3]
]
ated on 0e0d142978f1(Fri Oct 1 09:54:11 UTC 2021)^[0m*).^[0m
l 1>/dev/null)) failed ... ( ).
Affonso-Gui commented 3 years ago

@k-okada Thanks for the heads up. In the argparse test suite we set a new error handler to immediately exit on any errors and then evaluate the programs using unix:system. Here it appears that this error handler is not functioning properly in eusgl, causing a segmentation fault instead of exiting with the error code 256.

I'll take a deeper look shortly.

Affonso-Gui commented 3 years ago

The problem seemed to be (again) related with GC issues. For now I am hoping that replacing the lambda function with a proper defun function and a symbol will do the job, but the install-error-handler as it is is definitely unstable.

Tested with:

;; sysfunc.c
pointer GETERRHANDLER(ctx,n,argv)
register context *ctx;
int n;
pointer argv[];
{
  pointer errhandler=ctx->errhandler;
  return errhandler;
}
;; ...
defun(ctx,"GET-ERROR-HANDLER",mod,GETERRHANDLER,NULL);

and then

;; /tmp/test.l
(lisp::install-error-handler #'(lambda (&rest args) (exit 1)))
(setq *debug* t)

(sys:gc)
(print (sys::get-error-handler))

(exit 0)
$ eusgl /tmp/test.l

EusLisp 9.27(f0b7cdcb) for Linux64 created on P40(Mon Oct 25 10:22:37 JST 2021)

;; gc: thread=0  free/total=222681/576381 stack=47  mark=0 sweep=1
;p=pointer?(0x564a5aec1078)
;; eusint: sig=11, -492456720; thr=0 ctx=0x564a56e6eb90
;; Segmentation Fault.
;; in (print (system::get-error-handler))
;; You are still in a signal handler.
;;Try reset or throw to upper level as soon as possible.
;; code=-492456720 x=e2a5b3c0 addr=0
Affonso-Gui commented 3 years ago

Jessie builds fails with

fatal: unable to access 'https://salsa.debian.org/science-team/euslisp/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

and osx build fails with

curl: (60) SSL certificate problem: certificate has expired

@k-okada How can we update these certificates?