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

Panic - Messed up size accounting #1552

Closed
weaversa opened this issue Jul 21, 2023 · 3 comments
Closed

Panic - Messed up size accounting #1552

weaversa opened this issue Jul 21, 2023 · 3 comments
Assignees
Labels
bug Something not working correctly

Comments

@weaversa
Copy link
Collaborator

I ran across this panic today. I'm sorry I don't have a ready example.

Revision: UNKNOWN
Branch: UNKNOWN
Location: lookupSeqMap
Message: Messed up size accounting
        Nat 2
         2
CallStack (from HasCallStack):
  panic, called at src/Cryptol/Utils/Panic.hs:21:9 in cryptol-3.0.0.99-inplace:Cryptol.Utils.Panic
  panic, called at src/Cryptol/Backend/SeqMap.hs:100:28 in cryptol-3.0.0.99-inplace:Cryptol.Backend.SeqMap
@weaversa
Copy link
Collaborator Author

The code that caused this worked w/ 2.13, but panics on 3.0

@yav
Copy link
Member

yav commented Jul 21, 2023

I suspect the issue is here:

(\j -> panic "lookupSeqMap" ["Messed up size accounting", show sz, show j])))

We should only panic if the index is in bounds. Otherwise, we should throw an exception that the index is out of bounds.

@RyanGlScott RyanGlScott added the bug Something not working correctly label Jul 24, 2023
@yav yav self-assigned this Jul 24, 2023
@yav
Copy link
Member

yav commented Jul 25, 2023

Another issue with this code is that it has a race condition if it is used with parallel evalution (e.g., parmap)

@yav yav closed this as completed in 8d83e66 Oct 26, 2023
yav added a commit that referenced this issue Oct 26, 2023
Changes that hopefully fix #1552.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something not working correctly
Projects
None yet
Development

No branches or pull requests

3 participants