sb-posix tests fail on snow leopard (mac os 10.6)

Bug #421779 reported by Cyrus Harmon
46
This bug affects 8 people
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Cyrus Harmon

Bug Description

on snow leopard (mac os 10.6) the following tests sb-posix tests fail:

 stat.1
 stat.2
 stat.4
 stat-mode.2
 stat-mode.7
 stat-mode.8
 readdir/dirent-name
 time.1
 utimes.1

this is with sbcl 1.0.31.1 for x86 patched to support snow leopard (what should soon become 1.0.31.2). haven't tried with x86_64 yet.

uname says:

Darwin bandol 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386

Revision history for this message
Luís Oliveira (luismbo) wrote :

On my machine (OS 10.6.2, x86-64 sbcl) these tests don't fail anymore but three others do. The attached patch seems to fix them, though I'm not sure these are the proper fixes.

Revision history for this message
Beef (yvdriess) wrote :

on: (uname -a)
Darwin Kernel Version 10.0.0: Sat Jul 18 23:35:54 PDT 2009; root:xnu-1456.1.22~1/RELEASE_I386 i386

with: SBCL 1.0.34.2

Finished running tests.
Status:
 Expected failure: float.pure.lisp / (SCALE-FLOAT-OVERFLOW BUG-372)
 Expected failure: float.pure.lisp / (ADDITION-OVERFLOW BUG-372)
 Expected failure: callback.impure.lisp / UNDERFLOW-DETECTION
 Expected failure: debug.impure.lisp / (UNDEFINED-FUNCTION BUG-346)
 Expected failure: debug.impure.lisp / (UNDEFINED-FUNCTION BUG-353)
 Expected failure: debug.impure.lisp / (DIVIDE-BY-ZERO BUG-346)
 Expected failure: debug.impure.lisp / (DIVIDE-BY-ZERO BUG-356)
 Expected failure: debug.impure.lisp / (THROW NO-SUCH-TAG)
 Expected failure: debug.impure.lisp / (BACKTRACE MISC)
 Expected failure: packages.impure.lisp / USE-PACKAGE-CONFLICT-SET
 Expected failure: packages.impure.lisp / IMPORT-SINGLE-CONFLICT
ok
//apparent success (reached end of run-tests.sh normally)

Revision history for this message
Beef (yvdriess) wrote :

please remove my posts, sb-posix failed at compilation

Revision history for this message
Beef (yvdriess) wrote :

Test SB-POSIX-TESTS::MKDIR.ERROR.2 failed
Form: (HANDLER-CASE (SB-POSIX:MKDIR "/" 0)
                    (SB-POSIX:SYSCALL-ERROR (SB-POSIX-TESTS::C)
                                            (SB-POSIX:SYSCALL-ERRNO
                                             SB-POSIX-TESTS::C)))
Expected value: 17
Actual value: 21.

Test SB-POSIX-TESTS::RMDIR.ERROR.3 failed
Form: (HANDLER-CASE (SB-POSIX:RMDIR "/")
                    (SB-POSIX:SYSCALL-ERROR (SB-POSIX-TESTS::C)
                                            (SB-POSIX:SYSCALL-ERRNO
                                             SB-POSIX-TESTS::C)))
Expected value: 16
Actual value: 21.

Test SB-POSIX-TESTS::READDIR.1 failed
Form: (LET ((SB-POSIX-TESTS::DIR (SB-POSIX:OPENDIR "/")))
        (UNWIND-PROTECT
            (BLOCK SB-POSIX-TESTS::DIR-LOOP
              (LOOP SB-POSIX-TESTS::FOR SB-POSIX-TESTS::DIRENT = (SB-POSIX:READDIR
                                                                  SB-POSIX-TESTS::DIR)
                    SB-POSIX-TESTS::UNTIL (NULL-ALIEN SB-POSIX-TESTS::DIRENT)
                    WHEN (NOT
                          (STRINGP
                           (SB-POSIX:DIRENT-NAME SB-POSIX-TESTS::DIRENT)))
                    DO (RETURN-FROM SB-POSIX-TESTS::DIR-LOOP NIL)
                    SB-POSIX-TESTS::FINALLY (RETURN T)))
          (SB-POSIX:CLOSEDIR SB-POSIX-TESTS::DIR)))
Expected value: T

3 out of 60 total tests failed: SB-POSIX-TESTS::MKDIR.ERROR.2,
   SB-POSIX-TESTS::RMDIR.ERROR.3, SB-POSIX-TESTS::READDIR.1.unhandled SIMPLE-ERROR

