Help with Ticket #68015

Joshua Root jmr at macports.org
Sat Apr 27 22:35:46 UTC 2024


On 27/4/2024 23:09, mcalhoun at macports.org wrote:
> Perhaps not.
> I am not quite sure what constitutes a genuine stack overflow.
> However, after building the offending binary using the 
> backtrace_on_stack_overflow crate, and I saw no evidence of of infinite 
> recursion 
> (https://docs.rs/backtrace-on-stack-overflow/latest/backtrace_on_stack_overflow/ <https://docs.rs/backtrace-on-stack-overflow/latest/backtrace_on_stack_overflow/>).
> Also, the `ulimit` and `sysctl ` values seem consistent across the 
> different OSs I’ve tried.
> I assume they are the same on the buildbots as well.
> 
> I will try adding`-stack_size` to the linker flags.
> However, the same binary crashes on some OSs and succeeds on others, so 
> I am not sure why the `-stack_size` would be acceptable on some OSs but 
> not others.

I don't know how rust does things, but typically there would be one or 
more guard pages just beyond the end of the memory area reserved for the 
stack. Normal allocations on the stack exceeding the maximum stack size 
due to excessive depth of function calls or an excessively large object 
being allocated will touch a guard page and cause an exception, 
resulting in a stack overflow being reported. That's what I mean by a 
genuine stack overflow.

But code could touch a guard page for any number of other reasons, and 
that may also be reported as a stack overflow.

- Josh


More information about the macports-dev mailing list