[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Aren't spinlocks missing a memory clobber? [Was: ext2fs crashes late
From: |
Thomas Schwinge |
Subject: |
Re: Aren't spinlocks missing a memory clobber? [Was: ext2fs crashes lately] |
Date: |
Sat, 20 Mar 2010 10:23:06 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Sat, Aug 02, 2008 at 02:22:05AM +0100, Samuel Thibault wrote:
> Barry deFreese, le Thu 24 Jul 2008 22:19:16 -0400, a écrit :
> > ext2fs.static:
> > /var/tmp/hurd-20071119/build-tree/hurd/libports/port-ref.c:31:ports_port_ref:
> >
> > Assertion 'pi->refcnt || pi->weakrefcnt' failed.
>
> Quite odd.
>
> I had a closer look at the locking functions, and I noticed that
> spin_*lock() functions do not have a "memory" clobber. In my
> understanding of gcc's behavior, that lets it move memory operations
> outside the critical section, even with the volatile qualifier (which
> just means that the assembly part shouldn't be optimized away). At
> least in all other spinlock implementations I know there is such
> clobber.
>
> That could very well explain the oddity above (as well as other random
> things happening from times to times).
On Sat, Aug 02, 2008 at 01:12:29PM -0700, Roland McGrath wrote:
> Yes, I think there should be memory clobbers. I added them in libc.
commit 4c8ac84562fb039586f0ed91280c7fa79a913029
Author: Roland McGrath <roland@gnu.org>
Date: Sat Aug 2 20:12:08 2008 +0000
2008-08-02 Roland McGrath <roland@frob.com>
* sysdeps/mach/i386/machine-lock.h (__spin_unlock, __spin_try_lock):
Add memory clobbers.
Yet, I just hit that one again:
ext2fs: /var/tmp/hurd-20090404/./libports/port-ref.c:31: ports_port_ref:
Assertion `pi->refcnt || pi->weakrefcnt' failed.
Samuel, I presume that version does include the glibc fix?
Regards,
Thomas
signature.asc
Description: Digital signature
- Re: Aren't spinlocks missing a memory clobber? [Was: ext2fs crashes lately],
Thomas Schwinge <=