[Issue 4815] New: CodeView: Global and Static symbols should have unmangled names

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4815

   Summary: CodeView: Global and Static symbols should have
unmangled names
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: aldonun...@gmail.com


--- Comment #0 from Aldo Nunez aldonun...@gmail.com 2010-09-05 00:35:07 PDT 
---
Global and Static symbols should have their names stored fully qualified but
unmangled in the CodeView debug info. In contrast, Public symbols, because they
are meant to expose names to other object files, should have their mangled
linkage names stored, as they already are.

Right now Global and Static symbol names are stored mangled. This causes
problems when debugging. Storing them mangled defeats the ability of a debugger
to use the hash table made by the linker in order to look up variables the user
wants to evaluate and functions in a callstack. It also seems to offer no
meaningful service, because mangled names are more appropriate for linking than
debugging.

This affects at least the following kinds of symbol records in the sstGlobalSym
and sstStaticSym sections (not sstGlobalPub):

S_LDATA32
S_GDATA32
S_LPROC32
S_GPROC32
S_THUNK32
S_LTHREAD32
S_GTHREAD32
S_UDT (already OK)

The following article gives some explanation of the separation in treating name
mangling. It applies to PDB format, but it's believed that PDB derives from
CodeView, so I think the article applies equally to both.
http://msdn.microsoft.com/en-us/library/ff553493(VS.85).aspx

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4816] New: template constraint and __traits(compiles, ...) don't work properly together with a delegate

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4816

   Summary: template constraint and __traits(compiles, ...) don't
work properly together with a delegate
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: jmdavisp...@gmail.com


--- Comment #0 from Jonathan M Davis jmdavisp...@gmail.com 2010-09-05 
00:42:07 PDT ---
The following refuses to compile

import std.stdio;

void callFunc(alias func, T...)(T args)
if(__traits(compiles, func(args)))
{
func(args);
}

void main()
{
auto func = (){writeln(4);};
callFunc!(func)();
}


Rather, it gives you the error message

d.d(12): Error: template d.callFunc(alias func,T...) if
(__traits(compiles,func(args))) does not match any function template
declaration
d.d(12): Error: template d.callFunc(alias func,T...) if
(__traits(compiles,func(args))) cannot deduce template function from argument
types !(func)()
d.d(12): Error: template instance errors instantiating template


If I remove the template constraint, then it compiles fine. If I declare func
as a nested function and pass that, it works fine. If I use __traits(compiles,
func()) in main(), it returns true. However, the template constraint fails as
long as you pass it a delegate.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4817] New: CodeView: Enum members should have simple names

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4817

   Summary: CodeView: Enum members should have simple names
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P3
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: aldonun...@gmail.com


--- Comment #0 from Aldo Nunez aldonun...@gmail.com 2010-09-05 00:51:40 PDT 
---
In the CodeView info for a program, members of enums have their names stored
fully qualified, even though the enum members themselves are stored in the
scope of their enum type, whose name is already fully qualified.

Instead of storing:

LF_ENUM mod.E
- LF_ENUMERATE mod.E.Alpha
- LF_ENUMERATE mod.E.Beta

This should be stored:

LF_ENUM mod.E
- LF_ENUMERATE Alpha
- LF_ENUMERATE Beta

This is helpful for debugging.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4009] OPTLINK ruins the day yet again

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4009



--- Comment #10 from Walter Bright bugzi...@digitalmars.com 2010-09-05 
03:28:45 PDT ---
The overflow would happen when some of the data structures exceeded 128K in
size.

I checked the other seg faults for optlink in Bugzilla, but those apparently
have different causes.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4818] New: Taking address of shared member function - unshared delegate

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4818

   Summary: Taking address of shared member function - unshared
delegate
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha dsim...@yahoo.com 2010-09-05 08:34:42 PDT ---
class Foo {

 shared void bar() {}
}

void main() {
 shared(void delegate()) d;
 auto foo = new Foo;
 d = foo.bar;
} 

class Foo {

 shared void bar() {}
}

void main() {
 shared(void delegate()) d;
 auto foo = new Foo;
 d = foo.bar;
} 

Error: cannot implicitly convert expression (foo.bar) of type void
delegate() to shared(void delegate()) 


But this compiles:

class Foo {

 void bar() {}
}

void main() {
 shared(void delegate()) d;
 auto foo = new Foo;
 d = foo.bar;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4821] New: std.array.insert on string[]

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4821

   Summary: std.array.insert on string[]
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-09-05 09:14:13 PDT ---
This D2 program correctly inserts the int 10 at the first position of an empty
array (dmd 2.048):

import std.array: insert;
void main() {
int[] a;
a.insert(0, 10);
assert(a == [10]);
}



But a similar program doesn't work with an array of strings:


import std.array: insert;
void main() {
string[] a;
a.insert(0, hello);
}