Revision history for this message
Luís Oliveira (luismbo) wrote : Re: [Bug 421779] Re: sb-posix tests fail on snow leopard (mac os 10.6)

On Fri, Jan 1, 2010 at 2:40 PM, Beef <email address hidden> wrote:
> //apparent success (reached end of run-tests.sh normally)

I was referring to the tests in contrib/sb-posix/posix-tests.lisp. Do
you have anything to say about those?

--
Luís Oliveira
http://r42.eu/~luis/

Revision history for this message
Beef (yvdriess) wrote :

Is there a more convenient way to run the posix-specific tests?

simply loading posix-tests.lisp gives me:

      The symbol "SETENV" is not external in the SB-POSIX package.

Revision history for this message
Luís Oliveira (luismbo) wrote :

On Wed, Jan 6, 2010 at 9:43 PM, Beef <email address hidden> wrote:
> Is there a more convenient way to run the posix-specific tests?

Yes.

    (require :sb-posix)
    (require :sb-posix-tests)
    (sb-rt:do-tests)

HTH.

--
Luís Oliveira
http://r42.eu/~luis/

Revision history for this message
Beef (yvdriess) wrote :

Same as my previous post (#4) then:

Doing 68 pending tests of 68 tests total.
 SB-POSIX-TESTS::CHDIR.1 SB-POSIX-TESTS::CHDIR.2 SB-POSIX-TESTS::CHDIR.3
 SB-POSIX-TESTS::CHDIR.4 SB-POSIX-TESTS::CHDIR.5 SB-POSIX-TESTS::CHDIR.6
 SB-POSIX-TESTS::CHDIR.7 SB-POSIX-TESTS::CHDIR.8 SB-POSIX-TESTS::CHDIR.ERROR.1
 SB-POSIX-TESTS::CHDIR.ERROR.2 SB-POSIX-TESTS::MKDIR.1 SB-POSIX-TESTS::MKDIR.2
 SB-POSIX-TESTS::MKDIR.ERROR.1
Test SB-POSIX-TESTS::MKDIR.ERROR.2 failed
Form: (HANDLER-CASE (SB-POSIX:MKDIR "/" 0)
                    (SB-POSIX:SYSCALL-ERROR (SB-POSIX-TESTS::C)
                                            (SB-POSIX:SYSCALL-ERRNO
                                             SB-POSIX-TESTS::C)))
Expected value: 17
Actual value: 21.
 SB-POSIX-TESTS::MKDIR.ERROR.3 SB-POSIX-TESTS::RMDIR.1 SB-POSIX-TESTS::RMDIR.2
 SB-POSIX-TESTS::RMDIR.ERROR.1 SB-POSIX-TESTS::RMDIR.ERROR.2
Test SB-POSIX-TESTS::RMDIR.ERROR.3 failed
Form: (HANDLER-CASE (SB-POSIX:RMDIR "/")
                    (SB-POSIX:SYSCALL-ERROR (SB-POSIX-TESTS::C)
                                            (SB-POSIX:SYSCALL-ERRNO
                                             SB-POSIX-TESTS::C)))
Expected value: 16
Actual value: 21.
 SB-POSIX-TESTS::RMDIR.ERROR.4 SB-POSIX-TESTS::RMDIR.ERROR.5
fatal error encountered in SBCL pid 93071(tid 140735073532896):
Lutex assertion failure, file "pthread-lutex.c", line 148

Revision history for this message
Luís Oliveira (luismbo) wrote :

On Wed, Jan 6, 2010 at 10:07 PM, Beef <email address hidden> wrote:
> Same as my previous post (#4) then

Is this with or without my patch? (Which I'm not sure is the best
solution, since it might break in other versions of OSX.)

--
Luís Oliveira
http://r42.eu/~luis/

Revision history for this message
Si (simon-mintsource) wrote :

My results for sbcl-1.0.34 with your patch, Luís (many thanks for it):

Doing 60 pending tests of 60 tests total.
 SB-POSIX-TESTS::CHDIR.1 SB-POSIX-TESTS::CHDIR.2 SB-POSIX-TESTS::CHDIR.3
 SB-POSIX-TESTS::CHDIR.4 SB-POSIX-TESTS::CHDIR.5 SB-POSIX-TESTS::CHDIR.6
 SB-POSIX-TESTS::CHDIR.7 SB-POSIX-TESTS::CHDIR.8 SB-POSIX-TESTS::CHDIR.ERROR.1
 SB-POSIX-TESTS::CHDIR.ERROR.2 SB-POSIX-TESTS::MKDIR.1 SB-POSIX-TESTS::MKDIR.2
 SB-POSIX-TESTS::MKDIR.ERROR.1 SB-POSIX-TESTS::MKDIR.ERROR.2
 SB-POSIX-TESTS::MKDIR.ERROR.3 SB-POSIX-TESTS::RMDIR.1 SB-POSIX-TESTS::RMDIR.2
 SB-POSIX-TESTS::RMDIR.ERROR.1 SB-POSIX-TESTS::RMDIR.ERROR.2
 SB-POSIX-TESTS::RMDIR.ERROR.3 SB-POSIX-TESTS::RMDIR.ERROR.4
 SB-POSIX-TESTS::RMDIR.ERROR.5 SB-POSIX-TESTS::STAT.3 SB-POSIX-TESTS::STAT.5
 SB-POSIX-TESTS::STAT.ERROR.1 SB-POSIX-TESTS::STAT.ERROR.2
 SB-POSIX-TESTS::STAT-MODE.1 SB-POSIX-TESTS::STAT-MODE.3
 SB-POSIX-TESTS::STAT-MODE.4 SB-POSIX-TESTS::STAT-MODE.5
 SB-POSIX-TESTS::STAT-MODE.6 SB-POSIX-TESTS::FILENAME-DESIGNATOR.1
 SB-POSIX-TESTS::OPEN.1 SB-POSIX-TESTS::OPEN.ERROR.1 SB-POSIX-TESTS::FCNTL.1
 SB-POSIX-TESTS::FCNTL.FLOCK.1 SB-POSIX-TESTS::FCNTL.FLOCK.2
 SB-POSIX-TESTS::OPENDIR.1 SB-POSIX-TESTS::READDIR.1 SB-POSIX-TESTS::PWENT.1
 SB-POSIX-TESTS::PWENT.2 SB-POSIX-TESTS::PWENT.NON-EXISTING
 SB-POSIX-TESTS::GRENT.1 SB-POSIX-TESTS::GRENT.2
 SB-POSIX-TESTS::GRENT.NON-EXISTING SB-POSIX-TESTS::READLINK.1
 SB-POSIX-TESTS::READLINK.2 SB-POSIX-TESTS::READLINK.ERROR.1
 SB-POSIX-TESTS::READLINK.ERROR.2 SB-POSIX-TESTS::READLINK.ERROR.3
 SB-POSIX-TESTS::READLINK.ERROR.4 SB-POSIX-TESTS::READLINK.ERROR.5
 SB-POSIX-TESTS::READLINK.ERROR.6 SB-POSIX-TESTS::READLINK.ERROR.7
 SB-POSIX-TESTS::GETCWD.1 SB-POSIX-TESTS::MKSTEMP.1 SB-POSIX-TESTS::MKDTEMP.1
 SB-POSIX-TESTS::MKTEMP.1 SB-POSIX-TESTS::MKSTEMP.NULL-TERMINATE
 SB-POSIX-TESTS::ENVSTUFF
No tests failed.
T

My *features*:

(:ASDF :SB-THREAD :ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB
 :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS
 :IEEE-FLOATING-POINT :X86-64 :UNIX :MACH-O :BSD :DARWIN
 :MACH-EXCEPTION-HANDLER :SB-LUTEX :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD
 :C-STACK-IS-CONTROL-STACK :LINKAGE-TABLE :COMPARE-AND-SWAP-VOPS
 :UNWIND-TO-FRAME-AND-CALL-VOP :RAW-INSTANCE-INIT-VOPS
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :COMPLEX-FLOAT-VOPS :FLOAT-EQL-VOPS :INLINE-CONSTANTS
 :OS-PROVIDES-DLOPEN :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC
 :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-SUSECONDS-T)

Revision history for this message
Nikolaus Demmel (nikolaus) wrote :

Luís' patch seems to fix the failing posix tests over here, too. Tested with sbcl 1.0.34.10 on Mac OS X 10.6.2 with x86-32 and x86-64.

Without the patch on x86-64 the failing tests were:

SB-POSIX-TESTS::MKDIR.ERROR.2
SB-POSIX-TESTS::RMDIR.ERROR.3
SB-POSIX-TESTS::READDIR.1

on x86-32:

SB-POSIX-TESTS::MKDIR.ERROR.2
SB-POSIX-TESTS::RMDIR.ERROR.3

With the patch no tests fail (unexpextadly) during the build.

(I havent looked at the patch though and dont know whether its the "right thing to do").

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Is 10.6 still unhappy with SB-POSIX, or can this be closed?

Revision history for this message
Si (simon-mintsource) wrote :

Just built cvs 1.0.37.56 and Luís Oliveira's patch is still needed for successful compile.

Any chance of getting it reviewed / merged? +1 from my perspective.

Revision history for this message
Nikolaus Demmel (nikolaus) wrote :

Same here on OS X 10.6 with 1.0.37.59.
Without Luis patch some posix tests fail.

Revision history for this message
Andreas Eriksen (andreer) wrote :

This problem still exists with 10.0.38 (On Mac OS X 10.6.3).

Attaching an updated version of Luís Oliveira patch that seems to work.
Would be great if we could get this fixed for the next version.

Revision history for this message
Nikolaus Demmel (nikolaus) wrote :

Still fails here, too, though only for the 64 bit build. 32 bit build seems to work fine without the patch.

Revision history for this message
Cyrus Harmon (ch-launchpad) wrote :

luis' patch looks like the right thing. But can somebody explain the encoding bit to me?

Revision history for this message
Cyrus Harmon (ch-launchpad) wrote :

luis' patch is committed and the encoding bit even makes the sb-posix tests pass when the darwin-langinfo shim is removed, but that should be a separate bug.

Changed in sbcl:
status: New → Fix Committed
assignee: nobody → Cyrus Harmon (ch-launchpad)
Revision history for this message
Luís Oliveira (luismbo) wrote :

On Fri, Jun 11, 2010 at 11:55 PM, Cyrus Harmon
<email address hidden> wrote:
> luis' patch is committed and the encoding bit even makes the sb-posix
> tests pass when the darwin-langinfo shim is removed, but that should be
> a separate bug.

Oops, the encoding bit seems to mask the root cause.

CL-USER> (let ((dir (sb-posix:opendir "/"))
               (sb-alien::*default-c-string-external-format* :latin-1))
           (unwind-protect
                (block dir-loop
                  (loop for dirent = (sb-posix:readdir dir)
                        until (sb-alien:null-alien dirent)
                        when (not (stringp (print
(sb-posix:dirent-name dirent))))
                          do (return-from dir-loop nil)
                        finally (return t)))
             (sb-posix:closedir dir)))

"."
"dbfseventsd"
" # ¤¬ "
" $"
""
""
"ee"
"00"
"I#"
""
"00"
"ores"
""
"eveloper"
"D#"
"ome"
""
""
" ("
"etwork"
""
"rivate"
""
""
""
"ser Guides And Information"
"nd Information"
""
"ar"
"olumes"
""
T

FWIW, Osicat's OSICAT-POSIX:READDIR works fine, but it calls
readdir_r() indirectly through a C wrapper.

--
Luís Oliveira
http://r42.eu/~luis/

Changed in sbcl:
status: Fix Committed → Fix Released
Revision history for this message
Roman Marynchak (roman-marynchak) wrote :

There seems to be an issue with this again.

On OS X 10.7.3 x86-64, I see the next failure (also, please note that it is enough to put back the trick which was removed in 1.0.39.12 from posix-tests.lisp, and the test will pass):

Test SB-POSIX-TESTS::READDIR.1 failed
Form: (LET ((SB-POSIX-TESTS::DIR (SB-POSIX:OPENDIR "/")))
        (UNWIND-PROTECT
            (BLOCK SB-POSIX-TESTS::DIR-LOOP
              (LOOP SB-POSIX-TESTS::FOR SB-POSIX-TESTS::DIRENT = (SB-POSIX:READDIR
                                                                  SB-POSIX-TESTS::DIR)
                    SB-POSIX-TESTS::UNTIL (NULL-ALIEN SB-POSIX-TESTS::DIRENT)
                    WHEN (NOT
                          (STRINGP
                           (SB-POSIX:DIRENT-NAME SB-POSIX-TESTS::DIRENT)))
                    DO (RETURN-FROM SB-POSIX-TESTS::DIR-LOOP NIL)
                    SB-POSIX-TESTS::FINALLY (RETURN T)))
          (SB-POSIX:CLOSEDIR SB-POSIX-TESTS::DIR)))
Expected value: T
Actual value: #<SB-INT:C-STRING-DECODING-ERROR {1006616193}>.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.