pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Daniel Gustafsson <daniel@yesql.se>
Subject: Re: Bring atomic flag fallback up to snuff
Date: Sat, 07 Apr 2018 14:07:05 -0400
Message-ID: <7223.1523124425@sss.pgh.pa.us> (raw)
In-Reply-To: <20180406233854.uni2h3mbnveczl32@alap3.anarazel.de>
References: <20180406233854.uni2h3mbnveczl32@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> As Daniel pointed out in:
> https://postgr.es/m/FB948276-7B32-4B77-83E6-D00167F8EEB4@yesql.se the
> pg_atomic_flag fallback implementation is broken.  That has gone
> unnoticed because the fallback implementation wasn't testable until now:
> ...
> The attached fixes the bug and removes the edge-cases by storing a value
> separate from the semaphore. I should have done that from the start.
> This is an ABI break, but given the fallback didn't work at all, I don't
> think that's a problem for backporting.

> Fix attached. Comments?

pademelon says it's wrong.

2018-04-07 13:39:34.982 EDT [1197:89] pg_regress/lock LOG:  statement: SELECT test_atomic_ops();
TRAP: UnalignedPointer("(((uintptr_t) ((uintptr_t)(ptr)) + ((sizeof(*ptr)) - 1)) & ~((uintptr_t) ((sizeof(*ptr)) - 1))) != (uintptr_t)(ptr)", File: "../../../src/include/port/atomics.h", Line: 177)


			regards, tom lane




view thread (8+ messages)  latest in thread

Message-ID: <7223.1523124425@sss.pgh.pa.us>
Permalink:  ../7223.1523124425@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7223.1523124425@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, daniel@yesql.se
  Subject: Re: Bring atomic flag fallback up to snuff
  In-Reply-To: <7223.1523124425@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox