• 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
Crash in dylib on Leopard, only on 64bit Intel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crash in dylib on Leopard, only on 64bit Intel


  • Subject: Crash in dylib on Leopard, only on 64bit Intel
  • From: Marc Liyanage <email@hidden>
  • Date: Mon, 5 Nov 2007 12:27:31 +0100


I am trying to build a PHP module for Apache in Leopard. The module has some PHP extensions loaded dynamically.
One of them crashes upon load, but only on x86_64, not on i386. The .so file is a universal binary.


From looking at the trace, it seems to crash somewhere in dylib. I am not sure if this is a bug in the API client code or a problem in dylib.

Has anybody seen this before?

-Marc




_________________________________________________________________ Marc Liyanage http://www.entropy.ch




This is the stack trace:


Starting program: /usr/local/php5/bin/php -v Reading symbols for shared libraries ++++++++++++.... done Reading symbols for shared libraries .. done Reading symbols for shared libraries ..... done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000180e6d021
0x00007fff82481a70 in _mh_dylib_header ()
(gdb) bt
#0 0x00007fff82481a70 in _mh_dylib_header ()
#1 0x0000000000000003 in ?? ()
#2 0x00007fff5fc0d037 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#3 0x00007fff5fc0d020 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#4 0x00007fff5fc0d164 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
#5 0x00007fff5fc09518 in __dyld_NSLinkModule ()
#6 0x00007fff82be5b6f in NSLinkModule ()
#7 0x00000001003d8228 in zend_mh_bundle_load (bundle_path=0x100da20dc "/usr/local/php5/lib/php/extensions/no- debug-non-zts-20060613/gettext.so") at /Users/liyanage/svn/entropy/ universalbuild/src/php-5.2.4/Zend/zend_extensions.c:246
#8 0x00000001002ca452 in php_dl (file=0x100e05970, type=1, return_value=0x7fff5fbff1c0, start_now=0) at /Users/liyanage/svn/ entropy/universalbuild/src/php-5.2.4/ext/standard/dl.c:138
#9 0x000000010037da48 in php_load_function_extension_cb (arg=0x100e05970) at /Users/liyanage/svn/entropy/universalbuild/src/ php-5.2.4/main/php_ini.c:235
#10 0x00000001003c1442 in zend_llist_apply (l=0x1007bc9f8, func=0x10037da1d <php_load_function_extension_cb>) at /Users/ liyanage/svn/entropy/universalbuild/src/php-5.2.4/Zend/zend_llist.c: 193
#11 0x000000010037e61d in php_ini_register_extensions () at /Users/ liyanage/svn/entropy/universalbuild/src/php-5.2.4/main/php_ini.c:590
#12 0x0000000100375165 in php_module_startup (sf=0x100796760, additional_modules=0x0, num_additional_modules=0) at /Users/liyanage/ svn/entropy/universalbuild/src/php-5.2.4/main/main.c:1801
#13 0x000000010044a919 in php_cli_startup (sapi_module=0x100796760) at /Users/liyanage/svn/entropy/universalbuild/src/php-5.2.4/sapi/cli/ php_cli.c:358
#14 0x000000010044b48c in main (argc=2, argv=0x7fff5fbff6b8) at / Users/liyanage/svn/entropy/universalbuild/src/php-5.2.4/sapi/cli/ php_cli.c:717





This is the last non-Apple code:


void *zend_mh_bundle_load(char* bundle_path)
{
	NSObjectFileImage bundle_image;
	NSModule bundle_handle;
	NSSymbol bundle_init_nssymbol;
	void (*bundle_init)(void);

if (NSCreateObjectFileImageFromFile(bundle_path, &bundle_image) != NSObjectFileImageSuccess) {
return NULL;
}


bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_PRIVATE);
NSDestroyObjectFileImage(bundle_image);


And this is some otool information:


primavera:universalbuild liyanage$ otool -arch all -hv //usr/local/ php5/lib/php/extensions/no-debug-non-zts-20060613/gettext.so
//usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/ gettext.so (architecture i386):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC I386 ALL 0x00 BUNDLE 12 940 NOUNDEFS DYLDLINK TWOLEVEL
//usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/ gettext.so (architecture x86_64):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC_64 X86_64 ALL 0x00 BUNDLE 11 1248 NOUNDEFS DYLDLINK TWOLEVEL
//usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/ gettext.so (architecture ppc7400):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC PPC ppc7400 0x00 BUNDLE 11 952 NOUNDEFS DYLDLINK TWOLEVEL
//usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/ gettext.so (architecture ppc64):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC_64 PPC64 ALL 0x00 BUNDLE 11 1088 NOUNDEFS DYLDLINK TWOLEVEL





_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Xcode 3: Keyboard shortcut for "Continue"
  • Next by Date: Re: Perforce and XCode 3 crash?
  • Previous by thread: Link errors in Xcode 2.5
  • Next by thread: Link error for "mach_absolute_time"
  • Index(es):
    • Date
    • Thread