SBCL fails to startup from non-existing working directory

Bug #338924 reported by Leslie P. Polzer on 2009-03-06
Affects Status Importance Assigned to Milestone

Bug Description

[sky@wintermute ~/tmp]% mkdir foo
[sky@wintermute ~/tmp]% cd foo
[sky@wintermute ~/tmp/foo]% rmdir ~/tmp/foo
[sky@wintermute ~/tmp/foo]% sbcl
This is SBCL 1.0.24, an implementation of ANSI Common Lisp.
More information about SBCL is available at <>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
internal error #26
    SC: 14, Offset: 2 $1= 0x090a0847: other pointer
fatal error encountered in SBCL pid 9144(tid 3084954368):
internal error too early in init, can't recover

Welcome to LDB, a low-level debugger for the Lisp runtime environment.

I suppose this hasn't been fixed in later versions either.

Let me know if you need more info.

Gábor Melis (melisgl) on 2009-03-06
Changed in sbcl:
status: New → Confirmed
Gábor Melis (melisgl) on 2009-12-04
Changed in sbcl:
importance: Undecided → Low

The bug cause is in the /src/code/unix.lisp file, where the function posix-getcwd is defined. It uses alien C function getcwd, which fails to get the working directory in our case, setting errno to ENOENT (corresponds to "No such file or directory"). This behavior is not SBCL-specific, I have seen the similar issue with other programs.

 As a solution I suggest searching for some other place to be our working directory after the getcwd gives up inside posix-getcwd. We may use getenv("HOME") alien C call after that to make the user's home directory to be our working directory. I am not sure whether it is logically correct or not, maybe there is a better solution, so I will not create a patch right now. In any case, we know the issue cause and place now, so the desired fix implementation will be pretty straightforward. The backtrace info shows the next code flow (fragment):



Stas Boukarev (stassats) wrote :

Fixed in b7e68df14bbdcee894af620e4168328797be94b9

Changed in sbcl:
status: Confirmed → Fix Committed
Stas Boukarev (stassats) on 2013-06-03
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers