public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
@ 2013-02-27 20:13 Paul Pluzhnikov
  2013-02-27 20:14 ` Diego Novillo
  2013-02-27 20:17 ` Andrew Pinski
  0 siblings, 2 replies; 17+ messages in thread
From: Paul Pluzhnikov @ 2013-02-27 20:13 UTC (permalink / raw)
  To: dnovillo, gcc-patches; +Cc: ppluzhnikov

Greetings,

Google ref b/8187733

Build libstdc++-v3/src/c++11/debug.cc with -fno-omit-frame-pointer, so
frame-based unwinder can step through it.

Tested: bootstrap build and verified debug.cc is built with
-fno-omit-frame-pointer.

Ok for google/gcc-4_7 and google/integration?

Thanks,

--
Paul Pluzhnikov


Index: libstdc++-v3/src/c++11/Makefile.am
===================================================================
--- libstdc++-v3/src/c++11/Makefile.am	(revision 196316)
+++ libstdc++-v3/src/c++11/Makefile.am	(working copy)
@@ -124,3 +124,4 @@
 
 # Google-specific pessimization
 functexcept.lo_no_omit_frame_pointer = -fno-omit-frame-pointer
+debug.lo_no_omit_frame_pointer = -fno-omit-frame-pointer
Index: libstdc++-v3/src/c++11/Makefile.in
===================================================================
--- libstdc++-v3/src/c++11/Makefile.in	(revision 196316)
+++ libstdc++-v3/src/c++11/Makefile.in	(working copy)
@@ -391,6 +391,7 @@
 
 # Google-specific pessimization
 functexcept.lo_no_omit_frame_pointer = -fno-omit-frame-pointer
+debug.lo_no_omit_frame_pointer = -fno-omit-frame-pointer
 all: all-am
 
 .SUFFIXES:


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-27 20:13 [google gcc-4_7, integration] Build more of libstdc++ with frame pointers Paul Pluzhnikov
@ 2013-02-27 20:14 ` Diego Novillo
  2013-02-27 20:17 ` Andrew Pinski
  1 sibling, 0 replies; 17+ messages in thread
From: Diego Novillo @ 2013-02-27 20:14 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: gcc-patches

On Wed, Feb 27, 2013 at 3:13 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:

> Ok for google/gcc-4_7 and google/integration?

OK.


Diego.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-27 20:13 [google gcc-4_7, integration] Build more of libstdc++ with frame pointers Paul Pluzhnikov
  2013-02-27 20:14 ` Diego Novillo
@ 2013-02-27 20:17 ` Andrew Pinski
  2013-02-27 20:51   ` Paul Pluzhnikov
  1 sibling, 1 reply; 17+ messages in thread
From: Andrew Pinski @ 2013-02-27 20:17 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: dnovillo, gcc-patches

On Wed, Feb 27, 2013 at 12:13 PM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:
> Greetings,
>
> Google ref b/8187733
>
> Build libstdc++-v3/src/c++11/debug.cc with -fno-omit-frame-pointer, so
> frame-based unwinder can step through it.

Just an aside which program does not understand dwarf2 unwinding?
Perf is setup to understand it.  Valgrind is setup to understand it.
ASAN should be setup to understand it.

Thanks,
Andrew Pinski


>
> Tested: bootstrap build and verified debug.cc is built with
> -fno-omit-frame-pointer.
>
> Ok for google/gcc-4_7 and google/integration?
>
> Thanks,
>
> --
> Paul Pluzhnikov
>
>
> Index: libstdc++-v3/src/c++11/Makefile.am
> ===================================================================
> --- libstdc++-v3/src/c++11/Makefile.am  (revision 196316)
> +++ libstdc++-v3/src/c++11/Makefile.am  (working copy)
> @@ -124,3 +124,4 @@
>
>  # Google-specific pessimization
>  functexcept.lo_no_omit_frame_pointer = -fno-omit-frame-pointer
> +debug.lo_no_omit_frame_pointer = -fno-omit-frame-pointer
> Index: libstdc++-v3/src/c++11/Makefile.in
> ===================================================================
> --- libstdc++-v3/src/c++11/Makefile.in  (revision 196316)
> +++ libstdc++-v3/src/c++11/Makefile.in  (working copy)
> @@ -391,6 +391,7 @@
>
>  # Google-specific pessimization
>  functexcept.lo_no_omit_frame_pointer = -fno-omit-frame-pointer
> +debug.lo_no_omit_frame_pointer = -fno-omit-frame-pointer
>  all: all-am
>
>  .SUFFIXES:
>
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-27 20:17 ` Andrew Pinski
@ 2013-02-27 20:51   ` Paul Pluzhnikov
  2013-02-27 20:53     ` Jeff Law
  0 siblings, 1 reply; 17+ messages in thread
