euslisp / jskeus

This repository contains EusLisp software developed and used by JSK at The University of Tokyo
23 stars 55 forks source link

irteusgl fails if NIL file exists #618

Closed k-okada closed 2 years ago

k-okada commented 2 years ago
$ touch NIL
$ irteusgl
configuring by "/opt/ros/melodic/share/euslisp/jskeus/eus//lib/eusrt.l"
;; readmacro ;; object ;; packsym ;; common ;; constants ;; stream ;; string ;; loader ;; pprint ;; process ;; hashtab ;; array ;; mathtran ;; eusdebug ;; eusforeign ;; extnum ;; coordinates ;; tty ;; history ;; toplevel ;; trans ;; comp ;; builtins ;; par ;; intersection ;; geoclasses ;; geopack ;; geobody ;; primt ;; compose ;; polygon ;; viewing ;; viewport ;; viewsurface ;; hid ;; shadow ;; bodyrel ;; dda ;; helpsub ;; eushelp ;; xforeign ;; Xdecl ;; Xgraphics ;; Xcolor ;; Xeus ;; Xevent ;; Xpanel ;; Xitem ;; Xtext ;; Xmenu ;; Xscroll ;; Xcanvas ;; Xtop ;; Xapplwin
;; pixword ;; RGBHLS ;; convolve ;; piximage ;; pbmfile ;; image_correlation ;; oglforeign ;; gldecl ;; glconst ;; glforeign ;; gluconst ;; gluforeign ;; glxconst ;; glxforeign ;; eglforeign ;; eglfunc ;; glutil ;; gltexture ;; glprim ;; gleus ;; glview ;; toiv-undefined ;; fstringdouble irtmath irtutil irtc irtgeoc irtgraph gnuplotlib ___time ___pgsql irtgeo euspqp pqp irtscene irtmodel irtdyna irtrobot irtsensor irtbvh irtcollada irtstl irtwrl irtpointcloud eusbullet bullet irtcollision irtx Call Stack (max depth: 20):
  0: at (load-library (format nil "~A~A/lib/libirteusx" *eusdir* (unix:getenv "ARCHDIR")) '("irtx"))
  1: at (load-library (format nil "~A~A/lib/libirteusx" *eusdir* (unix:getenv "ARCHDIR")) '("irtx"))
  2: at (user::load-irteusx)
  3: at (progn (user::load-irteusx))
  4: at (if (or (substringp "eusx" (pathname-name *program-name*)) (substringp "eusgl" (pathname-name *program-name*))) (progn (user::load-irteusx)))
  5: at (when (or (substringp "eusx" (pathname-name *program-name*)) (substringp "eusgl" (pathname-name *program-name*))) (user::load-irteusx))
  6: at (progn (when (substringp "eus" (pathname-name *program-name*)) (user::load-irteus)) (when (or (substringp "eusg" (pathname-name *program-name*)) (substringp "eusx" (pathname-name *program-name*))) (user::load-irteusg)) (when (or (substringp "eusx" (pathname-name *program-name*)) (substringp "eusgl" (pathname-name *program-name*))) (user::load-irteusx)) (when (substringp "eusgl" (pathname-name *program-name*)) (user::load-irteusgl)) (unless (member :irt *features*) (push :irt *features*)))
  7: at (if (not (member (pathname-name *program-name*) (list "eus0" "eus1" "eus2" "eus" "eusx" "eusg" "eusgl" "euscomp") :test #'string=)) (progn (when (substringp "eus" (pathname-name *program-name*)) (user::load-irteus)) (when (or (substringp "eusg" (pathname-name *program-name*)) (substringp "eusx" (pathname-name *program-name*))) (user::load-irteusg)) (when (or (substringp "eusx" (pathname-name *program-name*)) (substringp "eusgl" (pathname-name *program-name*))) (user::load-irteusx)) (when (substringp "eusgl" (pathname-name *program-name*)) (user::load-irteusgl)) (unless (member :irt *features*) (push :irt *features*))))
  8: at (when (not (member (pathname-name *program-name*) (list "eus0" "eus1" "eus2" "eus" "eusx" "eusg" "eusgl" "euscomp") :test #'string=)) (when (substringp "eus" (pathname-name *program-name*)) (user::load-irteus)) (when (or (substringp "eusg" (pathname-name *program-name*)) (substringp "eusx" (pathname-name *program-name*))) (user::load-irteusg)) (when (or (substringp "eusx" (pathname-name *program-name*)) (substringp "eusgl" (pathname-name *program-name*))) (user::load-irteusx)) (when (substringp "eusgl" (pathname-name *program-name*)) (user::load-irteusgl)) (unless (member :irt *features*) (push :irt *features*)))
  9: at (unless (member (pathname-name *program-name*) (list "eus0" "eus1" "eus2" "eus" "eusx" "eusg" "eusgl" "euscomp") :test #'string=) (when (substringp "eus" (pathname-name *program-name*)) (user::load-irteus)) (when (or (substringp "eusg" (pathname-name *program-name*)) (substringp "eusx" (pathname-name *program-name*))) (user::load-irteusg)) (when (or (substringp "eusx" (pathname-name *program-name*)) (substringp "eusgl" (pathname-name *program-name*))) (user::load-irteusx)) (when (substringp "eusgl" (pathname-name *program-name*)) (user::load-irteusgl)) (unless (member :irt *features*) (push :irt *features*)))
  10: at (load (format nil "~A/lib/irtext.l" *eusdir*))
irteusgl: ERROR th=0  file #P"" not found in (load-library (format nil "~A~A/lib/libirteusx" *eusdir* (unix:getenv "ARCHDIR")) '("irtx"))X:E: ^C

it fails with NIL, but nil does not matter....

Affonso-Gui commented 2 years ago

https://github.com/euslisp/jskeus/blob/master/irteus/irtx.l#L91-L92

Here pname is nil, but (probe-file nil) returns :file since the file exists. Fixed in https://github.com/euslisp/jskeus/pull/619.

This is made even harder to understand because probe-file uses namestring and load uses pathname:

irteusgl> (namestring nil)
"NIL"
irteusgl> (pathname nil)
#P""