www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9466] New: Line number dependent bug of coverage

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466

           Summary: Line number dependent bug of coverage
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: kekeniro2 yahoo.co.jp



Created an attachment (id=1183)
reduced test case

DMD crashes when compile the attaced source files with -cov switch.
They are reduced, but have many many blank lines to keep line number.

Environment:
Windows7 64-bit ( Non -m64 )

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466




DMD crashes but its process is alive.
DMD 2.058 or older, seems to go silently into loop.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



18:40:50 PST ---
It crashes in Module::genobjfile, in this call:

free(covb);

covb is allocated via:

covb = (unsigned *)calloc((numlines + 32) / 32, sizeof(*covb));

I would sure like to understand the meaning of this magical expression. Why is
it dividing by 32? Another case of premature optimization?

If you replace that with:

covb = (unsigned *)calloc(numlines, sizeof(*covb));

Then it works fine.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
         AssignedTo|nobody puremagic.com        |andrej.mitrovich gmail.com
           Severity|normal                      |major



11:06:51 PST ---
https://github.com/D-Programming-Language/dmd/pull/1647

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466




Created an attachment (id=1184)
More reduced test case

If move the code line `int dummy = 0;` in cb.i from line 161 to 160, segfault
disappeared. The line number depends on minimum allocation size of calloc(). As
far as I see, currently it allocates at least 20 bytes (20 * 8 == 160 bit).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|pull                        |
         AssignedTo|andrej.mitrovich gmail.com  |nobody puremagic.com



06:10:46 PST ---
The pull was invalid, I'll let others handle this one.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466




Probably this is a duplicate of Issue 9353.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



22:53:23 PDT ---

 covb is allocated via:
 
 covb = (unsigned *)calloc((numlines + 32) / 32, sizeof(*covb));
 
 I would sure like to understand the meaning of this magical expression. Why is
 it dividing by 32? Another case of premature optimization?
covb is a bit vector, it must have numlines bits in it. Since unsigned's are 32 bits wide, it rounds it up to the number of 32 bit unsigned's to allocate. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



23:21:13 PDT ---
Can't duplicate any problem with 2.064 head, although it does fail with 2.063.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 01 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |



05:54:36 PDT ---

 Can't duplicate any problem with 2.064 head, although it does fail with 2.063.
I can reproduce it with git-head. Have you made sure to compile with: dmd.exe -cov -c cb.d -J. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466




I made a DMD.exe of 2.063.2 by the _tuned_ DMC. (Memory allocation improvement
ver.) 
It does _not_ reproduce the bug ... why?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466




08:03:03 PDT ---

 I made a DMD.exe of 2.063.2 by the _tuned_ DMC. (Memory allocation improvement
 ver.) 
 It does _not_ reproduce the bug ... why?
Which tuned DMC? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466






 I made a DMD.exe of 2.063.2 by the _tuned_ DMC. (Memory allocation improvement
 ver.) 
 It does _not_ reproduce the bug ... why?
Which tuned DMC?
I mean DMC 8.57 and new snn.lib, which came in August. DMC 8.57 http://forum.dlang.org/thread/ktenl9$1e68$1 digitalmars.com snn.lib http://forum.dlang.org/thread/ktju8h$efb$1 digitalmars.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 02 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9466




08:27:19 PDT ---



 I made a DMD.exe of 2.063.2 by the _tuned_ DMC. (Memory allocation improvement
 ver.) 
 It does _not_ reproduce the bug ... why?
Which tuned DMC?
I mean DMC 8.57 and new snn.lib, which came in August. DMC 8.57 http://forum.dlang.org/thread/ktenl9$1e68$1 digitalmars.com snn.lib http://forum.dlang.org/thread/ktju8h$efb$1 digitalmars.com
I still get a crash with these when using with both 2.063.2 and 2.064. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 02 2013