bug-mes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stack frame in execl_ is larger than allocated area on 64-bit


From: W. J. van der Laan
Subject: Stack frame in execl_ is larger than allocated area on 64-bit
Date: Thu, 06 May 2021 18:54:51 +0000

Hello,

I just noticed, by accident, that on 64-bit platforms the following array:

    char *c_argv[1000];

as defined in execl_ in src/posix.c is 8000 bytes, this is more than the 4260 bytes of stack frame allocated for every function in function-locals.

I think the fix is to change the 4 multiplier in x86_64:function-locals and riscv64:function-locals to 8?:
----------------------------------------------------------
(define (x86_64:function-locals . rest)
  `(
    ("sub____$i32,%rsp" (#:immediate ,(+ (* 4 1025) (* 20 8))))
    )) ; 4*1024 buf, 20 local vars
----------------------------------------------------------

As well as maybe detecting and throwing an error when this happens.

-W




reply via email to

[Prev in Thread] Current Thread [Next in Thread]