Errors:
...\dmd\src\phobos\std\array.d(518): Error: cannot implicitly convert
expression (e) of type immutable(char) to string
...\dmd\src\phobos\std\array.d(14): Error: template instance
std.array.insert!(string,string) error instantiating

(A related necessary function std.array.remove is missing.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2943



--- Comment #4 from Serg Kovrov kovrov+purema...@gmail.com 2010-09-05 
09:16:32 PDT ---
I do. As stated in comment for Bug 3135#c1 - an empty postblit function seem to
workaround the issue..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2943] Struct copying in presence of alias member this only copies alias this member

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2943



--- Comment #5 from David Simcha dsim...@yahoo.com 2010-09-05 09:52:19 PDT ---
(In reply to comment #3)
 doesn't anyone use alias this?

I mostly don't, but only b/c it's currently so buggy it's not even funny.  I
just looked, I myself have filed at least 5 bug reports on it, 4 of which I
filed within a few days after the first version of DMD with alias this came
out.

IMHO the next big todo after 64 support is to tackle the general extreme
bugginess of alias this and inout, as well as the ref issue w/ opApply (Bug
2443).  These are key features for library writers.  Their bugginess severely
limits their usability, and right now a major criticism of D is lack of
libraries, so supporting library writers is kind of important.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4822] New: Problem with std.stdio.File.writef(%c

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4822

   Summary: Problem with std.stdio.File.writef(%c
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-09-05 11:19:51 PDT ---
I think this is a correct D2 program:


import std.stdio: File;
void main() {
auto f = File(test.txt, w);
f.writef(%c, 'x');
}


But DMD dmd 2.048 gives at runtime:
std.format.FormatError: std.format integral

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4823] New: CodeView: Thread local variables are stored as shared globals

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4823

   Summary: CodeView: Thread local variables are stored as shared
globals
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: aldonun...@gmail.com


--- Comment #0 from Aldo Nunez aldonun...@gmail.com 2010-09-05 12:41:57 PDT 
---
In the debug info, thread local variables, whether they're at module, class, or
function scope should have record types of S_LTHREAD32 and S_GTHREAD32. Right
now they're stored as shared globals using the record type S_GDATA32.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4824] New: stopwatch unit tests fail intermitently

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4824

   Summary: stopwatch unit tests fail intermitently
   Product: D
   Version: D2
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bra...@puremagic.com


--- Comment #0 from Brad Roberts bra...@puremagic.com 2010-09-05 12:42:56 PDT 
---
The stop watch test fails on and off:
http://d.puremagic.com/test-results/index.ghtml

When it fails:
Testing generated/posix/release/unittest/std/stopwatch
core.exception.asserter...@std.stopwatch(907): Assertion failure

generated/posix/release/unittest/std/stopwatch(_d_assertm+0x16) [0x807d986]
generated/posix/release/unittest/std/stopwatch(_D3std9stopwatch8__assertFiZv+0x12)
[0x807b432]
generated/posix/release/unittest/std/stopwatch(_D3std9stopwatch12__unittest26FZv41__T13__dgliteral24TS3std9stopwatch5TicksZ13__dgliteral24MFS3std9stopwatch5TicksZv+0x23)
[0x807b37f]
generated/posix/release/unittest/std/stopwatch(_D3std9stopwatch12__unittest26FZv66__T11measureTimeS463std9stopwatch12__unittest26FZv13__dgliteral24Z11measureTimeMFZS3std9stopwatch12__unittest26FZv66__T11measureTimeS463std9stopwatch12__unittest26FZv13__dgliteral24Z11measureTimeM3TMP3TMP6__dtorMFZv+0x1b)
[0x807b303]
generated/posix/release/unittest/std/stopwatch(_D3std9stopwatch12__unittest26FZv+0x19)
[0x807ada9]
generated/posix/release/unittest/std/stopwatch(_D3std9stopwatch9__modtestFZv+0x71)
[0x807b405]
generated/posix/release/unittest/std/stopwatch(_D4core7runtime18runModuleUnitTestsUZb16__foreachbody147MFKPS6object10ModuleInfoZi+0x24)
[0x807ff0c]
generated/posix/release/unittest/std/stopwatch(_D6object10ModuleInfo7opApplyFMDFKPS6object10ModuleInfoZiZi+0x41)
[0x807d4bd]
generated/posix/release/unittest/std/stopwatch(runModuleUnitTests+0x87)
[0x807fe27]
generated/posix/release/unittest/std/stopwatch(_D2rt6dmain24mainUiPPaZi6runAllMFZv+0x20)
[0x807dba8]
generated/posix/release/unittest/std/stopwatch(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x24)
[0x807dad0]
generated/posix/release/unittest/std/stopwatch(main+0x96) [0x807da76]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x4008dbd6]
generated/posix/release/unittest/std/stopwatch() [0x8079eb1]

