From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Monakov Subject: Re: [PATCH lttng-ust] Add trace support for calloc and realloc. Date: Thu, 1 Aug 2013 21:19:56 +0400 (MSK) Message-ID: References: <51F3585E.20705@mentor.com> <51F82C45.6020502@mentor.com> <51FA8DAE.3070409@mentor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.ispras.ru ([83.149.199.79]) by ltt.polymtl.ca with esmtp (Exim 4.72) (envelope-from ) id 1V4wXw-00072t-JL for lttng-dev@lists.lttng.org; Thu, 01 Aug 2013 13:20:22 -0400 In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org To: Stefan Seefeld Cc: lttng-dev@lists.lttng.org List-Id: lttng-dev@lists.lttng.org On Thu, 1 Aug 2013, Alexander Monakov wrote: > Okay, one more hack :) > > Recurse *once* by calling dlsym inside your calloc, and terminate recursion by > obtaining memory from mmap. Correction: since there's no guarantee that the very first calloc invocation will happen from inside dlsym, you have to recurse twice, not once, to be sure that there are two dlsyms on the stack.