foundry: perf(`forge test`): memory leak in latest foundry

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 (5494c33 2024-05-30T00:18:10.251370000Z)

What command(s) is the bug in?

forge test (make test)

Operating System

macOS (Apple Silicon)

Describe the bug

With the following PR as an example https://github.com/superform-xyz/superform-core/pull/541

To reproduce

Part 1

  • Do foundryup (latest foundry)
  • forge install
  • Override RPCs in make file and run make ftest
  • Open Mac activity monitor and check memory usage. This results in a oom: telegram-cloud-document-4-5960961092661285381

code 137 in https://github.com/superform-xyz/superform-core/actions/runs/9289996043/job/25566018918

Please note that this is a powerful dedicated Github actions runner, so the memory limits shouldn’t actually be reached

Part 2

  • Do foundryup -v nightly-cafc2606a2187a42b236df4aa65f4e8cdfcea970
  • forge install
  • Override RPCs in make file and run make ftest
  • Open Mac activity monitor and check memory usage telegram-cloud-photo-size-4-5963231644758425826-y

A whopping difference of 36gb.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (4 by maintainers)

Most upvoted comments

@Inphi yes, please open a new issue for etch, going to use this one to optimize coverage report creation. Thank you.

Created an issue here.

Seems related to this issue based on this comment. I imagine that the Debugger inspector is also used to track coverage which would explain the memory blowup.

@Inphi yes, please open a new issue for etch, going to use this one to optimize coverage report creation. Thank you.

@grandizzy I wonder if this is fuzzing related

@0xTimepunk were you able to narrow this down to a specific test?