Looks like the default configuration is working now (no segfaults), but occasionally it freezes within Julia and doesn't return (process shows 100% CPU usage). Might be related to gc stuff as it happens infrequently and seemingly only when allocating large arrays, or it might be a bug of mine.
On Tuesday, 3 March 2015 23:18:04 UTC-6, Eric Davies wrote: > > Hi all, > > I'm attempting to embed julia in a MATLAB MEX file. Everything is going > great, but MATLAB will sometimes segfault after having run some code > calling Julia.* I believe I have narrowed it down to this issue: > http://ubuntuforums.org/showthread.php?t=2093057 . Basically, I believe > Julia is registering a SIGSEGV (or maybe other signal?) handler that > overwrites the default for the JVM set by MATLAB. after the Julia function > is done, that memory is freed. Then a segfault (or maybe other signal?) > happens in the JVM and it tries to call Julia's handler but segfaults > (again) as it is no longer there. > > Can anyone help me find a workaround? Perhaps if there's a way to > "deregister" the handler, or if someone knows a way to get the current > handler (before calling into Julia) and then setting it back to that after > Julia is done. > > I've never dealt with signals in C before so I apologize if I'm describing > things incorrectly or missing something. > > Thanks, > Eric > > *I am able to reliably reproduce this by running any MEX function linking > to Julia and calling jl_init, then calling `help clear` in MATLAB. > > P.S.: I'm on Mac OS X 10.10 with MATLAB R2012b and Julia v0.3.6/v0.4.0-dev >
