This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _FORTIFY_SOURCE for std::vector


On Fri, Jun 01, 2012 at 03:39:12PM +0200, Paolo Carlini wrote:
> On 06/01/2012 03:34 PM, Jakub Jelinek wrote:
> >The standard -D_FORTIFY_SOURCE failure is __chk_fail (), so IMNSHO
> >if this is presented as _FORTIFY_SOURCE check, it should call that
> >and not some other function.
> I understand. I don't know much about -D_FORTIFY_SOURCE, honestly. I
> hope the diagnostics provided by __chk_fail is good enough. And
> well, then we really do have to explain in a comment where
> __chk_fail is coming from ;)

The default error output is like:
*** buffer overflow detected ***: /tmp/a terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x388e3097e7]
/lib64/libc.so.6[0x388e3079a0]
/tmp/a[0x40050a]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x388e221735]
/tmp/a[0x400419]
======= Memory map: ========
00400000-00401000 r-xp 00000000 08:02 147893                             /tmp/a
00600000-00601000 rw-p 00000000 08:02 147893                             /tmp/a
01b63000-01b84000 rw-p 00000000 00:00 0                                  [heap]
388de00000-388de20000 r-xp 00000000 08:02 1201564                        /usr/lib64/ld-2.15.so
388e01f000-388e020000 r--p 0001f000 08:02 1201564                        /usr/lib64/ld-2.15.so
388e020000-388e021000 rw-p 00020000 08:02 1201564                        /usr/lib64/ld-2.15.so
388e021000-388e022000 rw-p 00000000 00:00 0 
388e200000-388e3ac000 r-xp 00000000 08:02 1201757                        /usr/lib64/libc-2.15.so
388e3ac000-388e5ac000 ---p 001ac000 08:02 1201757                        /usr/lib64/libc-2.15.so
388e5ac000-388e5b0000 r--p 001ac000 08:02 1201757                        /usr/lib64/libc-2.15.so
388e5b0000-388e5b2000 rw-p 001b0000 08:02 1201757                        /usr/lib64/libc-2.15.so
388e5b2000-388e5b7000 rw-p 00000000 00:00 0 
3891200000-3891215000 r-xp 00000000 08:02 1201763                        /usr/lib64/libgcc_s-4.7.0-20120507.so.1
3891215000-3891414000 ---p 00015000 08:02 1201763                        /usr/lib64/libgcc_s-4.7.0-20120507.so.1
3891414000-3891415000 rw-p 00014000 08:02 1201763                        /usr/lib64/libgcc_s-4.7.0-20120507.so.1
7feee518f000-7feee5192000 rw-p 00000000 00:00 0 
7feee51a5000-7feee51a7000 rw-p 00000000 00:00 0 
7fff27a66000-7fff27a87000 rw-p 00000000 00:00 0                          [stack]
7fff27bff000-7fff27c00000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]