Ah, sorry I forgot to reply.

The rmdir seems good to me.

I've been doing further testing and with just the upstream patches I
occasionally get the test errors but not always so there seems to be something
there. In addition I have tried to resurrect my futex patch. With following
tweaks it compiles:

In sb-concurrency tests I reduced test-mailbox-producers-consumer test sleep to 
0.001 

In threads.pure.lisp, remove openbsd from fails-on list on "wait-on-semaphore
semaphore-notification :lp-1038034" as futexes are enabled.

With above I got following test failure:
 Failure:            threads.pure.lisp / WITHOUT-INTERRUPTS+CONDITION-WAIT
 Expected failure:   threads.pure.lisp / (WAIT-ON-SEMAPHORE 
SEMAPHORE-NOTIFICATION LP-1038034)
 Skipped (broken):   compiler.impure.lisp / BUG-308921

I really don't have ideas how to proceed debugging the timing issues.

Heres the updated futex patch:

$OpenBSD$

add futex support

Index: src/runtime/bsd-os.c
--- src/runtime/bsd-os.c.orig
+++ src/runtime/bsd-os.c
@@ -86,6 +86,11 @@ static void dragonfly_init();
 #ifdef LISP_FEATURE_X86
 #include <machine/cpu.h>
 #endif
+#if defined(LISP_FEATURE_SB_THREAD) && defined(LISP_FEATURE_SB_FUTEX) \
+    && !defined(LISP_FEATURE_SB_PTHREAD_FUTEX)
+#include <sys/time.h>
+#include <sys/futex.h>
+#endif
 
 static void openbsd_init();
 #endif
@@ -690,7 +695,45 @@ os_dlsym(void *handle, const char *symbol)
     return ret;
 }
 
+#if defined(LISP_FEATURE_SB_THREAD) && defined(LISP_FEATURE_SB_FUTEX) \
+    && !defined(LISP_FEATURE_SB_PTHREAD_FUTEX)
+
+int
+futex_wait(int *lock_word, int oldval, long sec, unsigned long usec)
+{
+    struct timespec timeout;
+    int ret;
+
+    if (sec < 0) {
+        ret = futex(lock_word, FUTEX_WAIT, oldval, NULL, NULL);
+    }
+    else {
+        timeout.tv_sec = sec;
+        timeout.tv_nsec = usec * 1000;
+        ret = futex(lock_word, FUTEX_WAIT, oldval, &timeout, NULL);
+    }
+
+    switch (ret) {
+    case 0:
+        return 0;
+    case ETIMEDOUT:
+        return 1;
+    case EINTR:
+        return 2;
+    default:
+        /* EWOULDBLOCK and others, need to check the lock */
+        return -1;
+    }
+}
+
+int
+futex_wake(int *lock_word, int n)
+{
+    return (futex(lock_word, FUTEX_WAKE, n, NULL, NULL));
+}
+
 #endif
+#endif /* __OpenBSD__ */
 
 #if defined(LISP_FEATURE_SB_WTIMER) && !defined(LISP_FEATURE_DARWIN)
 /*

Josh Elsasser <j...@elsasser.org> writes:

> On Thu, Jan 02, 2020 at 08:14:10PM +0200, Timo Myyrä wrote:
>
>> Solene Rapenne <sol...@perso.pw> writes:
>> 
>> > On Wed, Jan 01, 2020 at 07:00:45PM +0200, Timo Myyrä wrote:
>> >
>> >> Hi,
>> >> 
>> >> Here's an attempt to update sbcl to latest version.
>> >> Before adding the new patch I got consistent test failures in inpure 
>> >> timer test
>> >> "(:WITH-TIMEOUT :MANY-AT-THE-SAME-TIME".
>> >> 
>> >> After adding the patch to unix.lisp the tests have passed twice on amd64.
>> >> Does this look OK, does the tests work on other platforms?
>> >> 
>> >> Timo
>> >> 
>> >
>> > I'm ok and will commit it if maintainer is ok too
>> 
>> Heres revised diff with upstream backports. I still think we're better off
>> waiting next release so we don't have to include these patches but it can't 
>> hurt
>> to test these to see they indeed fix the issue.
>> 
>> Tested clisp bootstrapped on amd64 and tests passed.
>> 
>> timo
>
> I sent a reply a few days ago but it's gone missing, so let's try again.
>
> The timing-related tests can be a bit fragile, I think the
> gettimeofday() change is only hiding a heisenbug in the tests for
> you. Personally, I think this is a test bug and not a real sbcl
> problem and isn't really worth patching.
>      
> Additionally, you've added an empty html doc directory to the
> PLIST. How about this, which rmdir's the directory so it doesn't get
> re-added? I've tested and i386/macppc test results aren't worse.
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/lang/sbcl/Makefile,v
> retrieving revision 1.43
> diff -u -r1.43 Makefile
> --- Makefile  16 Sep 2019 06:24:18 -0000      1.43
> +++ Makefile  2 Jan 2020 18:00:11 -0000
> @@ -6,7 +6,7 @@
>  
>  COMMENT=             compiler and runtime system for ANSI Common Lisp
>  
> -V =                  1.5.5
> +V =                  2.0.0
>  DISTNAME=            sbcl-${V}-source
>  PKGNAME=             sbcl-${V}
>  WRKDIST=             ${WRKDIR}/sbcl-${V}
> @@ -82,6 +82,7 @@
>  
>  post-install:
>       chown -R 0:0 ${PREFIX}/lib/sbcl
> +     rmdir ${PREFIX}/share/doc/sbcl/html
>  
>  do-test:
>       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} DONT_CLEAN_SBCL_CONTRIB=1 \
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/lang/sbcl/distinfo,v
> retrieving revision 1.18
> diff -u -r1.18 distinfo
> --- distinfo  16 Sep 2019 06:24:18 -0000      1.18
> +++ distinfo  2 Jan 2020 18:00:11 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (sbcl-1.5.5-source.tar.bz2) = 
> y0f65qhvDFxXQxYE+05fEcioI/lM4SjVaLh3D8W8quI=
> -SIZE (sbcl-1.5.5-source.tar.bz2) = 6351480
> +SHA256 (sbcl-2.0.0-source.tar.bz2) = 
> kDaSVoBdQ3yCq5vauaQQB29XgQpQuysijeTmyJJpL88=
> +SIZE (sbcl-2.0.0-source.tar.bz2) = 6457217

Reply via email to