From: Paul Pluzhnikov @ 2013-02-27 20:51 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: dnovillo, gcc-patches

On Wed, Feb 27, 2013 at 12:17 PM, Andrew Pinski <pinskia@gmail.com> wrote:

> Just an aside which program does not understand dwarf2 unwinding?

All Google executables currently link in a frame-based unwinder.

This allows us to report crashes and record runtime statistics from the
executable itself, in ways that are convenient when dealing with thousands
of executables spread across millions of machines, and which are much
harder to achieve using external tools.

There is of course libunwind, but it turns out that it's very hard to
beat speed and simplicity of a frame-based unwinder (which matters when
you collect stack traces across live production services).

I hope this answers your question.

-- 
Paul Pluzhnikov

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-27 20:51   ` Paul Pluzhnikov
@ 2013-02-27 20:53     ` Jeff Law
  2013-02-27 21:46       ` Andrew Pinski
  0 siblings, 1 reply; 17+ messages in thread
From: Jeff Law @ 2013-02-27 20:53 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: Andrew Pinski, dnovillo, gcc-patches

On 02/27/2013 01:50 PM, Paul Pluzhnikov wrote:
> On Wed, Feb 27, 2013 at 12:17 PM, Andrew Pinski <pinskia@gmail.com> wrote:
>
>> Just an aside which program does not understand dwarf2 unwinding?
>
> All Google executables currently link in a frame-based unwinder.
>
> This allows us to report crashes and record runtime statistics from the
> executable itself, in ways that are convenient when dealing with thousands
> of executables spread across millions of machines, and which are much
> harder to achieve using external tools.
>
> There is of course libunwind, but it turns out that it's very hard to
> beat speed and simplicity of a frame-based unwinder (which matters when
> you collect stack traces across live production services).
>
> I hope this answers your question.
Or imagine something like trying to get traces out of low level 
profilers and such.  There are situations where dwarf2 unwinders are 
just too damn bloated.

jeff

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-27 20:53     ` Jeff Law
@ 2013-02-27 21:46       ` Andrew Pinski
  2013-02-27 21:48         ` Jeff Law
  2013-02-27 22:01         ` Paul Pluzhnikov
  0 siblings, 2 replies; 17+ messages in thread
From: Andrew Pinski @ 2013-02-27 21:46 UTC (permalink / raw)
  To: Jeff Law; +Cc: Paul Pluzhnikov, dnovillo, gcc-patches

On Wed, Feb 27, 2013 at 12:53 PM, Jeff Law <law@redhat.com> wrote:
> On 02/27/2013 01:50 PM, Paul Pluzhnikov wrote:
>>
>> On Wed, Feb 27, 2013 at 12:17 PM, Andrew Pinski <pinskia@gmail.com> wrote:
>>
>>> Just an aside which program does not understand dwarf2 unwinding?
>>
>>
>> All Google executables currently link in a frame-based unwinder.
>>
>> This allows us to report crashes and record runtime statistics from the
>> executable itself, in ways that are convenient when dealing with thousands
>> of executables spread across millions of machines, and which are much
>> harder to achieve using external tools.
>>
>> There is of course libunwind, but it turns out that it's very hard to
>> beat speed and simplicity of a frame-based unwinder (which matters when
>> you collect stack traces across live production services).

libunwind is not needed since there is already a dwarf2 based unwinder
that is accessible in libgcc already.  I don't know why people still
promote libunwind when libgcc already has similar facilities.

>>
>> I hope this answers your question.
>
> Or imagine something like trying to get traces out of low level profilers
> and such.  There are situations where dwarf2 unwinders are just too damn
> bloated.

Perf handles this by saving off some of the stack space instead and
then post-process it.  This is why I said perf handles this case
already.  Now oprofile does not but oprofile is really going away.

Thanks,
Andrew

>
> jeff

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-27 21:46       ` Andrew Pinski
@ 2013-02-27 21:48         ` Jeff Law
  2013-02-27 22:01         ` Paul Pluzhnikov
  1 sibling, 0 replies; 17+ messages in thread
From: Jeff Law @ 2013-02-27 21:48 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Paul Pluzhnikov, dnovillo, gcc-patches

On 02/27/2013 02:46 PM, Andrew Pinski wrote:
> Perf handles this by saving off some of the stack space instead and
> then post-process it.  This is why I said perf handles this case
> already.  Now oprofile does not but oprofile is really going away.
I'm well aware of how perf handles this, having had numerous discussions 
with Red Hat's kernel team about this issue.

