This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
Re: [Bug malloc/16573] mtrace hangs when MALLOC_TRACE is defined
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: kcy at codesourcery dot com <sourceware-bugzilla at sourceware dot org>
- Cc: glibc-bugs at sourceware dot org
- Date: Thu, 13 Feb 2014 13:23:50 +0100
- Subject: Re: [Bug malloc/16573] mtrace hangs when MALLOC_TRACE is defined
- Authentication-results: sourceware.org; auth=none
- References: <bug-16573-131 at http dot sourceware dot org/bugzilla/> <bug-16573-131-9CpkeDfJhI at http dot sourceware dot org/bugzilla/>
On Thu, Feb 13, 2014 at 11:44:49AM +0000, kcy at codesourcery dot com wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=16573
>
> --- Comment #1 from Kwok Yeung <kcy at codesourcery dot com> ---
> Created attachment 7410
> --> https://sourceware.org/bugzilla/attachment.cgi?id=7410&action=edit
> Patch to temporarily undo all mtrace hooks
>
> I think the easiest approach to fixing this is simply to undo all the hooks
> whenever an mtrace hook is called before proceeding, and redo them afterwards -
> I have attached a patch against the git master to do this. I suppose this might
> cause some memory errors to be missed in a multi-threaded program, but that is
> already somewhat the case already.
>
A proper solution would be replace a mtrace with better tool, as hook
approach is not thread safe and implementation is quite slow.