digitalmars.D.bugs - [Issue 5580] New: [64-bit] String switch statements broken in 64-bit mode
- d-bugmail puremagic.com (29/29) Feb 14 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5580
- d-bugmail puremagic.com (13/13) Feb 14 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5580
- d-bugmail puremagic.com (7/7) Feb 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5580
- d-bugmail puremagic.com (7/7) Feb 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5580
- d-bugmail puremagic.com (11/11) Feb 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5580
- d-bugmail puremagic.com (14/14) Feb 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5580
- d-bugmail puremagic.com (12/12) Feb 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5580
- d-bugmail puremagic.com (12/12) Feb 16 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5580
http://d.puremagic.com/issues/show_bug.cgi?id=5580 Summary: [64-bit] String switch statements broken in 64-bit mode Product: D Version: D2 Platform: x86_64 OS/Version: Windows Status: NEW Keywords: wrong-code Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: dsimcha yahoo.com --- Comment #0 from David Simcha <dsimcha yahoo.com> 2011-02-14 18:14:05 PST --- The following code hits the assert(0) when -release is disabled or segfaults when -release is enabled when compiled on Linux in 64-bit mode: void main(string[] args) { auto str = "foo"; switch(str) { case "foo": break; default: assert(0); } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 14 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5580 --- Comment #1 from David Simcha <dsimcha yahoo.com> 2011-02-14 18:28:28 PST --- This one actually looks to be related to some dynamic library or system call or something. I just noticed that, regardless of what computer I compile it on, I can only reproduce it on certain computers, those with ancient Linux distributions. The uname -a for the two that I can reproduce it on are: Linux io11.cis.jhu.edu 2.6.9-89.33.1.ELsmp #1 SMP Thu Dec 2 10:54:14 EST 2010 x86_64 x86_64 x86_64 GNU/Linux Linux io19.cis.jhu.edu 2.6.9-78.0.13.plus.c4largesmp #1 SMP Tue Jan 20 22:49:51 EST 2009 x86_64 x86_64 x86_64 GNU/Linux -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 14 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5580 --- Comment #2 from David Simcha <dsimcha yahoo.com> 2011-02-15 02:34:01 PST --- Created an attachment (id=912) Statically linked binary -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5580 --- Comment #3 from David Simcha <dsimcha yahoo.com> 2011-02-15 02:35:11 PST --- Not sure if this will help, but here's a statically linked binary with debugging symbols. This can reproduce the bug on any computer. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5580 --- Comment #4 from David Simcha <dsimcha yahoo.com> 2011-02-15 06:30:28 PST --- My gut feeling is that this is related to Bug 5581, as both invoke calls to memcmp() according to my reading of the disassembly and tracking down of the function calls in the runtime. However, 5581 seems to be reproducible everywhere. If you can't reproduce this, I suggest fixing 5581 first. Once 5581 is fixed, I'll retest this bug on a machine that I was able to reproduce it on and hopefully it will be fixed, too. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5580 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla digitalmars.com --- Comment #5 from Walter Bright <bugzilla digitalmars.com> 2011-02-15 15:30:18 PST --- I can't reproduce a problem on Ubuntu, and I examined the assembler generated for druntime/src/rt/switch_.d and nothing obviously wrong jumped out at me. One thing you can try on the failing machines is to copy switch_.d into a local directory, compile it with the test case, and verify the failure. Then add some print statements to switch_.d to try and see where it goes wrong. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5580 --- Comment #6 from David Simcha <dsimcha yahoo.com> 2011-02-15 18:10:56 PST --- Unfortunately this appears to be a Heisenbug. When I put print statements in to figure out what's going on and call the switch statement function manually, it starts working. However, the one hint I did get from mucking around in switch_.d is that replacing the memcmp() call with a manual for loop and recompiling druntime solves the problem. Not sure if this is due to the Heisenbug nature of this thing or if it indicates that the memcmp() call is the culprit. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5580 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #7 from Walter Bright <bugzilla digitalmars.com> 2011-02-16 00:54:02 PST --- https://github.com/D-Programming-Language/dmd/commit/f1c158eac6f9d1a28314c7e473c89be8b8a4f774 https://github.com/D-Programming-Language/dmd/commit/b3bb64d6ff00beddfc45c228941feedeb2e27842 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 16 2011