Hi Rhys,

I am referring to the C stack size (the amount of memory allocated for both the 
stack and variables of a running C program.   In this case MATLAB as a 
subprocess is being limited in how big it's stack can be because its parent 
(Emacs) has setup limits for that subprocess.

This can be a useful thing to do if you don't always trust a subprocess, since 
it will prevent the subprocess from accidentally (or perhaps purposefully) 
locking up your computer by using up all available memory.

Eric

From: Rhys Thomas [mailto:e.rhys.tho...@gmail.com]
Sent: Sunday, December 18, 2016 4:20 AM
To: matlab-emacs-discuss@lists.sourceforge.net
Subject: Re: [Matlab-emacs-discuss] matlab-shell segfaults with matlab R2016b 
on Mac OS 10.11.6 Emacs 25.1


Hello,

Is max-lisp-eval-depth what you are looking for?

max-lisp-eval-depth is a variable defined in 'C source code'.
Its value is 800

  This variable may be risky if used as a file-local variable.

Documentation:
Limit on depth in 'eval', 'apply' and 'funcall' before error.

This limit serves to catch infinite recursions for you before they cause
actual stack overflow in C, which would be fatal for Emacs.
You can safely make it considerably larger than its default value,
if that proves inconveniently small.  However, if you increase it too far,
Emacs could overflow the real C stack, and crash.

Regards,

Rhys
On 14/12/16 16:46, Eric Ludlam wrote:
Hello again,

I've been watching progress in development around this Mac/Emacs/MATLAB issue.  
 They have identified that the reason MATLAB is crashing in Emacs, but not on 
the command line is because Emacs is setting the stack size.  A way to 
reproduce outside of Emacs is as follows:

ulimit -s 8515
matlab

Stacks limited to sizes of 8512 or more works fine for them.

I looked into stack size within emacs, and saw several references to increasing 
the stack size to 8519 in Emacs to work around a bug I'm not familiar with, but 
not to a way to increase the stack size of sub-processes.

Any Emacs hackers on this list familiar with updating stack size for 
sub-processes in Emacs as a way to work around this problem?
Thanks
Eric

From: Peter Mao [mailto:peter....@gmail.com]
Sent: Monday, November 14, 2016 11:18 AM
To: 
matlab-emacs-discuss@lists.sourceforge.net<mailto:matlab-emacs-discuss@lists.sourceforge.net>
Subject: Re: [Matlab-emacs-discuss] matlab-shell segfaults with matlab R2016b 
on Mac OS 10.11.6 Emacs 25.1

Further evidence (I hope this helps someone solve the problem):
1. 2016b works in NONE of the emacs terminals: shell, term or e-shell.
2. 2016b works fine (even with -nodesktop) from Xquartz's xterm or OSX's 
terminal
3. 2016a works fine in emacs
4. Running diff on the java directories (where the potentially offending files 
reside) shows NO difference between 2016a and 2016b!
    $ diff -ur /Applications/MATLAB_R2016b.app/sys/java 
/Applications/MATLAB_R2016a.app/sys/java
This might not be a Java issue.

On Thu, Nov 10, 2016 at 7:37 PM, Peter Mao 
<peter....@gmail.com<mailto:peter....@gmail.com>> wrote:
Yes, I'm seeing this problem, too.  Mathworks won't touch it, as it does seem 
to be a real third party issue with Emacs.
I'm having the problem with OSX 10.12 and Emacs 25.1.1, although it was also 
present with my previous emacs (24.5?).
I checked the environment variables, and the only thing I see significantly 
different is that emacs shell reports as TERM=dumb, while the Xquartz one is 
TERM=xterm and apple's terminal is TERM=xterm-256color.
In all cases, the actual shell is /bin/bash.  I'm guessing this has something 
to do with how emacs is setting up the shell, but I can't figure out what the 
issue is, exactly.  May be time to cross post to emacs developers.
Peter





------------------------------------------------------------------------------

Check out the vibrant tech community on one of the world's most

engaging tech sites, SlashDot.org! http://sdm.link/slashdot




_______________________________________________

Matlab-emacs-discuss mailing list

Matlab-emacs-discuss@lists.sourceforge.net<mailto:Matlab-emacs-discuss@lists.sourceforge.net>

https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to