Jump to page: 1 2
Thread overview
[Issue 9466] New: Line number dependent bug of coverage
Feb 07, 2013
Andrej Mitrovic
Feb 08, 2013
Andrej Mitrovic
[Issue 9466] Compiler crash with code-coverage generation with large files
Feb 09, 2013
Kenji Hara
Feb 09, 2013
Andrej Mitrovic
May 22, 2013
Walter Bright
Oct 02, 2013
Walter Bright
Oct 02, 2013
Andrej Mitrovic
Oct 02, 2013
Andrej Mitrovic
Oct 02, 2013
Andrej Mitrovic
February 07, 2013
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


--- Comment #0 from kekeniro2@yahoo.co.jp 2013-02-06 18:26:47 PST ---
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: -------
February 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9466



--- Comment #1 from kekeniro2@yahoo.co.jp 2013-02-06 18:33:13 PST ---
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: -------
February 07, 2013
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


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-06 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: -------
February 08, 2013
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


--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-08 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: -------
February 09, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9466



--- Comment #4 from Kenji Hara <k.hara.pg@gmail.com> 2013-02-09 02:51:55 PST ---
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: -------
February 09, 2013
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


--- Comment #5 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-09 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: -------
May 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9466



--- Comment #6 from kekeniro2@yahoo.co.jp 2013-05-21 20:50:42 PDT ---
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 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9466


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #7 from Walter Bright <bugzilla@digitalmars.com> 2013-05-21 22:53:23 PDT ---
(In reply to comment #2)
> 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: -------
October 02, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9466


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #8 from Walter Bright <bugzilla@digitalmars.com> 2013-10-01 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: -------
October 02, 2013
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                  |


--- Comment #9 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-10-02 05:54:36 PDT ---
(In reply to comment #8)
> 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: -------
« First   ‹ Prev
1 2