[Issue 893] The profile flag no longer seems to work on Linux x86 64

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 5 06:24:14 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=893





------- Comment #1 from hhasemann at web.de  2007-02-05 08:24 -------
I could reproduce this on a Turion64 X2 (x86_64 dual core), running completely
in 32 Bit mode.
Interestingly the segfault occures in main (not _Dmain) when you have just an
empty main function:


$ cat proftst.d 
void main() {
}

$ dmd ./proftst.d
gcc proftst.o -o proftst -m32 -lphobos -lpthread -lm 
$ ./proftst
$

$ dmd -profile ./proftst.d
gcc proftst.o -o proftst -m32 -lphobos -lpthread -lm
$ ./proftst
Segmentation fault
$

With GDB:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210202432 (LWP 3357)]
0x0804a333 in main ()
(gdb) info reg
eax            0x9      9
ecx            0x1      1
edx            0xfefeff00       -16843008
ebx            0x1      1
esp            0xbfa48ba8       0xbfa48ba8
ebp            0xbfa48ba8       0xbfa48ba8
esi            0x1      1
edi            0x1      1
eip            0x804a333        0x804a333 <main+87>
eflags         0x10216  [ PF AF IF RF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb) 

Critical row is marked below with ">>>":

Disassembly of section .gnu.linkonce.tmain:

0804a2dc <main>:
 804a2dc:       55                      push   %ebp
 804a2dd:       8b ec                   mov    %esp,%ebp
 804a2df:       83 ec 14                sub    $0x14,%esp
 804a2e2:       53                      push   %ebx
 804a2e3:       56                      push   %esi
 804a2e4:       57                      push   %edi
 804a2e5:       8b 7d 08                mov    0x8(%ebp),%edi
 804a2e8:       8b 5d 0c                mov    0xc(%ebp),%ebx
 804a2eb:       c7 45 f4 00 00 00 00    movl   $0x0,0xfffffff4(%ebp)
 804a2f2:       e8 dd fb ff ff          call   8049ed4
<_STI_monitor_staticctor>
 804a2f7:       e8 3c fb ff ff          call   8049e38 <_STI_critical_init>
 804a2fc:       e8 53 95 00 00          call   8053854 <gc_init>
 804a301:       8b cf                   mov    %edi,%ecx
 804a303:       c1 e1 03                shl    $0x3,%ecx
 804a306:       51                      push   %ecx
 804a307:       e8 28 f3 ff ff          call   8049634 <malloc at plt>
 804a30c:       89 45 f0                mov    %eax,0xfffffff0(%ebp)
 804a30f:       83 c4 04                add    $0x4,%esp
 804a312:       80 3d 40 1e 06 08 00    cmpb   $0x0,0x8061e40
 804a319:       74 4b                   je     804a366 <main+0x8a>
 804a31b:       e8 0c 01 00 00          call   804a42c <_moduleCtor>
 804a320:       e8 cf 02 00 00          call   804a5f4 <_moduleUnitTests>
 804a325:       31 f6                   xor    %esi,%esi
 804a327:       85 ff                   test   %edi,%edi
 804a329:       7e 1d                   jle    804a348 <main+0x6c>
 804a32b:       ff 34 b3                pushl  (%ebx,%esi,4)
 804a32e:       e8 11 f4 ff ff          call   8049744 <strlen at plt>
 804a333:  >>>  8b 14 b3                mov    (%ebx,%esi,4),%edx
 804a336:       8b 4d f0                mov    0xfffffff0(%ebp),%ecx
 804a339:       89 04 f1                mov    %eax,(%ecx,%esi,8)
 804a33c:       89 54 f1 04             mov    %edx,0x4(%ecx,%esi,8)
 804a340:       46                      inc    %esi
 804a341:       83 c4 04                add    $0x4,%esp
 804a344:       39 fe                   cmp    %edi,%esi
 804a346:       7c e3                   jl     804a32b <main+0x4f>


-- 



More information about the Digitalmars-d-bugs mailing list