www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3053] New: cross imports produce repeated calls to a call destructor

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

           Summary: cross imports produce repeated calls to a call
                    destructor
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: brauningbar gmail.com


Created an attachment (id=394)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=394)
package recreating the bug

Having a crossed imports between thre files of a personal project causes the
destructor of a class to get called REPEATED times. Tried various compiler
switches but no fix. When i compile with -unittest dtor gets called even more
times (like 6 times or even 9!)

The attached contains the files stripped with the bug, and a simple makefile
The compiler version i've tried was 2.030, i've tried with 2.019 and the dtor
calls were less than the former

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 05 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3053



--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-12-16 16:28:09 PST ---
Cannot reproduce on Windows. Tried several compiler versions, including 2.030
and 2.050.
Compiled with noflags, and with -O, -unittest. Tried compiling obj files
seperately. Tried all 6 combinations of ordering on the command line.
In every case, there was only one destructor call.

Can someone reproduce this on Linux?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 16 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3053



--- Comment #2 from brauningbar gmail.com 2010-12-21 18:19:38 PST ---
(In reply to comment #1)
 Cannot reproduce on Windows. Tried several compiler versions, including 2.030
 and 2.050.
 Compiled with noflags, and with -O, -unittest. Tried compiling obj files
 seperately. Tried all 6 combinations of ordering on the command line.
 In every case, there was only one destructor call.
 
 Can someone reproduce this on Linux?

THIS IS A SESSION SHOWING THE BUG in linux. The 2.050 doesn't emit bug but 2.039. I hope this is util ---------------------------------------------------------- solved> cd ttttt ttttt> ls expresion.d makefile newdawk.d programa.d ttttt> dmd | head -1 Digital Mars D Compiler v2.050 ttttt> make dmd -ofnewdawk *.d ttttt> newdawk dtor ttttt> cd ../ttttt_on_dmd2.039/ ttttt_on_dmd2.039> make ~/comp/D/dmd2.039/linux/bin/dmd -ofnewdawk *.d deferring sigaction_t ttttt_on_dmd2.039> newdawk dtor dtor dtor dtor dtor dtor ttttt_on_dmd2.039> ls expresion.d makefile newdawk newdawk.d newdawk.o programa.d ttttt_on_dmd2.039> cat newdawk.d import programa; void main() { auto prog = new Programa(); } ttttt_on_dmd2.039> cat programa.d import std.stdio; import expresion; class Programa { Function fun; ~this() { writefln("dtor"); } } ttttt_on_dmd2.039> cat expresion.d import programa; struct Function { } ttttt_on_dmd2.039> ttttt_on_dmd2.039> make clean rm newdawk *.o ; true ttttt_on_dmd2.039> grep ARGS= makefile DARGS= ttttt_on_dmd2.039> vi makefile skipping 15 old session files reading makefile wrote makefile, 11 lines, 139 chars ttttt_on_dmd2.039> grep ARGS= makefile DARGS=-unittest ttttt_on_dmd2.039> make ~/comp/D/dmd2.039/linux/bin/dmd -unittest -ofnewdawk *.d deferring sigaction_t ttttt_on_dmd2.039> newdawk dtor dtor dtor dtor dtor dtor dtor dtor dtor dtor dtor dtor dtor dtor ttttt_on_dmd2.039> ttttt_on_dmd2.039> cat /etc/slackware-version Slackware 13.1.0 ttttt_on_dmd2.039> gcc --version gcc (GCC) 4.4.4 Copyright (C) 2010 Free Software Foundation, Inc. Esto es software libre; vea el código para las condiciones de copia. NO hay garantía; ni siquiera para MERCANTIBILIDAD o IDONEIDAD PARA UN PROPÓSITO EN PARTICULAR ttttt_on_dmd2.039> ld --version GNU ld (Linux/GNU Binutils) 2.20.51.0.8.20100412 Copyright 2010 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. ttttt_on_dmd2.039> uname -a Linux slackweiller 2.6.33.4-MEMOPRESARIO #14 SMP Mon Nov 15 01:13:57 AKST 2010 i686 AMD Sempron(tm) SI-42 AuthenticAMD GNU/Linux -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 21 2010