jeff

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-27 21:46       ` Andrew Pinski
  2013-02-27 21:48         ` Jeff Law
@ 2013-02-27 22:01         ` Paul Pluzhnikov
  2013-02-28  1:52           ` Ian Lance Taylor
  1 sibling, 1 reply; 17+ messages in thread
From: Paul Pluzhnikov @ 2013-02-27 22:01 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Jeff Law, dnovillo, gcc-patches

On Wed, Feb 27, 2013 at 1:46 PM, Andrew Pinski <pinskia@gmail.com> wrote:

> libunwind is not needed since there is already a dwarf2 based unwinder
> that is accessible in libgcc already.

Last I checked, libgcc dwarf handling code called malloc, and thus wasn't
suitable when you want to instrument malloc *itself* to collect stack
traces, nor for SIGPROF profiling.

Is libgcc dwarf code async-signal safe now?
If not, will it ever be?

> I don't know why people still
> promote libunwind when libgcc already has similar facilities.

Because these facilities are not (or at least were not in the recent past)
suitable for the unwinder requirements that people have?

Thanks,
-- 
Paul Pluzhnikov

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-27 22:01         ` Paul Pluzhnikov
@ 2013-02-28  1:52           ` Ian Lance Taylor
  2013-02-28 16:24             ` Paul Pluzhnikov
  0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2013-02-28  1:52 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: Andrew Pinski, Jeff Law, dnovillo, gcc-patches

On Wed, Feb 27, 2013 at 2:01 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
>
> Last I checked, libgcc dwarf handling code called malloc, and thus wasn't
> suitable when you want to instrument malloc *itself* to collect stack
> traces, nor for SIGPROF profiling.
>
> Is libgcc dwarf code async-signal safe now?
> If not, will it ever be?

I think that the libgcc unwinder only calls malloc if somebody calls
__register_frame_info.  And in ordinary circumstances nobody ever
calls that.  I don't think there is an malloc issue there.  Unless
I've forgotten something.

I thought a more serious issue is that the libgcc unwinder has no way
of dealing with a corrupt stack--it will simply crash.

Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-28  1:52           ` Ian Lance Taylor
@ 2013-02-28 16:24             ` Paul Pluzhnikov
  2013-02-28 17:28               ` Ian Lance Taylor
       [not found]               ` <CAAkRFZKKprv8ibFR+4WrMftzCa=hgurJGbmyTuhFDC9tNkgu6w@mail.gmail.com>
  0 siblings, 2 replies; 17+ messages in thread
From: Paul Pluzhnikov @ 2013-02-28 16:24 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Andrew Pinski, Jeff Law, dnovillo, gcc-patches

On Wed, Feb 27, 2013 at 5:52 PM, Ian Lance Taylor <iant@google.com> wrote:

> I think that the libgcc unwinder only calls malloc if somebody calls
> __register_frame_info.

So I looked. Indeed it doesn't call malloc in our environment, but
does call dl_iterate_phdr, which is just as deadly.

To be fair, libunwind does that as well, and we have to provide a
workaround for that.

Still, out-of-the-box libgcc unwinder is not suitable for our unwind
requirements.

> I thought a more serious issue is that the libgcc unwinder has no way
> of dealing with a corrupt stack--it will simply crash.

That too ...

Thanks,
-- 
Paul Pluzhnikov

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-28 16:24             ` Paul Pluzhnikov
@ 2013-02-28 17:28               ` Ian Lance Taylor
  2013-02-28 18:11                 ` Paul Pluzhnikov
       [not found]               ` <CAAkRFZKKprv8ibFR+4WrMftzCa=hgurJGbmyTuhFDC9tNkgu6w@mail.gmail.com>
  1 sibling, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2013-02-28 17:28 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: Andrew Pinski, Jeff Law, dnovillo, gcc-patches

On Thu, Feb 28, 2013 at 8:23 AM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> On Wed, Feb 27, 2013 at 5:52 PM, Ian Lance Taylor <iant@google.com> wrote:
>
>> I think that the libgcc unwinder only calls malloc if somebody calls
>> __register_frame_info.
>
> So I looked. Indeed it doesn't call malloc in our environment, but
> does call dl_iterate_phdr, which is just as deadly.

Hmmm, I guess I can't remember why.  dl_iterate_phdr uses a recursive
lock so there shouldn't be any deadlock problem.  If the problem is
the dynamic lookup of the dl_iterate_phdr symbol for lazy PLT
evaluation, that could be finessed by calling it beforehand.

Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-28 17:28               ` Ian Lance Taylor
@ 2013-02-28 18:11                 ` Paul Pluzhnikov
  2013-02-28 18:36                   ` Ian Lance Taylor
  2013-02-28 19:57                   ` Cary Coutant
  0 siblings, 2 replies; 17+ messages in thread
From: Paul Pluzhnikov @ 2013-02-28 18:11 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Andrew Pinski, Jeff Law, dnovillo, gcc-patches

On Thu, Feb 28, 2013 at 9:28 AM, Ian Lance Taylor <iant@google.com> wrote:

>> does call dl_iterate_phdr, which is just as deadly.
>
> Hmmm, I guess I can't remember why.

Let me refresh your memory. You've seen this deadlock before:

  Thread 1                    Thread 2
  dlopen                      malloc
   ... takes loader lock       ... takes malloc lock
   malloc                      _Unwind_Backtrace
   ... needs malloc lock         dl_iterate_phdr
       held by T2                ... needs loader lock held by T1



--
Paul Pluzhnikov

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-28 18:11                 ` Paul Pluzhnikov
@ 2013-02-28 18:36                   ` Ian Lance Taylor
  2013-02-28 19:57                   ` Cary Coutant
  1 sibling, 0 replies; 17+ messages in thread
