Bug 12661 – [REG2.066a] std.regex with -debug causes linker errors
Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-04-27T03:59:00Z
Last change time
2014-06-20T16:35:47Z
Keywords
link-failure, pull
Assigned to
nobody
Creator
jiki
Comments
Comment #0 by jiki — 2014-04-27T03:59:45Z
This must be caused by one of the recent std.regex chages.
import std.regex;
void main() {
auto re = regex(`a`);
}
COMMAND:
dmd -debug reg2066regex.d
OUTPUT:
Error 42: Symbol Undefined _D3std3uni38__T13InversionListTS3std3uni8GcPolicyZ13InversionList11addIntervalMFNaNeiikZk
reg2066regex.obj(reg2066regex)
Error 42: Symbol Undefined _D3std3uni38__T13InversionListTS3std3uni8GcPolicyZ13InversionList8dropUpToMFNaNekkZk
reg2066regex.obj(reg2066regex)
Error 42: Symbol Undefined _D3std3uni38__T13InversionListTS3std3uni8GcPolicyZ13InversionList8skipUpToMFNaNekkZk
ENVIRONMENT:
Windows 7 64bit
Comment #1 by andrej.mitrovich — 2014-04-27T08:21:10Z
Confirmed.
Comment #2 by andrej.mitrovich — 2014-04-27T08:21:39Z
I suspect it's new bloody @nogc + auto-inference.
So a symbol in phobos is detected as @nogc w/o debug and consequently mangles with 'Ni'. Later in user program it's not-@nogc in debug and mangles differently. Now it should just generate a new instantiation not present in compiled library but somehow it doesn't happen.
Comment #4 by jiki — 2014-04-27T17:54:00Z
I see. Sorry for my mistake.
I inspected it a little.
Exposed by Phobos.lib:
_D3std3uni38__T13InversionListTS3std3uni8GcPolicyZ13InversionList11addIntervalMFNaNbNeiikZk
Needed by user program:
_D3std3uni38__T13InversionListTS3std3uni8GcPolicyZ13InversionList11addIntervalMFNaNeiikZk
Their difference is that the latter lacks 'Nb' aka nothrow.
The same about the three functions.
Comment #5 by jiki — 2014-04-27T18:14:53Z
Finally, I found that std.range.SortedRange.this() breaks the nothrow-ability.
It holds a number of debug statements and some of them may throw.
Therefore, attributes don't match when -debug added.
But I cannot understand why older revisions do work.
Comment #6 by jiki — 2014-04-28T07:18:10Z
(In reply to jiki from comment #5)
> Finally, I found that std.range.SortedRange.this() breaks the
> nothrow-ability.
> It holds a number of debug statements and some of them may throw.
> Therefore, attributes don't match when -debug added.
>
> But I cannot understand why older revisions do work.
This patch is a workaround.
https://github.com/D-Programming-Language/phobos/pull/2132
Comment #7 by jiki — 2014-05-03T07:56:18Z
*** Issue 12695 has been marked as a duplicate of this issue. ***
(In reply to jiki from comment #8)
> (In reply to jiki from comment #6)
> > This patch is a workaround.
> > https://github.com/D-Programming-Language/phobos/pull/2132
>
> Rebased after some wrong operations.
> https://github.com/D-Programming-Language/phobos/pull/2148
It has already merged.
However, with -profile option, the mismatch sneaks back and causes another compile error.
std\range.d(8359): Error: 'std.range.SortedRange!(NamedGroup[], "a.name < b.name").SortedRange.dbgVerifySorted' is not nothrow
It isn't my bad. :-(
Comment #10 by jiki — 2014-05-17T07:30:08Z
(In reply to jiki from comment #9)
> However, with -profile option, the mismatch sneaks back and causes another
> compile error.
>
> std\range.d(8359): Error: 'std.range.SortedRange!(NamedGroup[], "a.name <
> b.name").SortedRange.dbgVerifySorted' is not nothrow
>
> It isn't my bad. :-(
It is another issue.
http://issues.dlang.org/show_bug.cgi?id=10520
So, I close this as FIXED.
Comment #11 by temtaime — 2014-05-17T10:11:20Z
It's workaround not fix. It's a linker error so it may results in other cases too.