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

Memory issue running Psalm Github Action #11087

Open
jrgdiaz opened this issue Sep 2, 2024 · 5 comments
Open

Memory issue running Psalm Github Action #11087

jrgdiaz opened this issue Sep 2, 2024 · 5 comments

Comments

@jrgdiaz
Copy link

jrgdiaz commented Sep 2, 2024

Hello !

I have a psalm set up in github actions that gave me the following memory error, hoping someone can provide information as to why it may be happening?

The codebase i'm targeting is 62M, it has given me this error twice in the same 18% mark. but the weird thing to me is that i have targeted a 238M codebase and it takes a while but it's able to execute that successfully

Run ./src/vendor/bin/psalm --taint-analysis --report=results.sarif --dump-taint-graph=taints.dot
Warning: "findUnusedBaselineEntry" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedBaselineEntry" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Target PHP version: [8](https://github.com/jrgdiaz/my-psalm-action/actions/runs/10661088953/job/29546071130#step:9:9).1 (inferred from current PHP version).
Scanning files...
Analyzing files...

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  60 / 316 (18%)
░░░░░░░░░░░░░░░░░░░░░░░PHP Fatal error:  Allowed memory size of 858[9](https://github.com/jrgdiaz/my-psalm-action/actions/runs/10661088953/job/29546071130#step:9:10)934592 bytes exhausted (tried to allocate 8388616 bytes) in /home/runnjrgdiaz/my-psalm-action/src/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Methods.php on line 1161
Fatal error: Allowed memory size of 8589934592 bytes exhausted (tried to allocate 8388616 bytes) in /home/runnjrgdiaz/my-psalm-action/src/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Methods.php on line [11](https://github.com/jrgdiaz/my-psalm-action/actions/runs/10661088953/job/29546071130#step:9:12)61
Error: Process completed with exit code 255.
Copy link

Hey @jrgdiaz, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.

@ging-dev
Copy link
Contributor

ging-dev commented Sep 2, 2024

may be php -d memory_limit=-1 ./src/vendor/bin/psalm will help

@jrgdiaz
Copy link
Author

jrgdiaz commented Sep 2, 2024

-d memory_limit=-1

Hi !

I tried, but got the same error.

Run php -d memory_limit=-1 ./src/vendor/bin/psalm --taint-analysis --report=results.sarif --dump-taint-graph=taints.dot
Warning: "findUnusedBaselineEntry" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedBaselineEntry" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will default to "true" in Psalm 6. You should explicitly enable or disable this setting.
Target PHP version: [8](https://github.com/jrgdiaz/my-psalm-action/actions/runs/10670902017/job/29575781361#step:9:9).1 (inferred from current PHP version).
Scanning files...
Analyzing files...
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  60 / 316 (18%)
░░░░░░░░░░░░░░░░░░░░░░░PHP Fatal error:  Allowed memory size of 858[9](https://github.com/jrgdiaz/my-psalm-action/actions/runs/10670902017/job/29575781361#step:9:10)934592 bytes exhausted (tried to allocate 8388616 bytes) in /home/runner/work/my-psalm-action/my-psalm-action/src/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Methods.php on line 1161
Fatal error: Allowed memory size of 8589934592 bytes exhausted (tried to allocate 8388616 bytes) in /home/runner/work/my-psalm-action/my-psalm-action/src/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Methods.php on line [11](https://github.com/jrgdiaz/my-psalm-action/actions/runs/10670902017/job/29575781361#step:9:12)61
Error: Process completed with exit code 255.

@orklah
Copy link
Collaborator

orklah commented Sep 2, 2024

Does that codebase runs correctly without taint analysis?

@jrgdiaz
Copy link
Author

jrgdiaz commented Sep 2, 2024

Nope, same error even with --taint-analysis removed

I also tried different versions of target codebase.

Could it be something in the code i'm scanning interfering with psalm?

This is the code i'm targeting:

https://wordpress.org/plugins/events-manager/advanced/

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

3 participants