[Issue 17231] Function to get name from Tid

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17231

--- Comment #6 from Vladimir Panteleev  ---
(In reply to RazvanN from comment #5)
> I made a PR for that issue and since you closed your PR for this one, I
> thought that marking this one as a duplicate would make more sense.

You may want to wait until your PR is merged before closing the respective
issue. If your PR ends up being closed for whatever reason, then the
"duplicate" issue will likely remain incorrectly closed.

--


[Issue 17643] std.traits.getSymbolsByUDA doesn't work with private attributes

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17643

Vladimir Panteleev  changed:

   What|Removed |Added

   Severity|normal  |regression

--- Comment #4 from Vladimir Panteleev  ---
- Started working with https://github.com/dlang/phobos/pull/3827, which allowed
getSymbolsByUDA to work on private members
- https://github.com/dlang/dmd/pull/5530 caused accessing the field result in a
deprecation, but it still worked (and returned both members)
- https://github.com/dlang/phobos/pull/5344 has broken this completely.

This certainly seems like a regression, but I'm not sure I can put the blame
entirely on either of those PRs.

--


[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650

--- Comment #4 from Vladimir Panteleev  ---
Actually, I believe we do count a breakage as a regression if something breaks
for the end-user, regardless of what is going on under the hood. E.g. it's
possible that for supported architectures, the range violation was completely
benign.

--


[Issue 17651] Segfult when parsing Ddoc ESCAPES macro

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17651

Vladimir Panteleev  changed:

   What|Removed |Added

   Keywords||ice

--


[Issue 17654] New: return value incorrectly considered unique when casting to another pointer type

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17654

  Issue ID: 17654
   Summary: return value incorrectly considered unique when
casting to another pointer type
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Keywords: accepts-invalid
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ag0ae...@gmail.com

Found by Namal in D.learn:
http://forum.dlang.org/post/eqoejftfcptbiclyb...@forum.dlang.org

Original code:

void main()
{
import std.algorithm;
import std.string;
char[] line;
auto bytes = line.representation.dup;
bytes.sort;
string result = bytes.assumeUTF; /* should be rejected */
}


Reduced to show it's a compiler bug:

char[] assumeUTF(ubyte[] str) pure { return cast(char[]) str; }

void main()
{
ubyte[] b = ['a', 'b', 'c'];
string s = assumeUTF(b); /* should be rejected */
assert(s == "abc"); /* passes */
b[0] = '!';
assert(s == "abc"); /* fails */
}


Another variant to show it's not about arrays or the char type:

ubyte* toBytePointer(uint* p) pure { return cast(ubyte*) p; }

void main()
{
uint* i = new uint;
immutable ubyte* b = toBytePointer(i); /* should be rejected */
*i = 0xFF_FF_FF_FF;
assert(*b != 0xFF); /* fails */
}


--


[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650

--- Comment #3 from Vladimir Panteleev  ---
Interesting - looking at the PR, this doesn't really seem like a regression,
rather that the addition of the @safe attribute exposed an out-of-bounds array
access that was always there. Feel free to reclassify, Jon.

--


[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650

--- Comment #2 from Vladimir Panteleev  ---
Introduced in https://github.com/dlang/phobos/pull/5351

--


[Issue 17648] dmd segfault on overload set introspection

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17648

Vladimir Panteleev  changed:

   What|Removed |Added

   Keywords||ice

--


[Issue 14982] nogc inconsistency

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14982

--- Comment #3 from Vladimir Panteleev  ---
Just to confirm, by "fixed" you mean that all three now consistently fail to
compile?

FWIW, the change seems to have been accidental: the second and third function
compiled before and don't compile after https://github.com/dlang/dmd/pull/5271.

--


[Issue 17646] dmd segfaults on missing foreach body in import

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17646

--- Comment #3 from Vladimir Panteleev  ---
FWIW, no segfault before https://github.com/dlang/dmd/pull/708.

--


[Issue 17645] `pure` is transitively applied to all delegates inside a pure function

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17645

--- Comment #2 from Vladimir Panteleev  ---
FWIW, the test case works in DMD 2.013 through 2.027 :)

--


[Issue 17622] [REG2.075.0-b1] Wrong code with appender and -inline

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17622

--- Comment #6 from Vladimir Panteleev  ---
Reduced:

 test.d ///
struct S
{
int i;

this(ubyte)
{
return;
}

void fun()
{
assert(i == 0);
}
}

S make()
{
return S(0);
}

void main()
{
S s = make();

auto rdg =
{
s.fun();
};

s.fun();
}
///

--


[Issue 17622] [REG2.075.0-b1] Wrong code with appender and -inline

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17622

Vladimir Panteleev  changed:

   What|Removed |Added

Summary|inline  for m64 fails web   |[REG2.075.0-b1] Wrong code
   |APPS|with appender and -inline
   Severity|major   |regression

--- Comment #5 from Vladimir Panteleev  ---
This is a regression.

Introduced in https://github.com/dlang/dmd/pull/6852

Partial reduction:

 test.d 
void main()
{
import std.array : appender;

auto content = appender!(ubyte[])();

auto rdg = ()
{
auto x = content.data;
};

content.put(new ubyte[912]);
}


--


[Issue 17622] inline for m64 fails web APPS

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17622

Vladimir Panteleev  changed:

   What|Removed |Added

   Keywords|dll |wrong-code
   Hardware|x86 |All
 OS|Windows |All

--- Comment #4 from Vladimir Panteleev  ---
(In reply to steven kladitis from comment #3)
>  the above fails in -m32 or -m64 when using -inline

Thanks, reprocuded. Reducing.

--


[Issue 12963] posix.mak hardcodes $(CC) as cc on non Windows system

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12963

--- Comment #2 from Vladimir Panteleev  ---
(In reply to Jason King from comment #0)
> This has the effect of hardcoding $CC to cc on non-Win32 systems.

Wait, how so? Can't you just specify CC=... on the make command line to
override it?

(In reply to RazvanN from comment #1)
> If another compiler needs to be used, a different branch can be easily
> added. Closing as invalid

I agree that this should probably be closed by now , as it was filed 3 years
ago and seems like a non-issue with a trivial workaround, but not with your
close reason, as enhancements in makefiles are just as valid enhancement
requests as in the compiler or standard library.

--


[Issue 12867] std.traits.fullyQualifiedName fails on ClassName.staticMember.memberOfStruct

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12867

Vladimir Panteleev  changed:

   What|Removed |Added

 Resolution|WORKSFORME  |DUPLICATE

--- Comment #2 from Vladimir Panteleev  ---
Before  to 2.057  : Failure
  Fixed   by: https://github.com/dlang/phobos/pull/384 - Add PackageName,
ModuleName and FullyQualifiedName traits.
2.058   to 2.060  : Success with output: fooMember
  Broken  by: https://github.com/dlang/phobos/pull/913 -
`std.traits.hasElaborateCopyConstructor` fixes and other
   2.061  : Failure
  Fixed   by: https://github.com/dlang/phobos/pull/1967 - Issue 10502 - Can't
get fullyQualifiedName of a templated struct
Since  2.066.0: Success with output: test.Foo.fooMember

*** This issue has been marked as a duplicate of issue 10502 ***

--


[Issue 10502] Can't get fullyQualifiedName of a templated struct

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10502

Vladimir Panteleev  changed:

   What|Removed |Added

 CC||donny.viszn...@gmail.com

--- Comment #6 from Vladimir Panteleev  ---
*** Issue 12867 has been marked as a duplicate of this issue. ***

--


[Issue 17639] Implicit conversion of bool to float should be rejected

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17639

Vladimir Panteleev  changed:

   What|Removed |Added

   Keywords||accepts-invalid
 Status|RESOLVED|REOPENED
  Component|phobos  |dmd
   Hardware|x86_64  |All
 Resolution|INVALID |---
Summary|std.math.approxEqual|Implicit conversion of bool
   |accepts return of isNaN |to float should be rejected
   |(bool) as argument  |
 OS|Linux   |All

--- Comment #2 from Vladimir Panteleev  ---
(In reply to Simen Kjaeraas from comment #1)
> This bug report basically boils down to this code:
> 
> float f = false;

That doesn't make sense and doesn't seem useful, so let's reopen it as an
accepts-invalid.

--


[Issue 17541] Function attribute deduction depends on compile invocation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17541

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #5 from Walter Bright  ---
https://github.com/dlang/dmd/pull/6995

--


[Issue 17194] [scope] Fwd reference error with nested struct

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17194

Elie Morisse  changed:

   What|Removed |Added

 CC||syniu...@gmail.com
   Hardware|x86_64  |All
 OS|Windows |All

--- Comment #1 from Elie Morisse  ---
It's not specific to nested classes:

struct S {
S2 a;
}

struct S2 {
void foo(scope S s) { }
}

=> Error: struct S no size because of forward reference

Kinda related: issue 17548 was another bogus forward ref error originating from
the same TypeStruct.hasPointers call in TypeFuntion.semantic (but as I
understand it that call isn't the actual problem).

--


[Issue 17653] New: Redefining symbol in separate but identical template namespaces is completely ignored

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17653

  Issue ID: 17653
   Summary: Redefining symbol in separate but identical template
namespaces is completely ignored
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: schvei...@yahoo.com

Not sure whether to mark this rejects-valid or diagnostic.

template foo(T) {
   struct R { int x; }
   auto foo(T t) { return R(1); }
}

template foo(T) {
   struct R { string s; }
   auto foo(T t, bool f) { return R("hi"); }
}

void main()
{
   foo(1);
   foo(1, true);
}

Error: cannot implicitly convert expression ("hi") of type string to int

It appears that the second foo is using the first foo's R to return. However,
if I defined R twice in the same template it would complain. It appears that
the second R is just simply ignored. That shouldn't happen.

--


[Issue 17596] dmd d 2.073.2 and 2.074.1 interim generated dmd segfaults on FreeBSD 12-CURRENT

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17596

Nemanja Boric <4bur...@gmail.com> changed:

   What|Removed |Added

 CC||4bur...@gmail.com

--


[Issue 16856] D does not work on FreeBSD current (what will eventually be 12) due to libunwind

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16856

--- Comment #14 from Nemanja Boric <4bur...@gmail.com> ---
Thank you for writing back and you're very welcome! Thanks for
pointing out to that issue, I'll follow it closely.

--


[Issue 16856] D does not work on FreeBSD current (what will eventually be 12) due to libunwind

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16856

--- Comment #13 from Jonathan M Davis  ---
I confirm that this works with the latest TrueOS, though I expect that it
wouldn't work on the latest FreeBSD 12, because of the 64-bit inode issue
(whereas even though TrueOS is based on FreeBSD CURRENT, it hasn't pulled in
those changes yet precisely because of the breakage that they cause). That's a
separate bug though: bug #17596.

Thanks!

--


[Issue 17541] Function attribute deduction depends on compile invocation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17541

Steven Schveighoffer  changed:

   What|Removed |Added

   Keywords||wrong-code

--


[Issue 17541] Function attribute deduction depends on compile invocation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17541

--- Comment #4 from johanenge...@weka.io ---
This problem is bigger than just templates.
I am seeing more and more deduction errors, resulting in linker errors.

--


[Issue 17541] Function attribute deduction depends on compile invocation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17541

johanenge...@weka.io changed:

   What|Removed |Added

Summary|Template attribute  |Function attribute
   |deduction depends on|deduction depends on
   |compile invocation  |compile invocation

--


[Issue 16232] std.experimental.logger.core.sharedLog isn't thread-safe

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16232

ag0ae...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #6 from ag0ae...@gmail.com ---
(In reply to Robert Schadek from comment #3)
> I will add a comment to make that clear

Reopening. I think a comment isn't enough. sharedLog is marked as @safe, but it
effectively casts shared away, which isn't safe. It can lead to memory
corruption when shared data can be accessed as unshared.

I see two ways out:
1) Make sharedLog @system.
2) Return a shared Logger.

Lengthy example of @safe violation with custom Logger:


import std.experimental.logger.core: Logger, LogLevel, sharedLog;

class MyLogger : Logger
{
ulong* p;

this() @safe
{
super(LogLevel.all);

/* Allocate a ulong that disrespects cache line boundaries (64 bytes),
so that it won't be loaded/stored atomically. */
align(64) static struct S
{
align(1):
ubyte[60] off;
ulong x = 0;
}
auto s = new S;
this.p = 
assert((cast(size_t) p) % 64 == 60);
assert((cast(size_t) p) % s.x.sizeof == 4);
}

override void writeLogMsg(ref LogEntry payload) @safe { assert(false); }
/* never called */
}

MyLogger sharedMyLogger() @safe
{
Logger logger = sharedLog();
return cast(MyLogger) logger;
/* This is a simple downcast. Not casting away shared. */
}

enum n = 1_000_000;

/* Toggle *p between 0 and ulong.max (n times). */
void write(ulong* p) @safe
{
foreach (i; 0 .. n) *p = ~*p; /* non-atomic load and store */
}

/* Assert that *p is either 0 or ulong.max (n times). */
void read(ulong* p) @safe
{
import std.conv: to;

foreach (i; 0 .. n)
{
ulong val = *p; /* non-atomic load */
assert(val == 0 || val == ulong.max, val.to!string(16)); /* fails */
}
}

void main()
{
sharedLog = new MyLogger;

/* Read and write concurrently. `read` will see a partially written value.
I.e., memory corruption. */
import core.thread: Thread;
new Thread(() @safe { write(sharedMyLogger.p); }).start();
read(sharedMyLogger.p);
}


--


[Issue 17652] New: [DIP1000] opApply allow to escape reference to scope variable

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17652

  Issue ID: 17652
   Summary: [DIP1000]  opApply allow to escape reference to scope
variable
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: safe
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: mathias.l...@sociomantic.com

```
void main () @safe @nogc
{
Object o = leak();
assert(o !is null);
}

Object leak () @safe @nogc
{
Foo f;
foreach (object; f)
if (object !is null)
return object;
return null;
}

struct Foo
{
alias DgType = int delegate (scope Object) @safe @nogc;
public int opApply (scope DgType dg) @safe @nogc
{
scope o = new Object;
return dg(o);
}
}
```

The compiler doesn't properly check the type of the delegate it passes to
`opApply`, allowing to pass a delegate which needs a non-scope parameter.

--


[Issue 17231] Function to get name from Tid

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17231

--- Comment #5 from RazvanN  ---
I made a PR for that issue and since you closed your PR for this one, I thought
that marking this one as a duplicate would make more sense.

--


[Issue 17231] Function to get name from Tid

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17231

Jack Stouffer  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|DUPLICATE   |---

--- Comment #4 from Jack Stouffer  ---
(In reply to RazvanN from comment #3)
> This is a duplicate of Issue 17234
> 
> *** This issue has been marked as a duplicate of issue 17234 ***

This issue was made a day before that other one.

--


[Issue 17231] Function to get name from Tid

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17231

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |DUPLICATE

--- Comment #3 from RazvanN  ---
This is a duplicate of Issue 17234

*** This issue has been marked as a duplicate of issue 17234 ***

--


[Issue 17234] access to registered thread names

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17234

RazvanN  changed:

   What|Removed |Added

 CC||j...@jackstouffer.com

--- Comment #2 from RazvanN  ---
*** Issue 17231 has been marked as a duplicate of this issue. ***

--


[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650

Martin Nowak  changed:

   What|Removed |Added

 CC||c...@dawg.eu

--- Comment #1 from Martin Nowak  ---
We'll address this with 2.075.1 to not delay the release even further.

--


[Issue 17234] access to registered thread names

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17234

RazvanN  changed:

   What|Removed |Added

 CC||razvan.nitu1...@gmail.com

--- Comment #1 from RazvanN  ---
PR : https://github.com/dlang/phobos/pull/5609

--


[Issue 17632] [REG 2.075-b1] opBinary and delegate code generation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17632

Martin Nowak  changed:

   What|Removed |Added

   Priority|P1  |P3
 CC||c...@dawg.eu

--- Comment #2 from Martin Nowak  ---
We'll address this with 2.075.1 to not delay the release even further.

--


[Issue 17601] [REG2.075.0-b1] segmentation fault for dmd -deps

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17601

Martin Nowak  changed:

   What|Removed |Added

   Priority|P1  |P3
 CC||c...@dawg.eu
   Hardware|x86_64  |All

--- Comment #3 from Martin Nowak  ---
We'll address this with 2.075.1 to not delay the release even further.

--


[Issue 17643] std.traits.getSymbolsByUDA doesn't work with private attributes

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17643

--- Comment #3 from greenify  ---
See https://github.com/dlang/phobos/pull/5607

--


[Issue 17643] std.traits.getSymbolsByUDA doesn't work with private attributes

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17643

--- Comment #2 from RazvanN  ---
Anyway, this probably is the correct behaviour.

--


[Issue 17643] std.traits.getSymbolsByUDA doesn't work with private attributes

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17643

RazvanN  changed:

   What|Removed |Added

 CC||razvan.nitu1...@gmail.com

--- Comment #1 from RazvanN  ---
Could you pinpoint the exact location of the example? I can't find it in
std/traits.d

--


[Issue 17637] Integral promotion rules not being followed

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17637

Eyal  changed:

   What|Removed |Added

 CC||e...@weka.io
   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=17633

--


[Issue 17633] Unary negation has the wrong type

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17633

Eyal  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=17637

--


[Issue 16205] core.sys.windows.oaidl.VARIANT missing fields

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16205

Rainer Schuetze  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||r.sagita...@gmx.de
 Resolution|--- |FIXED

--- Comment #1 from Rainer Schuetze  ---
https://github.com/dlang/druntime/pull/1794

--


[Issue 17651] New: Segfult when parsing Ddoc ESCAPES macro

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17651

  Issue ID: 17651
   Summary: Segfult when parsing Ddoc ESCAPES macro
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: d...@me.com

The following example results in a segmentation fault. Looking at the stack
trace it looks like it the segmentation fault occurs when parsing the ESCAPES
Ddoc macro:

$ cat foo.d
/**
Macros:
ESCAPES = /a/b/
*/
void foo() {}

$ lldb -- dmd foo.d -c -D
(lldb) target create "dmd"
Current executable set to 'dmd' (x86_64).
(lldb) settings set -- target.run-args  "foo.d" "-c" "-D"
(lldb) r
Process 1511 launched: '~/.dvm/compilers/dmd-2.075.0-b4/osx/bin/dmd' (x86_64)
Process 1511 stopped
* thread #1: tid = 0x1106382, 0x00010009e6e0
dmd`DocComment::parseEscapes(Escape**, char const*, unsigned long) + 40, queue
= 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00010009e6e0 dmd`DocComment::parseEscapes(Escape**, char
const*, unsigned long) + 40
dmd`DocComment::parseEscapes:
->  0x10009e6e0 <+40>: movq   (%rdi), %r12
0x10009e6e3 <+43>: testq  %r12, %r12
0x10009e6e6 <+46>: jne0x10009e71c   ; <+100>
0x10009e6e8 <+48>: movq   0x29db79(%rip), %rdi  ; (void
*)0x000100381898: D26TypeInfo_S4ddmd3doc6Escape6__initZ
(lldb) bt
* thread #1: tid = 0x1106382, 0x00010009e6e0
dmd`DocComment::parseEscapes(Escape**, char const*, unsigned long) + 40, queue
= 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00010009e6e0 dmd`DocComment::parseEscapes(Escape**, char
const*, unsigned long) + 40
frame #1: 0x00010009e5af dmd`DocComment::parseMacros(Escape**, Macro**,
char const*, unsigned long) + 351
frame #2: 0x00010009698d dmd`MacroSection::write(Loc, DocComment*,
Scope*, Array*, OutBuffer*) + 37
frame #3: 0x00010009f14c dmd`DocComment::writeSections(Scope*,
Array*, OutBuffer*) + 1420
frame #4: 0x00010009a041 dmd`emitComment::EmitComment::emit(Scope*,
Dsymbol*, char const*) + 3121
frame #5: 0x000100099395 dmd`emitComment(Dsymbol*, OutBuffer*, Scope*)
+ 93
frame #6: 0x0001000990e1 dmd`emitMemberComments(ScopeDsymbol*,
OutBuffer*, Scope*) + 1193
frame #7: 0x000100097725 dmd`gendocfile(Module*) + 2981
frame #8: 0x00010015c32e dmd`D4ddmd4mars7tryMainFmPPxaZi + 22782
frame #9: 0x00011523 dmd`_Dmain + 39
frame #10: 0x0001002bf22c
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFNlZv + 40
frame #11: 0x0001002bf154
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFNlMDFZvZv + 32
frame #12: 0x0001002bf1d1
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFNlZv + 45
frame #13: 0x0001002bf154
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFNlMDFZvZv + 32
frame #14: 0x0001002bf0c7 dmd`_d_run_main + 459
frame #15: 0x0001153c dmd`main + 16
frame #16: 0x000114f4 dmd`start + 52

The issue seems to occur on all versions of DMD. If I remove the ESCAPES macro
the segmentation fault does not occur.

--


[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650

Jon Degenhardt  changed:

   What|Removed |Added

   Severity|enhancement |regression

--


[Issue 17650] New: [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650

  Issue ID: 17650
   Summary: [REG v2.075.0 b1-b4] std.getopt range violation
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: jrdemail2000-dl...@yahoo.com

The unit test below passes in 2.074.1 but fails in 2.075.0 beta-1 and beta-4

= getopt_test.d =
import std.getopt;

unittest // Dashes
{
auto args = ["program", "-m", "-5", "-n", "-50", "-c", "-"];

int m;
int n;
char c;

getopt(
args,
"m|mm", "integer", ,
"n|nn", "integer", ,
"c|cc", "character", ,
);

assert(m == -5);
assert(n == -50);
assert(c == '-');
}

(The above adopted from tsv utilities unit tests here:
https://github.com/eBay/tsv-utils-dlang/blob/master/common/src/getopt_inorder.d#L302)

With 2.074.1 (succeeds):

$ ./dmd2.074.1  --version
DMD64 D Compiler v2.074.1
Copyright (c) 1999-2017 by Digital Mars written by Walter Bright

$ ./dmd2.074.1  -unittest -main -run getopt_test.d
$

With 2.075.0 beta-4 (error):

$ dmd --version
DMD64 D Compiler v2.075.0-b4
Copyright (c) 1999-2017 by Digital Mars written by Walter Bright

$ dmd -unittest -main -run getopt_test.d
core.exception.RangeError@std/getopt.d(1112): Range violation

4   dmd_runceaLDU   0x00010f02a06a _d_arrayboundsp +
110
5   dmd_runceaLDU   0x00010f046f03 @safe bool
std.getopt.optMatch(immutable(char)[], immutable(char)[], ref
immutable(char)[], std.getopt.configuration) + 639
6   dmd_runceaLDU   0x00010f01558d @safe bool
std.getopt.handleOption!(int*).handleOption(immutable(char)[], int*, ref
immutable(char)[][], ref std.getopt.configuration, bool) + 985
7   dmd_runceaLDU   0x00010f014a88 @safe void
std.getopt.getoptImpl!(immutable(char)[], immutable(char)[], int*,
immutable(char)[], immutable(char)[], int*, immutable(char)[],
immutable(char)[], char*).getoptImpl(ref immutable(char)[][], ref
std.getopt.configuration, ref std.getopt.GetoptResult, ref
std.getopt.GetOptException, void[][immutable(char)[]],
void[][immutable(char)[]], immutable(char)[], immutable(char)[], int*,
immutable(char)[], immutable(char)[], int*, immutable(char)[],
immutable(char)[], char*) + 1164
8   dmd_runceaLDU   0x00010f014349 @safe
std.getopt.GetoptResult std.getopt.getopt!(immutable(char)[],
immutable(char)[], int*, immutable(char)[], immutable(char)[], int*,
immutable(char)[], immutable(char)[], char*).getopt(ref immutable(char)[][],
immutable(char)[], immutable(char)[], int*, immutable(char)[],
immutable(char)[], int*, immutable(char)[], immutable(char)[], char*) + 189
9   dmd_runceaLDU   0x00010f011961 void
getopt_test.__unittestL3_1() + 301
10  dmd_runceaLDU   0x00010f011808 void
getopt_test.__modtest() + 8
11  dmd_runceaLDU   0x00010f02a8d0 int
core.runtime.runModuleUnitTests().__foreachbody2(object.ModuleInfo*) + 44
12  dmd_runceaLDU   0x00010f02096e int
object.ModuleInfo.opApply(scope int
delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) + 34
13  dmd_runceaLDU   0x00010f042205 int
rt.minfo.moduleinfos_apply(scope int
delegate(immutable(object.ModuleInfo*))).__foreachbody2(ref
rt.sections_osx_x86_64.SectionGroup) + 85
14  dmd_runceaLDU   0x00010f042190 int
rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))) +
32
15  dmd_runceaLDU   0x00010f020945 int
object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)) + 33
16  dmd_runceaLDU   0x00010f02a7ba runModuleUnitTests +
126
17  dmd_runceaLDU   0x00010f03a9aa void
rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()
+ 22
18  dmd_runceaLDU   0x00010f03a943 void
rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) + 31
19  dmd_runceaLDU   0x00010f03a8ae _d_run_main + 458
20  dmd_runceaLDU   0x00010f01182f main + 15
21  libdyld.dylib   0x7fffc7550234 start + 0
22  ??? 0x 0x0 + 0

--