Thread overview
[Issue 22986] Phobos cannot be compiled with dip1008
Apr 04, 2022
Adam D. Ruppe
Apr 06, 2022
Sebastiaan Koppe
Apr 27, 2022
Dlang Bot
Apr 27, 2022
Dlang Bot
May 23, 2022
Dlang Bot
Jul 13, 2022
Dlang Bot
Aug 03, 2022
Dlang Bot
Dec 17, 2022
Iain Buclaw
April 04, 2022
https://issues.dlang.org/show_bug.cgi?id=22986

Adam D. Ruppe <destructionator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator@gmail.com

--- Comment #1 from Adam D. Ruppe <destructionator@gmail.com> ---
@nogc is too restrictive and all these hoops we jump through to enable it is reducing the overall quality of D. Would be better if it focused on avoiding leaks outside a function than avoiding all allocations, then as long as you pair your news with deletes, you'd be ok.

Anyway, cloning an exception is not easy, you're liable to have random problems with that (remember exceptions are not necessarily allocated with `new` in any case... so if it was malloc'd and you didn't free it, you're in some trouble, but this perhaps rare enough to ignore).

I guess you could check the RTTI and bit copy back out the GC upon escaping, and just hope it doesn't have any references to itself. A virtual clone function that can be overridden but whose default digs typeinfo out to work in the general case perhaps would let you escape.

Might be worth experimenting with that.

--
April 06, 2022
https://issues.dlang.org/show_bug.cgi?id=22986

Sebastiaan Koppe <mail@skoppe.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mail@skoppe.eu

--- Comment #2 from Sebastiaan Koppe <mail@skoppe.eu> ---
(In reply to RazvanN from comment #0)
> Phobos exceptions sometimes escape their catch block, however, dip1008 does not allow that. One example: https://github.com/dlang/phobos/blob/master/std/parallelism.d#L3770 . However, there are others, just try to compile phobos with dip1008.

This is not a phobos problem, in multithreaded application you will inevitably carry exceptions from one thread to another.

DIP 1008 is flawed in that respect.

There is also the problem that it is hard to detect statically allocated exceptions, so you end up cloning more than you strictly need to.

--
April 27, 2022
https://issues.dlang.org/show_bug.cgi?id=22986

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@chloekek updated dlang/phobos pull request #8440 "Mark ErrnoException.errno as scope" mentioning this issue:

- Issue 22986: Mark ErrnoException.errno as scope

  This allows retrieval of the error number when compiling with -dip1008.

https://github.com/dlang/phobos/pull/8440

--
April 27, 2022
https://issues.dlang.org/show_bug.cgi?id=22986

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #8440 "Issue 22986: Mark ErrnoException.errno as scope" was merged into master:

- 5a36a8c6c97dcafe700ba12c5c2f8f8e4c4e34d2 by chloekek:
  Issue 22986: Mark ErrnoException.errno as scope

  This allows retrieval of the error number when compiling with -dip1008.

https://github.com/dlang/phobos/pull/8440

--
May 23, 2022
https://issues.dlang.org/show_bug.cgi?id=22986

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@tchaloupka updated dlang/phobos pull request #8467 "Fix 23132 - Avoid ranges copy when compared for equality" mentioning this issue:

- Issue 22986: Mark ErrnoException.errno as scope

  This allows retrieval of the error number when compiling with -dip1008.

https://github.com/dlang/phobos/pull/8467

--
July 13, 2022
https://issues.dlang.org/show_bug.cgi?id=22986

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
@pbackus updated dlang/phobos pull request #8507 "Fix 23245, 23246 - std.format regressions" mentioning this issue:

- Issue 22986: Mark ErrnoException.errno as scope

  This allows retrieval of the error number when compiling with -dip1008.

https://github.com/dlang/phobos/pull/8507

--
August 03, 2022
https://issues.dlang.org/show_bug.cgi?id=22986

--- Comment #7 from Dlang Bot <dlang-bot@dlang.rocks> ---
@RubyTheRoobster updated dlang/phobos pull request #8525 "fix issue 23140" mentioning this issue:

- Issue 22986: Mark ErrnoException.errno as scope

  This allows retrieval of the error number when compiling with -dip1008.

https://github.com/dlang/phobos/pull/8525

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=22986

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--