Bug 20359 – core.atomic.cas throws with null as `ifThis`

Status
NEW
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2019-11-06T07:29:33Z
Last change time
2024-12-07T13:39:46Z
Assigned to
No Owner
Creator
John Chapman
Moved to GitHub: dmd#17392 →

Comments

Comment #0 by johnch_atms — 2019-11-06T07:29:33Z
The following code produces an access violation in the 2.089.0 release: import core.atomic; void main() { Object a, b = new Object; cas(&a, null, b); } If you cast everything to shared - cas(cast(shared)&a, cast(shared)null, cast(shared)b) - it works as expected. Also if you pass an instantiated object to the `ifThis` argument, it will also work correctly.
Comment #1 by john.michael.hall — 2019-11-06T16:00:48Z
Writing cas(cast(shared)&a, null, cast(shared)b); also causes an error.
Comment #2 by Jesse.K.Phillips+D — 2020-02-02T02:32:19Z
This is happening for the linux builds as well. https://travis-ci.org/MartinNowak/io
Comment #3 by schveiguy — 2020-02-02T03:06:25Z
Jesse, looking at those logs, looks like it has something to do with the ddox publishing. I'm not sure exactly why every job is trying to publish the documentation, I'll have to take a look. But I think we worked around this issue already in the io package.
Comment #4 by Jesse.K.Phillips+D — 2020-02-02T03:57:24Z
The errors from the latest compiler look similar to the pipeline error on my project which does no do ddoc https://gitlab.com/jessephillips/devarticlator/-/jobs/423011838
Comment #5 by schveiguy — 2020-02-02T04:50:24Z
OK, I see in the "allowed failure" logs. Rereading my notes for the release, the CAS problem I fixed was related to LDC, not this bug. Sorry for the confusion.
Comment #6 by robert.schadek — 2024-12-07T13:39:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17392 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB