Can't run Julia on mid-2012 MacBook Air, macOS 10.14.3: malloc: *** error for object 0x1079269e8: pointer being freed was not allocated


#1

Any attempt to run Julia (1.0, 1.1, nightly) fails with a malloc error on my mid-2012 MacBook Air:

$ julia
julia(3402,0x10a9c35c0) malloc: *** error for object 0x1079269e8: pointer being freed was not allocated
julia(3402,0x10a9c35c0) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      julia
134

#2

Do you have any antivirus software installed? Or anything in your ~/.julia/config/startup.jl file?


#3

I don’t believe so, and no I have no ~/.julia directory at all.


#4

Do you have an antivirus system enabled? There was recently a similar issue with an overactive AV.


#5

As far as I can tell I don’t have one installed. Just tried reinstalling macOS to no avail.

Edit:

Ok sudo julia works but not julia.


#6

Just wondering how to help - how did you set up the julia command to run in the Terminal? If you just download and install the Julia app directly, you have to run it by double-clicking the icon, rather than typing julia (which doesn’t work until you make it work). So perhaps you can share the command that starts Julia - perhaps that’s pointing in the wrong place, or something…


#7

Hi there, I’m the user with the overactive antivirus. Even though that may not be the issue for you, the same debugging steps that helped me isolate the issue might help you track down your issue. From https://docs.julialang.org/en/v1/devdocs/backtraces/#Errors-during-Julia-startup-1, do dtruss -f julia to get lots of logging info. It can help you see if there are external processes killing your julia process.


#8

@cormullion

I’ve tried installing it through brew cask, placing the app into /Applications or $HOME/Applications and running it, symlinking the binary (Contents/Resources/julia/bin/julia) into $HOME/bin or /usr/local/bin. All methods produce the same error.

@ianfiske

I’m unable to run dtruss -f julia. I get the error

$ dtruss -f julia
dtrace: system integrity protection is on, some features will not be available
dtrace: failed to initialize dtrace: DTrace requires additional privileges
1

I tried disabling SIP (csrutil disable in recovery) but still get the “DTrace requires additional privileges” error, and julia still crashes. sudo dtruss -f julia works, but as I’ve mentioned, Julia isn’t crashing if I run it with sudo.


#9

Ok… So I’ve run out of helpful ideas,… sorry.:slightly_frowning_face: I tried installing Julia 1.1 on a mid-2012 MacBook running Mojave as both admin and a non-admin user, and it worked without issues.


#10

Figured out the problem. Something I installed (but no longer use) had inserted a line into my .zshrc setting DYLD_LIBRARY_PATH. After removing that it’s working fine.


#11

@samgreen Any chance you can share with us which addition to your DYLD_LIBRARY_PATH caused the error? Might help other users and maybe we can put together a debugging tutorial for these types of issues at some point.