Other failures have been in the debug flavor test run as well.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4825] Error: non-constant expression with -inline

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4825



--- Comment #1 from nfx...@gmail.com 2010-09-05 15:46:57 PDT ---
I have to add that this bug triggers even when the const int... line on
function c is in a different function in a different module. This makes it a
very non-obvious bug, where you have no idea what is happening.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4795] druntime demangler unittests fail

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4795


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #2 from Brad Roberts bra...@puremagic.com 2010-09-05 19:17:11 PDT 
---
Fixed by Sean in druntime commits r384 and r385

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4797] onOutOfMemoryError in dmd unit test causes segv

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4797


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #1 from Brad Roberts bra...@puremagic.com 2010-09-05 19:17:56 PDT 
---
Fixed by Sean in druntime commits r384 and r385

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4826] New: cannot create associative array and compiler crash

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4826

   Summary: cannot create associative array and compiler crash
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: brian-sch...@cox.net


--- Comment #0 from brian-sch...@cox.net 2010-09-05 19:21:54 PDT ---
Created an attachment (id=746)
Code that fails

DMD fails to compile the attached code, printing Error: cannot create
associative array T[string] before crashing.

Error message printed by GDB:

Program received signal SIGSEGV, Segmentation fault.
0x0817f8b7 in TemplateInstance::semantic (this=0x953b418, sc=0x0, fargs=0x0)
at template.c:3554
3554tinst = sc-tinst;

Backtrace:

#0  0x0817f8b7 in TemplateInstance::semantic (this=0x953b418, sc=0x0,
fargs=0x0) at template.c:3554
#1  0x0818028a in TemplateInstance::semantic (this=0x953b418, sc=0x0)
at template.c:3524
#2  0x081384b6 in TypeAArray::getImpl (this=0x82121e0) at mtype.c:3976
#3  0x0813ffa1 in TypeStruct::implicitConvTo (this=0x820df50, to=0x82121e0)
at mtype.c:6942
#4  0x0817be83 in Type::deduceType (this=0x820df50, sc=0x939b448,
tparam=0x82121e0, parameters=0x82120d0, dedtypes=0xc458)
at template.c:1881
#5  0x0817c4a1 in TypeStruct::deduceType (this=0x820df50, sc=0x939b448,
tparam=0x82121e0, parameters=0x82120d0, dedtypes=0xc458)
at template.c:2412
#6  0x08180e6d in TemplateDeclaration::deduceFunctionTemplateMatch (
this=0x8212e80, sc=0x9206218, loc=..., targsi=0x0, ethis=0x94dd5b0,
fargs=0x94dd600, dedargs=0xc600) at template.c:1109
#7  0x08181767 in TemplateDeclaration::deduceFunctionTemplate (this=0x8210f08,
sc=0x9206218, loc=..., targsi=0x0, ethis=0x94dd5b0, fargs=0x94dd600,
flags=0) at template.c:1470
#8  0x080efb8d in CallExp::semantic (this=0x94dd628, sc=0x9206218)
at expression.c:6929
#9  0x080e4fca in AssignExp::semantic (this=0x8208a98, sc=0x9206218)
at expression.c:8876
#10 0x08168368 in ExpStatement::semantic (this=0x8208ac0, sc=0x9206218)
at statement.c:245
#11 0x0816a7a1 in CompoundStatement::semantic (this=0x82091b8, sc=0x9206218)
at statement.c:464
#12 0x080f871b in FuncDeclaration::semantic3 (this=0x8207350, sc=0x9202ba8)
at func.c:1213
#13 0x0812c23d in Module::semantic3 (this=0x8206848) at module.c:830
#14 0x0812aafe in main (argc=6, argv=0x81fcde0) at mars.c:1174

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4826] cannot create associative array and compiler crash

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4826



--- Comment #1 from brian-sch...@cox.net 2010-09-05 19:29:53 PDT ---
Here's the code that fails:
The second opIndexAssign is written this way because of bug 2972.

module testcase;

struct SomeStruct
{
void opIndexAssign(T)(T[string] value, string key)
if(is(T : string) || is(T : int))
{
}

void opIndexAssign(T)(SomeStruct value, string key) if(is(T : SomeStruct))
{
}
}

void main(string[] args)
{
auto t = SomeStruct();
t[test] = [key: value, otherKey: otherValue];
auto k = SomeStruct();
t[fails] = k;
// Error: cannot create associative array T[string]
// Segmentation fault
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4826] cannot create associative array and compiler crash

2010-09-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4826



--- Comment #2 from brian-sch...@cox.net 2010-09-05 19:34:48 PDT ---
(In reply to comment #1)

That should have been:

void opIndexAssign(T)(T value, string key) if(is(T : SomeStruct))
{
}

But the error is the same either way. Bugzilla needs an edit button.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---