From: Ian Lance Taylor @ 2013-02-28 18:36 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: Andrew Pinski, Jeff Law, dnovillo, gcc-patches

On Thu, Feb 28, 2013 at 10:10 AM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:
> On Thu, Feb 28, 2013 at 9:28 AM, Ian Lance Taylor <iant@google.com> wrote:
>
>>> does call dl_iterate_phdr, which is just as deadly.
>>
>> Hmmm, I guess I can't remember why.
>
> Let me refresh your memory. You've seen this deadlock before:
>
>   Thread 1                    Thread 2
>   dlopen                      malloc
>    ... takes loader lock       ... takes malloc lock
>    malloc                      _Unwind_Backtrace
>    ... needs malloc lock         dl_iterate_phdr
>        held by T2                ... needs loader lock held by T1

Oh yeah.  Thanks.

Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-28 18:11                 ` Paul Pluzhnikov
  2013-02-28 18:36                   ` Ian Lance Taylor
@ 2013-02-28 19:57                   ` Cary Coutant
  2013-02-28 19:59                     ` Jakub Jelinek
  1 sibling, 1 reply; 17+ messages in thread
From: Cary Coutant @ 2013-02-28 19:57 UTC (permalink / raw)
  To: Paul Pluzhnikov
  Cc: Ian Lance Taylor, Andrew Pinski, Jeff Law, Diego Novillo, gcc-patches

>   Thread 1                    Thread 2
>   dlopen                      malloc
>    ... takes loader lock       ... takes malloc lock
>    malloc                      _Unwind_Backtrace
>    ... needs malloc lock         dl_iterate_phdr
>        held by T2                ... needs loader lock held by T1

Am I missing something, or wouldn't it be feasible when instrumenting
malloc to call _Unwind_Backtrace before obtaining the malloc lock (or
drop the malloc lock while calling _Unwind_Backtrace)? Similarly,
couldn't dlopen drop the loader lock while calling malloc?

-cary

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-28 19:57                   ` Cary Coutant
@ 2013-02-28 19:59                     ` Jakub Jelinek
  2013-02-28 22:04                       ` Paul Pluzhnikov
  0 siblings, 1 reply; 17+ messages in thread
From: Jakub Jelinek @ 2013-02-28 19:59 UTC (permalink / raw)
  To: Cary Coutant
  Cc: Paul Pluzhnikov, Ian Lance Taylor, Andrew Pinski, Jeff Law,
	Diego Novillo, gcc-patches

On Thu, Feb 28, 2013 at 11:57:48AM -0800, Cary Coutant wrote:
> Similarly, couldn't dlopen drop the loader lock while calling malloc?

It can't, but perhaps it could call some alternative malloc instead
(the simpler malloc version in ld.so or similar).

	Jakub

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
       [not found]               ` <CAAkRFZKKprv8ibFR+4WrMftzCa=hgurJGbmyTuhFDC9tNkgu6w@mail.gmail.com>
