Thread overview | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
November 03, 2019 Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Glad to announce D 2.089.0, ♥ to the 44 contributors. This release comes with corrected extern(C) mangling in mixin templates, atomicFetchAdd and atomicFetchSub in core.atomic, support for link driver arguments, better support of LDC in dub, and plenty of other bug fixes and improvements. http://dlang.org/download.html http://dlang.org/changelog/2.089.0.html -Martin |
November 04, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:
> Glad to announce D 2.089.0, ♥ to the 44 contributors.
>
> This release comes with corrected extern(C) mangling in mixin templates, atomicFetchAdd and atomicFetchSub in core.atomic, support for link driver arguments, better support of LDC in dub, and plenty of other bug fixes and improvements.
>
> http://dlang.org/download.html
> http://dlang.org/changelog/2.089.0.html
>
> -Martin
Something has changed with core.atomic.cas - it used to work with `null` as the `ifThis` argument, now it throws an AV. Is this intentional?
If I use `cast(shared)null` it doesn't throw but if the change was deliberate shouldn't it be mentioned?
|
November 04, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Chapman Attachments:
| On Mon., 4 Nov. 2019, 2:05 am John Chapman via Digitalmars-d-announce, < digitalmars-d-announce@puremagic.com> wrote: > On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote: > > Glad to announce D 2.089.0, ♥ to the 44 contributors. > > > > This release comes with corrected extern(C) mangling in mixin templates, atomicFetchAdd and atomicFetchSub in core.atomic, support for link driver arguments, better support of LDC in dub, and plenty of other bug fixes and improvements. > > > > http://dlang.org/download.html http://dlang.org/changelog/2.089.0.html > > > > -Martin > > Something has changed with core.atomic.cas - it used to work with `null` as the `ifThis` argument, now it throws an AV. Is this intentional? > > If I use `cast(shared)null` it doesn't throw but if the change was deliberate shouldn't it be mentioned? > Changes were made because there were a lot of problems with that module... but the (reasonably comprehensive) unit tests didn't reveal any such regressions. We also build+test many popular OSS projects via buildkite, and there weren't problems. Can you show the broken code? > |
November 05, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On Tuesday, 5 November 2019 at 06:44:29 UTC, Manu wrote:
> On Mon., 4 Nov. 2019, 2:05 am John Chapman via Digitalmars-d-announce, < digitalmars-d-announce@puremagic.com> wrote:
>
>> Something has changed with core.atomic.cas - it used to work with `null` as the `ifThis` argument, now it throws an AV. Is this intentional?
>>
>> If I use `cast(shared)null` it doesn't throw but if the change was deliberate shouldn't it be mentioned?
>>
>
> Changes were made because there were a lot of problems with that module...
> but the (reasonably comprehensive) unit tests didn't reveal any such
> regressions. We also build+test many popular OSS projects via buildkite,
> and there weren't problems.
> Can you show the broken code?
Sure - this AVs on DMD 2.088 Windows:
import core.atomic;
void main() {
Object a, b = new Object;
cas(cast(shared)&a, null, cast(shared)b);
}
|
November 05, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Chapman | On Tuesday, 5 November 2019 at 07:52:12 UTC, John Chapman wrote:
>
> Sure - this AVs on DMD 2.088 Windows:
>
> import core.atomic;
> void main() {
> Object a, b = new Object;
> cas(cast(shared)&a, null, cast(shared)b);
> }
Sorry, I meant it AVs 2.089, but works on 2.088.
|
November 05, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Chapman | On Mon, Nov 4, 2019 at 11:55 PM John Chapman via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote: > > On Tuesday, 5 November 2019 at 06:44:29 UTC, Manu wrote: > > On Mon., 4 Nov. 2019, 2:05 am John Chapman via Digitalmars-d-announce, < digitalmars-d-announce@puremagic.com> wrote: > > > >> Something has changed with core.atomic.cas - it used to work with `null` as the `ifThis` argument, now it throws an AV. Is this intentional? > >> > >> If I use `cast(shared)null` it doesn't throw but if the change was deliberate shouldn't it be mentioned? > >> > > > > Changes were made because there were a lot of problems with > > that module... > > but the (reasonably comprehensive) unit tests didn't reveal any > > such > > regressions. We also build+test many popular OSS projects via > > buildkite, > > and there weren't problems. > > Can you show the broken code? > > Sure - this AVs on DMD 2.088 Windows: > > import core.atomic; > void main() { > Object a, b = new Object; > cas(cast(shared)&a, null, cast(shared)b); > } Oh... a class. Yeah, that's an interesting case that I actually noted had a low testing surface area. It's also theoretically broken; despite what's practical, I think it's improperly spec-ed that shared classes can be used with atomics. With a struct, you can declare `shared(T)* s_ptr`, but with classes you can only `shared(C) c_ptr`, where the difference is that `s_ptr` can be read/written... but `c_ptr` is typed such that the pointer itself is shared (because classes are implicitly a pointer), so that `c_ptr` can't be safely read/write-able... So, I actually think that atomic API is mal-formed, and it should not support `shared` arguments, but I tried to preserve existing behaviour, while being more strict about what is valid. I obviously missed something with `null` here. Incidentally, in your sample above there, `a` and `b` are not shared... why not just write: `cas(&a, null, b);` ?? If source data is not shared, you shouldn't cast to shared. |
November 05, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
> Incidentally, in your sample above there, `a` and `b` are not shared... why not just write: `cas(&a, null, b);` ?? If source data is not shared, you shouldn't cast to shared.
Because casts were needed in 2.088 and earlier and I just updated to 2.089, unaware of the API change. Should I log `null` not working as a bug?
|
November 05, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Chapman | On Tue, Nov 5, 2019 at 1:20 PM John Chapman via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote: > > On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote: > > Incidentally, in your sample above there, `a` and `b` are not shared... why not just write: `cas(&a, null, b);` ?? If source data is not shared, you shouldn't cast to shared. > > Because casts were needed in 2.088 and earlier and I just updated to 2.089, unaware of the API change. Should I log `null` not working as a bug? Yes |
November 05, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
On Tue, Nov 5, 2019 at 5:14 PM Manu <turkeyman@gmail.com> wrote:
>
> On Tue, Nov 5, 2019 at 1:20 PM John Chapman via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> >
> > On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
> > > Incidentally, in your sample above there, `a` and `b` are not shared... why not just write: `cas(&a, null, b);` ?? If source data is not shared, you shouldn't cast to shared.
> >
> > Because casts were needed in 2.088 and earlier and I just updated to 2.089, unaware of the API change. Should I log `null` not working as a bug?
>
> Yes
But I also think you should update your code to not perform the casts. Can you confirm that the null works when removing the shared casts?
|
November 06, 2019 Re: Release D 2.089.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Chapman | On Tuesday, 5 November 2019 at 07:52:12 UTC, John Chapman wrote: > On Tuesday, 5 November 2019 at 06:44:29 UTC, Manu wrote: >> On Mon., 4 Nov. 2019, 2:05 am John Chapman via Digitalmars-d-announce, < digitalmars-d-announce@puremagic.com> wrote: >> >>>[...] >> >> Changes were made because there were a lot of problems with that module... >> but the (reasonably comprehensive) unit tests didn't reveal any such >> regressions. We also build+test many popular OSS projects via buildkite, >> and there weren't problems. >> Can you show the broken code? > > Sure - this AVs on DMD 2.088 Windows: > > import core.atomic; > void main() { > Object a, b = new Object; > cas(cast(shared)&a, null, cast(shared)b); > } There are some bugs in cas. See here: https://issues.dlang.org/show_bug.cgi?id=20354 https://issues.dlang.org/show_bug.cgi?id=20355 |
Copyright © 1999-2021 by the D Language Foundation