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

Bug: memory allocation of 9223372036854775807 bytes failed #7378

Closed
2 tasks
pcaversaccio opened this issue Mar 12, 2024 · 17 comments
Closed
2 tasks

Bug: memory allocation of 9223372036854775807 bytes failed #7378

pcaversaccio opened this issue Mar 12, 2024 · 17 comments
Labels
T-bug Type: bug

Comments

@pcaversaccio
Copy link
Contributor

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (7545c7a 2024-03-12T00:16:54.294788023Z)

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

See CI run here:

memory allocation of 9223372036854775807 bytes failed
Aborted (core dumped)
 ELIFECYCLE  Test failed. See above for more details.
Error: Process completed with exit code 1.

I haven't changed the tests for 3 months, except for that PR pcaversaccio/createx#90 which raises now with that error.

@pcaversaccio pcaversaccio added the T-bug Type: bug label Mar 12, 2024
@mattsse
Copy link
Member

mattsse commented Mar 12, 2024

hmm, I'm unable to reproduce this locally.

couldn't locate where this overflow before allocating might have happened.

could you perhaps rerun with RUST_LOG=trace

@pcaversaccio
Copy link
Contributor Author

hmm, I'm unable to reproduce this locally.

couldn't locate where this overflow before allocating might have happened.

could you perhaps rerun with RUST_LOG=trace

I can't reproduce this error locally neither. I only face it in the CI, unfortunately. 3 hrs ago I pushed a commit that passed the tests (cf. pcaversaccio/createx@5811b5a). So there happened something in between...

@pcaversaccio
Copy link
Contributor Author

Let me try locally using RUST_LOG=trace and with the same CI run params for the fuzz and invariant tests. Maybe I can reproduce like that...

@onbjerg
Copy link
Member

onbjerg commented Mar 12, 2024

Can you try rerunning the CI? I'm wondering if this is maybe a fuzz or invariant test allocating a crazy big type?

@pcaversaccio
Copy link
Contributor Author

Can you try rerunning the CI? I'm wondering if this is maybe a fuzz or invariant test allocating a crazy big type?

Rerunning here:

@onbjerg
Copy link
Member

onbjerg commented Mar 12, 2024

Looks to have completed successfully (no core dump), albeit with failing tests. Am I reading correctly?

@pcaversaccio
Copy link
Contributor Author

Looks to have completed successfully (no core dump), albeit with failing tests. Am I reading correctly?

It looks like this indeed but maybe it just didn't get there due to an early revert due to the failing test (which has never failed until now; maybe time for an additional assume lol). But let me rerun it, because it might be simply bad luck (again)...

@mattsse
Copy link
Member

mattsse commented Mar 12, 2024

the error looks like a classic allocate capacity with underflow error, but I was unable to identify where

@pcaversaccio
Copy link
Contributor Author

the error looks like a classic allocate capacity with underflow error, but I was unable to identify where

Still running locally to see if I can reproduce. This so weird really. Merged my PR in the meantime and you know what, it fucking passed: https://github.com/pcaversaccio/createx/actions/runs/8252329302/job/22571561906. I HATE SOFTWARE :)

@onbjerg
Copy link
Member

onbjerg commented Mar 12, 2024

What would you identify as the largest fuzz/invariant tests in the code base? Might be worth trying to narrow down if it's one of the generators

We should probably log the fuzz seed so this is more easily reproducible

@pcaversaccio
Copy link
Contributor Author

What would you identify as the largest fuzz/invariant tests in the code base? Might be worth trying to narrow down if it's one of the generators

We should probably log the fuzz seed so this is more easily reproducible

https://github.com/pcaversaccio/createx/blob/main/foundry.toml#L21

10_000 for fuzz and 5_000 for invariant tests

@pcaversaccio
Copy link
Contributor Author

What would you identify as the largest fuzz/invariant tests in the code base? Might be worth trying to narrow down if it's one of the generators
We should probably log the fuzz seed so this is more easily reproducible

https://github.com/pcaversaccio/createx/blob/main/foundry.toml#L21

10_000 for fuzz and 5_000 for invariant tests

I tried reproduce the bug locally using these params but no luck. Maybe it's just a crazy weird edge case tbh, idk. If you think it's too hard to figure out the issue with the limited data we have, I can close it and reopen again later if I face it again? Thoughts?

@mattsse
Copy link
Member

mattsse commented Mar 12, 2024

sg!
thanks

@grandizzy
Copy link
Collaborator

grandizzy commented Mar 12, 2024

We should probably log the fuzz seed so this is more easily reproducible

No need since we have #7336 :) just make sure you save the failure file somewhere in CI and download locally to replay (if that's a fuzzed test failing)

@onbjerg
Copy link
Member

onbjerg commented Mar 12, 2024

@grandizzy does this work even if forge ooms?

@grandizzy
Copy link
Collaborator

@grandizzy does this work even if forge ooms?

obviously it doesn't :D nm

@pcaversaccio
Copy link
Contributor Author

Just faced another overflow bug here: #7394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

4 participants