Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CALL-ARGUMENT-LIMIT is too high #644

Open
easye opened this issue Dec 3, 2023 · 0 comments
Open

CALL-ARGUMENT-LIMIT is too high #644

easye opened this issue Dec 3, 2023 · 0 comments

Comments

@easye
Copy link
Collaborator

easye commented Dec 3, 2023

Background

Bug EVAL of EQUALP across long lists blows up stack

In triaging why the CALL-ARGUMENTS-LIMIT.4 test fails when invoked under SLIME but works from an unadorned top-level call.

I managed to reduce the failure to the following form which doesn't require one to be using SLIME to trigger it:

  (let ((long-list
          (make-list (expt 2 16) :initial-element 'a)))
    (eval (equalp
           (apply #'list long-list)
           long-list)))

The value (expt 2 16) is derived from the implementation's value for call-arguments-limit.

Interpreted or compiled? Repeatably?

The above form seems to fail in both interpreted and compiled versions, but only on the first invocation. Then repeated invocations seem to succeed. This makes little sense, so I wonder if I am not testing what I think I am. Could this somehow be the underlying JVM replacing JITd code running the implementation when it fails?

CALL-ARGUMENTS-LIMIT used to be 50

We set it high in #440 based on arguments from @alanruttenberg which apparently didn't consider this corner case (Verify!).

We can "fix" this bug be setting it something under (expt 2 16): by quick experimentation (expt 2 15) works fine on my machine. As such, the actual call-argument-limit is gonna depend heavily where it is running. We should probably set it to something conservative.

Investigation

What do other implementations do?

TODO

Not the stepper

This bug has been present since at least abcl-1.8.0.

This bug is a regression from abcl-1.9.1 in which the ABCL-STEPPER contrib enables interactive stepping through forms by instrumenting the CL:EVAL with machinery that should only impact performance when stepping is active. Apparently this is not the case, so we need to go back through the code to remove side-effects @alejandrozf.

Instrumentation for ABCL-STEPPER added as 558a45b

From reviewing the stepper instrumentation, it could definitely be made more efficient when the stepper is not active by following the original codepath when Lisp.stepper is not true.

@easye easye changed the title EVAL of EQUALP across long lists blows up stack MAX-ARGUMENT-LIMIT is too high Dec 3, 2023
@easye easye changed the title MAX-ARGUMENT-LIMIT is too high CALL-ARGUMENT-LIMIT is too high Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant