• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
libgmalloc problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libgmalloc problem


  • Subject: libgmalloc problem
  • From: "Martin Mitas" <email@hidden>
  • Date: Thu, 1 Nov 2007 13:16:42 +0100
  • Thread-topic: libgmalloc problem

Hi all.

Hopefully this is the right list to report this problem.

To debug our SW, we try to use libgmalloc, as described here:
http://developer.apple.com/technotes/tn2004/tn2124.html
However we encountered troubles with libgmalloc. The following
simple program is good enough to demonstrate it.


/* problem.c */

#include <stdio.h>

int
main(int argc, char** argv)
{
    int i;
    for(i = 0; i < argc; i++)
        printf("argv[%d]: %s\n", i, argv[i]);
    return 0;
}


The following commands then lead to a crash:

$ gcc -O2 -fomit-frame-pointer problem.c
$ DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib ./a.out foo bar
Allocations will be placed on word (4 byte) boundaries.
 - Small buffer overruns may not be noticed.
 - Applications using AltiVec instructions may fail.
GuardMalloc-11
Segmentation fault (core dumped)

Backtrace from gdb shows:
#0  0x9b1e7882 in GMmalloc ()
#1  0x900f6b7b in localeconv_l ()
#2  0x9000b201 in __vfprintf ()
#3  0x900e3b50 in vfprintf_l ()
#4  0x9001c90f in printf ()
#5  0x00001f8f in main ()

When not using -fomit-frame-pointer or not using libgmalloc, the program
works as expected.

Our configuration:
- Intel based mac with Mac OS X 10.4.x
- gcc 4.0.1

Is it bug in gcc or in libgmalloc, or is it (documented?) limitation of
libgmalloc? What compiler/linker options can/cannot be used with
libgmalloc?

Any relevant answer or pointer to documentation would be appreciated.

Mity

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: libgmalloc problem
      • From: Terry Lambert <email@hidden>
  • Prev by Date: Building 10.5 kernel
  • Next by Date: Re: Darwin 9.0 Source Code Available
  • Previous by thread: Building 10.5 kernel
  • Next by thread: Re: libgmalloc problem
  • Index(es):
    • Date
    • Thread