@ 2013-02-28 21:50                 ` Paul Pluzhnikov
  0 siblings, 0 replies; 17+ messages in thread
From: Paul Pluzhnikov @ 2013-02-28 21:50 UTC (permalink / raw)
  To: Xinliang David Li
  Cc: Ian Lance Taylor, Andrew Pinski, Jeff Law, Diego Novillo, GCC Patches

On Thu, Feb 28, 2013 at 9:07 AM, Xinliang David Li <davidxl@google.com> wrote:

> Any insight about the relative performance of the two implementations?

We have a benchmark for the speed of unwinder. Here are results.

The number /1, /2, etc. is the number of levels in the stack trace.

Using frame-based unwinder:

Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_GetStackTrace/1          29         29   24137931
BM_GetStackTrace/2          38         38   17948718
BM_GetStackTrace/3          43         44   16279070
BM_GetStackTrace/4          57         57   10000000
BM_GetStackTrace/5          62         62   10000000
BM_GetStackTrace/6          65         65   10000000
BM_GetStackTrace/7          65         64   10000000
BM_GetStackTrace/8          65         65   10000000
BM_GetStackTrace/9          65         65   10000000
BM_GetStackTrace/10         65         65   10000000


Using libgcc:

Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_GetStackTrace/1        1543       1543     466667
BM_GetStackTrace/2        2042       2057     350000
BM_GetStackTrace/3        2378       2366     291667
BM_GetStackTrace/4        2754       2720     250000
BM_GetStackTrace/5        3212       3200     218750
BM_GetStackTrace/6        3655       3651     194444
BM_GetStackTrace/7        4039       4000     175000
BM_GetStackTrace/8        4009       4000     175000
BM_GetStackTrace/9        4002       4000     175000
BM_GetStackTrace/10       4017       4000     175000


Using libunwind:

Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_GetStackTrace/1         109        108    6363636
BM_GetStackTrace/2         121        122    5833333
BM_GetStackTrace/3         130        130    5000000
BM_GetStackTrace/4         133        132    5000000
BM_GetStackTrace/5         148        148    4666667
BM_GetStackTrace/6         162        162    4375000
BM_GetStackTrace/7         174        175    4117647
BM_GetStackTrace/8         185        185    3888889
BM_GetStackTrace/9         188        187    3684211
BM_GetStackTrace/10        188        187    3684211

Conclusions:
- frame based unwinder is hard to beat (re-confirmed :-)
- libunwind is getting really close at 3x the overhead
- libgcc is nowhere close at 50x.

-- 
Paul Pluzhnikov

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [google gcc-4_7, integration] Build more of libstdc++ with frame pointers
  2013-02-28 19:59                     ` Jakub Jelinek
@ 2013-02-28 22:04                       ` Paul Pluzhnikov
  0 siblings, 0 replies; 17+ messages in thread
From: Paul Pluzhnikov @ 2013-02-28 22:04 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Cary Coutant, Ian Lance Taylor, Andrew Pinski, Jeff Law,
	Diego Novillo, gcc-patches

On Thu, Feb 28, 2013 at 11:59 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Feb 28, 2013 at 11:57:48AM -0800, Cary Coutant wrote:
>> Similarly, couldn't dlopen drop the loader lock while calling malloc?
>
> It can't, but perhaps it could call some alternative malloc instead
> (the simpler malloc version in ld.so or similar).

ld-linux starts calling the simpler malloc in dl-minimal.c, then switches to
"real" libc.so.6 malloc later on.

This behavior causes a lot of pain to anyone who tries to interpose malloc
and use dlsym(RTLD_NEXT,...) or similar from the interposer.

Roland explained to me ~15 years ago why it is that way (it had something to
do with Hurd); an explanation I can't find at the moment.

-- 
Paul Pluzhnikov

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-02-28 22:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 20:13 [google gcc-4_7, integration] Build more of libstdc++ with frame pointers Paul Pluzhnikov
2013-02-27 20:14 ` Diego Novillo
2013-02-27 20:17 ` Andrew Pinski
2013-02-27 20:51   ` Paul Pluzhnikov
2013-02-27 20:53     ` Jeff Law
2013-02-27 21:46       ` Andrew Pinski
2013-02-27 21:48         ` Jeff Law
2013-02-27 22:01         ` Paul Pluzhnikov
2013-02-28  1:52           ` Ian Lance Taylor
2013-02-28 16:24             ` Paul Pluzhnikov
2013-02-28 17:28               ` Ian Lance Taylor
2013-02-28 18:11                 ` Paul Pluzhnikov
2013-02-28 18:36                   ` Ian Lance Taylor
2013-02-28 19:57                   ` Cary Coutant
2013-02-28 19:59                     ` Jakub Jelinek
2013-02-28 22:04                       ` Paul Pluzhnikov
     [not found]               ` <CAAkRFZKKprv8ibFR+4WrMftzCa=hgurJGbmyTuhFDC9tNkgu6w@mail.gmail.com>
2013-02-28 21:50                 ` Paul Pluzhnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).