Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upOSX debugging #50
OSX debugging #50
Comments
This comment has been minimized.
This comment has been minimized.
|
I am actually wondering if this might be a bug in our code. |
This comment has been minimized.
This comment has been minimized.
|
Can't you put it in a debugger and take a look what exactly is happening? But it seems like there is memory being freed during global init (maybe because of a resize?). Interesting points would be to know what is the state of the heap at that point or right before it, what allocated that memory. I completely don't know how the override works on osx, but we had some problems like that because of the ordering of the heap initialization and overrides. |
This comment has been minimized.
This comment has been minimized.
|
Ah, that is no good! I am on it -- tomorrow I have access to a Mac and will look into it. For now, the message implies that a pointer is freed that perhaps was allocated using some other
Tomorrow I will also look into it, but just wanted to offer some pointers. There is also the |
This comment has been minimized.
This comment has been minimized.
|
MI_INTERPOSE=OFF
MI_INTERPOSE=ON
I have just pulled the following change into the branch arangodb/arangodb@6354372 Unfortunately we end up with a different error in I guess I use the overrides incorrectly.
|
This comment has been minimized.
This comment has been minimized.
|
Any idea why the allocations could be partially replaced? After adding an extra override for |
This comment has been minimized.
This comment has been minimized.
|
Great -- thanks for the debug output. I am currently working on a mac book through these problems too and addressing various issues. My feeling is indeed that the system |
This comment has been minimized.
This comment has been minimized.
|
I think the latest |
This comment has been minimized.
This comment has been minimized.
|
Thank You! Unfortunately we have still problems.
|
This comment has been minimized.
This comment has been minimized.
|
Good to hear there is progress -- just to confirm , the Actually, this could be related to another issue in the Apologies for your trouble, but your feedback is very helpful to get automatic overriding to work well on macOS. |
This comment has been minimized.
This comment has been minimized.
|
Sources upgraded maybe 3 hours ago from
Thank you for your time! |
This comment has been minimized.
This comment has been minimized.
|
Ah.. frustrating.. on Linux/BSD systems this is so easy with LD_PRELOAD ... :-) |
This comment has been minimized.
This comment has been minimized.
|
I there anything I can do? Should I try a newer version? |
This comment has been minimized.
This comment has been minimized.
|
Ah sorry for not following up -- I have been just a bit too busy to look into it further. However, I have been working on improving the situation of dynamic overriding on Windows which should also help on the macOS side. I will try to look into it later today or otherwise tomorrow as I do have a macbook available now for testing. |
This comment has been minimized.
This comment has been minimized.
|
No problem it was the same for me, I actually forgot to check the thread for some days ;) |
This comment has been minimized.
This comment has been minimized.
|
MacOS system libraries will call The implementation is required to check if any of the zones own a pointer. If you look at the documentation for
Basically the default malloc implementation will go through all registered malloc zones and call What I have done in my memory manager/interposer implementation to get around the most annoying performance implications of this is:
|
This comment has been minimized.
This comment has been minimized.
|
Why not replace the default zone, rather using interposing, like jemalloc does: https://github.com/jemalloc/jemalloc/blob/dev/src/zone.c |
This comment has been minimized.
This comment has been minimized.
|
Oops, I see that there is indeed a zone-based way of injecting mimalloc |
This comment has been minimized.
This comment has been minimized.
|
@daanx just curious to see what the status of this is. I'm having similar issues myself |
The problem does not occur on linux.
https://github.com/microsoft/mimalloc/blob/master/src/alloc.c#L212
In order to reproduce you could build the tests in this branch:
https://github.com/arangodb/arangodb/tree/feature/mimalloc