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

Fix ASSERTIONS test in FIASCO-BASIC-SELF-TESTS #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

appleby
Copy link

@appleby appleby commented Jan 1, 2022

Don't modify the suite's CHILDREN-OF hash-table while (potentially)
traversing it. Adding elements to the hash-table while traversing it
is undefined behavior according to the spec (3.6 Traversal Rules and
Side Effects). On recent versions of SBCL on my macbook, this was
signaling the following error due to hash-table corruption if a single
new DEFTEST form was added in test/basic.lisp.

UNEXPECTED-ERROR when running FIASCO-SUITES::FIASCO-BASIC-SELF-TESTS
There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION FIASCO::AUTO-CALL? (1)>
when called with arguments
  (0).
See also:
  The ANSI Standard, Section 7.6.6

The call to AUTO-CALL? that was failing occurs in one of the LOOP
clauses in the DEFTEST form in the macro-expansion of DEFSUITE in
src/suite.lisp while iterating over the HASH-VALUES of the CHILDREN-OF
of the current suite.

Saving and restoring the CHILDREN-OF the current suite in the body of
the ASSERTIONS test fixes the issue.

Don't modify the suite's CHILDREN-OF hash-table while (potentially)
traversing it. Adding elements to the hash-table while traversing it
is undefined behavior according to the spec (3.6 Traversal Rules and
Side Effects). On recent versions of SBCL on my macbook, this was
signaling the following error due to hash-table corruption if a single
new DEFTEST form was added in test/basic.lisp.

    UNEXPECTED-ERROR when running FIASCO-SUITES::FIASCO-BASIC-SELF-TESTS
    There is no applicable method for the generic function
      #<STANDARD-GENERIC-FUNCTION FIASCO::AUTO-CALL? (1)>
    when called with arguments
      (0).
    See also:
      The ANSI Standard, Section 7.6.6

The call to AUTO-CALL? that was failing occurs in one of the LOOP
clauses in the DEFTEST form in the macro-expansion of DEFSUITE in
src/suite.lisp while iterating over the HASH-VALUES of the CHILDREN-OF
of the current suite.

Saving and restoring the CHILDREN-OF the current suite in the body of
the ASSERTIONS test fixes the issue.
))
(with-expected-failures
(ignore-errors
(finishes (error "expected failure")))) ; fails
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why my emacs has changed to a 1-space indent on these ignore-errors forms... indent-tabs-mode doesn't seem to change it

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

Successfully merging this pull request may close these issues.

1 participant