From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31859 invoked by alias); 29 Apr 2013 12:29:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31841 invoked by uid 48); 29 Apr 2013 12:29:25 -0000 From: "jb.1234abcd at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57111] New: Core dump - invalid pointer detected after std::unique_ptr Date: Mon, 29 Apr 2013 12:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jb.1234abcd at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg02332.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57111 Bug #: 57111 Summary: Core dump - invalid pointer detected after std::unique_ptr Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: jb.1234abcd@gmail.com $ cat uniqueptr.cpp #include #include int main () { int arr[]={1,2}; std::unique_ptr up(arr); std::cout << up[0]; return 0; } $ g++ -std=c++11 -Wall -o uniqueptr uniqueptr.cpp $ ./uniqueptr *** glibc detected *** ./uniqueptr: free(): invalid pointer: 0xbfe35788 *** ======= Backtrace: ========= /lib/libc.so.6[0x4ce44ff9] /lib/libstdc++.so.6(_ZdlPv+0x20)[0x4d414500] /lib/libstdc++.so.6(_ZdaPv+0x1c)[0x4d41455c] ./uniqueptr[0x80489fd] ./uniqueptr[0x8048966] ./uniqueptr[0x8048765] /lib/libc.so.6(__libc_start_main+0xf5)[0x4cde8865] ./uniqueptr[0x8048611] ======= Memory map: ======== 08048000-0804a000 r-xp 00000000 08:09 1963079 /home/jb/prog-c++/uniqueptr 0804a000-0804b000 r--p 00001000 08:09 1963079 /home/jb/prog-c++/uniqueptr 0804b000-0804c000 rw-p 00002000 08:09 1963079 /home/jb/prog-c++/uniqueptr 08dbf000-08de0000 rw-p 00000000 00:00 0 [heap] 4cdac000-4cdcb000 r-xp 00000000 08:09 655817 /usr/lib/ld-2.16.so 4cdcb000-4cdcc000 r--p 0001e000 08:09 655817 /usr/lib/ld-2.16.so 4cdcc000-4cdcd000 rw-p 0001f000 08:09 655817 /usr/lib/ld-2.16.so 4cdcf000-4cf7f000 r-xp 00000000 08:09 659071 /usr/lib/libc-2.16.so 4cf7f000-4cf81000 r--p 001b0000 08:09 659071 /usr/lib/libc-2.16.so 4cf81000-4cf82000 rw-p 001b2000 08:09 659071 /usr/lib/libc-2.16.so 4cf82000-4cf85000 rw-p 00000000 00:00 0 4cfce000-4d00c000 r-xp 00000000 08:09 664509 /usr/lib/libm-2.16.so 4d00c000-4d00d000 r--p 0003d000 08:09 664509 /usr/lib/libm-2.16.so 4d00d000-4d00e000 rw-p 0003e000 08:09 664509 /usr/lib/libm-2.16.so 4d010000-4d02c000 r-xp 00000000 08:09 664696 /usr/lib/libgcc_s-4.7.2-20121109.so.1 4d02c000-4d02d000 r--p 0001b000 08:09 664696 /usr/lib/libgcc_s-4.7.2-20121109.so.1 4d02d000-4d02e000 rw-p 0001c000 08:09 664696 /usr/lib/libgcc_s-4.7.2-20121109.so.1 4d3c9000-4d4a9000 r-xp 00000000 08:09 664705 /usr/lib/libstdc++.so.6.0.17 4d4a9000-4d4ad000 r--p 000df000 08:09 664705 /usr/lib/libstdc++.so.6.0.17 4d4ad000-4d4af000 rw-p 000e3000 08:09 664705 /usr/lib/libstdc++.so.6.0.17 4d4af000-4d4b5000 rw-p 00000000 00:00 0 b7777000-b777a000 rw-p 00000000 00:00 0 b778b000-b778e000 rw-p 00000000 00:00 0 b778e000-b778f000 r-xp 00000000 00:00 0 [vdso] bfe17000-bfe38000 rw-p 00000000 00:00 0 [stack] 1Aborted (core dumped) $ Packages: gcc-c++-4.7.2-8.fc18.i686 glibc-2.16-30.fc18.i686 libstdc++-4.7.2-8.fc18.i686