Skip to content

git SIGABRT when dynamic override #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xxpxxxxp opened this issue Jul 31, 2019 · 2 comments
Closed

git SIGABRT when dynamic override #119

xxpxxxxp opened this issue Jul 31, 2019 · 2 comments

Comments

@xxpxxxxp
Copy link

xxpxxxxp commented Jul 31, 2019

I've tried dynamic override with

export DYLD_INSERT_LIBRARIES=/usr/lib/libmimalloc.dylib
git status

Then got: signal SIGABRT
My system is MacOS Mojave 10.14.3, git version 2.22.0 from HomeBrew
Some clue from debug version of mimalloc

  * frame #0: 0x00007fff5b4e623e libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff5b59cc1c libsystem_pthread.dylib`pthread_kill + 285
    frame #2: 0x00007fff5b44f1c9 libsystem_c.dylib`abort + 127
    frame #3: 0x00000001003a7b6a libmimalloc-debug.dylib`_mi_assert_fail(assertion="false", fname="/Users/ypwang/sources/dev/mimalloc/src/options.c", line=134, func="_mi_error_message") at options.c:149
    frame #4: 0x00000001003a877c libmimalloc-debug.dylib`_mi_error_message(fmt="trying to mi_free a pointer that does not point to a valid heap space: %p\n") at options.c:134
    frame #5: 0x00000001003a3803 libmimalloc-debug.dylib`mi_free(p=0x0000000100500090) at alloc.c:215
    frame #6: 0x00007fff5a2c68cc libobjc.A.dylib`_NXHashRehashToCapacity + 214
    frame #7: 0x00007fff5a2c67d8 libobjc.A.dylib`NXHashInsert + 373
    frame #8: 0x00007fff5a2c64d1 libobjc.A.dylib`NXCreateHashTableFromZone + 310
    frame #9: 0x00007fff5a2c6392 libobjc.A.dylib`NXCreateHashTable + 47
    frame #10: 0x00007fff5a2c626d libobjc.A.dylib`NXCreateMapTableFromZone + 79
    frame #11: 0x00007fff5a2c6217 libobjc.A.dylib`NXCreateMapTable + 39
    frame #12: 0x00007fff5a2c54bb libobjc.A.dylib`_read_images + 505
    frame #13: 0x00007fff5a2c4473 libobjc.A.dylib`map_images_nolock + 1197
    frame #14: 0x00007fff5a2d8279 libobjc.A.dylib`map_images + 68
    frame #15: 0x00000001002bf571 dyld`dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) + 1477
    frame #16: 0x00000001002bf69a dyld`dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) + 63
    frame #17: 0x00007fff5b392313 libdyld.dylib`_dyld_objc_notify_register + 113
    frame #18: 0x00007fff5a2c3c34 libobjc.A.dylib`_objc_init + 116
    frame #19: 0x00007fff5b3585c8 libdispatch.dylib`_os_object_init + 13
    frame #20: 0x00007fff5b3643ab libdispatch.dylib`libdispatch_init + 282
    frame #21: 0x00007fff5881b9c5 libSystem.B.dylib`libSystem_initializer + 121
    frame #22: 0x00000001002d2cc8 dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 518
    frame #23: 0x00000001002d2ec6 dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
    frame #24: 0x00000001002ce0da dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 358
    frame #25: 0x00000001002ce06d dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 249
    frame #26: 0x00000001002cd254 dyld`ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 134
    frame #27: 0x00000001002cd2e8 dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 74
    frame #28: 0x00000001002bc72e dyld`dyld::initializeMainExecutable() + 129
    frame #29: 0x00000001002c178f dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 6237
    frame #30: 0x00000001002bb4f6 dyld`dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 1154
    frame #31: 0x00000001002bb036 dyld`_dyld_start + 54```
@xxpxxxxp
Copy link
Author

By the way I've also tried static link libmimalloc to build OpenJDK on MacOS, the build is success while running the java binary also gives SIGABRT. I haven't debug that yet, if current problem could be solved I'll try if that fixed too.

@daanx
Copy link
Collaborator

daanx commented Aug 10, 2019

Yes, the dynamic overriding on macOS is currently not working but I am working on it!
See #50.

@daanx daanx closed this as completed Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants