Issue 5402 - Invalid free() when throwing non-Throwable
Summary: Invalid free() when throwing non-Throwable
Status: RESOLVED DUPLICATE of issue 5447
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: Sean Kelly
URL:
Keywords: EH
Depends on: 5447
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-03 05:15 UTC by Lars T. Kyllingstad
Modified: 2011-02-07 00:07 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Lars T. Kyllingstad 2011-01-03 05:15:24 UTC
class Foo { }
void main()
{
    throw new Foo;
}


When I run this code on 64-bit Linux, it produces the following error message:


test.Foo
*** glibc detected *** ./test: free(): invalid pointer: 0xf7458014 ***
======= Backtrace: =========
/lib32/libc.so.6(+0x6c231)[0xf75c2231]
/lib32/libc.so.6(+0x6dab8)[0xf75c3ab8]
/lib32/libc.so.6(cfree+0x6d)[0xf75c6b9d]
./test(_D4core7runtime19defaultTraceHandlerFPvZC6object9Throwable9TraceInfo16DefaultTraceInfo6__dtorMFZv+0xe)[0x80636aa]
./test(rt_finalize+0x5b)[0x8062b3b]
./test(_D2gc3gcx3Gcx11fullcollectMFPvZk+0x4a4)[0x8061e18]
./test(_D2gc3gcx3Gcx16fullcollectshellMFZk+0x26)[0x8061966]
./test(_D2gc3gcx2GC18fullCollectNoStackMFZv+0x29)[0x8060b61]
./test(gc_term+0x10)[0x805f320]
./test(_D2rt6dmain24mainUiPPaZi6runAllMFZv+0x59)[0x805d1bd]
./test(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x24)[0x805d0ac]
./test(main+0x94)[0x805d054]
/lib32/libc.so.6(__libc_start_main+0xe6)[0xf756cbd6]
./test[0x805a991]
======= Memory map: ========
08048000-0806e000 r-xp 00000000 00:15 4199206                            /home/lars/tmp/test
0806e000-0806f000 r-xp 00025000 00:15 4199206                            /home/lars/tmp/test
0806f000-08072000 rwxp 00026000 00:15 4199206                            /home/lars/tmp/test
095b9000-095da000 rwxp 00000000 00:00 0                                  [heap]
f7300000-f7321000 rwxp 00000000 00:00 0 
f7321000-f7400000 ---p 00000000 00:00 0 
f7436000-f7453000 r-xp 00000000 08:01 1059286                            /usr/lib32/libgcc_s.so.1
f7453000-f7454000 r-xp 0001c000 08:01 1059286                            /usr/lib32/libgcc_s.so.1
f7454000-f7455000 rwxp 0001d000 08:01 1059286                            /usr/lib32/libgcc_s.so.1
f7455000-f7556000 rwxp 00000000 00:00 0 
f7556000-f76a9000 r-xp 00000000 08:01 5898307                            /lib32/libc-2.11.1.so
f76a9000-f76aa000 ---p 00153000 08:01 5898307                            /lib32/libc-2.11.1.so
f76aa000-f76ac000 r-xp 00153000 08:01 5898307                            /lib32/libc-2.11.1.so
f76ac000-f76ad000 rwxp 00155000 08:01 5898307                            /lib32/libc-2.11.1.so
f76ad000-f76b1000 rwxp 00000000 00:00 0 
f76b1000-f76d5000 r-xp 00000000 08:01 5898281                            /lib32/libm-2.11.1.so
f76d5000-f76d6000 r-xp 00023000 08:01 5898281                            /lib32/libm-2.11.1.so
f76d6000-f76d7000 rwxp 00024000 08:01 5898281                            /lib32/libm-2.11.1.so
f76d7000-f76ec000 r-xp 00000000 08:01 5898303                            /lib32/libpthread-2.11.1.so
f76ec000-f76ed000 r-xp 00014000 08:01 5898303                            /lib32/libpthread-2.11.1.so
f76ed000-f76ee000 rwxp 00015000 08:01 5898303                            /lib32/libpthread-2.11.1.so
f76ee000-f76f0000 rwxp 00000000 00:00 0 
f770d000-f770f000 rwxp 00000000 00:00 0 
f770f000-f7710000 r-xp 00000000 00:00 0                                  [vdso]
f7710000-f772c000 r-xp 00000000 08:01 5898290                            /lib32/ld-2.11.1.so
f772c000-f772d000 r-xp 0001b000 08:01 5898290                            /lib32/ld-2.11.1.so
f772d000-f772e000 rwxp 0001c000 08:01 5898290                            /lib32/ld-2.11.1.so
ff922000-ff937000 rwxp 00000000 00:00 0                                  [stack]
Comment 1 Brad Roberts 2011-02-06 15:40:58 UTC
Mass migration of bugs marked as x86-64 to just x86.  The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.
Comment 2 Don 2011-02-07 00:07:01 UTC
This is really a special case of bug 5447, rather than a straight duplicate; but anyway it is fixed in the next release.

*** This issue has been marked as a duplicate of issue 5447 ***