microsoft / infersharp

Infer# is an interprocedural and scalable static code analyzer for C#. Via the capabilities of Facebook's Infer, this tool detects null dereferences, resource leaks, and thread-safety violations. It also performs taint flow tracking to detect critical security vulnerabilities like SQL injections.
MIT License
727 stars 29 forks source link

Array dimensions exceeded supported range #130

Closed MortenAanaes closed 2 years ago

MortenAanaes commented 2 years ago

When running Infer# from WSL on a large code base, I get System.OutOfMemoryException: Array dimensions exceeded supported range:

sad face - Copy

Except for running Infer# on a subset of the code base, do you have any suggestions on how to proceed?

matjin commented 2 years ago

Thank you so much for reporting the bug. We'll prepare new binaries with the fix ASAP and will update this thread when they are released.

MortenAanaes commented 2 years ago

I build infersharp with your change, but now it's sort of worse:

<redacted>:/mnt/c/bin/infersharp$ time ./run_infersharp.sh /mnt/c/projects/<redacted>/bin && mv /home/<redacted>/infersharp/infer-out/report.txt /mnt/c/Users/<redacted>/Desktop
Processing {/mnt/c/projects/<redacted>/bin}
Copying binaries to a staging folder...

Code translation started...
Translation stage 1/3: Loading binaries.
Translation stage 2/3: Computing type environment.
Translation stage 3/3: Computing control-flow graph.
[###-------]  37% |Array dimensions exceeded supported range.
###----]  63% |The given key 'IL_006c: endfinally' was not present in the dictionary.
The given key 'IL_005c: endfinally' was not present in the dictionary.
\The given key 'IL_0043: endfinally' was not present in the dictionary.
-The given key 'IL_004c: endfinally' was not present in the dictionary.
\The given key 'IL_001f: endfinally' was not present in the dictionary.
/The given key 'IL_0034: endfinally' was not present in the dictionary.
The given key 'IL_0024: endfinally' was not present in the dictionary.
The given key 'IL_0023: endfinally' was not present in the dictionary.
The given key 'IL_0025: endfinally' was not present in the dictionary.
-The given key 'IL_0061: endfinally' was not present in the dictionary.
4% |The given key 'IL_0080: endfinally' was not present in the dictionary.
The given key 'IL_0084: endfinally' was not present in the dictionary.
The given key 'IL_00ab: endfinally' was not present in the dictionary.
The given key 'IL_00b1: endfinally' was not present in the dictionary.
The given key 'IL_008e: endfinally' was not present in the dictionary.
The given key 'IL_0094: endfinally' was not present in the dictionary.
The given key 'IL_0051: endfinally' was not present in the dictionary.
The given key 'IL_0055: endfinally' was not present in the dictionary.
|The given key 'IL_0089: endfinally' was not present in the dictionary.
-The given key 'IL_004d: endfinally' was not present in the dictionary.
The given key 'IL_006d: endfinally' was not present in the dictionary.
/The given key 'IL_0057: endfinally' was not present in the dictionary.
5% /The given key 'IL_0040: endfinally' was not present in the dictionary.
The given key 'IL_0087: endfinally' was not present in the dictionary.
-The given key 'IL_0024: endfinally' was not present in the dictionary.
The given key 'IL_0024: endfinally' was not present in the dictionary.
The given key 'IL_0025: endfinally' was not present in the dictionary.
6% |The given key 'IL_00fc: endfinally' was not present in the dictionary.
The given key 'IL_0057: endfinally' was not present in the dictionary.
7% \The given key 'IL_0045: endfinally' was not present in the dictionary.
/The given key 'IL_00e1: endfinally' was not present in the dictionary.
\The given key 'IL_0025: endfinally' was not present in the dictionary.
The given key 'IL_0025: endfinally' was not present in the dictionary.
8% |The given key 'IL_00a8: endfinally' was not present in the dictionary.
|The given key 'IL_0022: endfinally' was not present in the dictionary.
|The given key 'IL_0051: endfinally' was not present in the dictionary.
\The given key 'IL_0039: endfinally' was not present in the dictionary.
The given key 'IL_0032: endfinally' was not present in the dictionary.
9% -The given key 'IL_0040: endfinally' was not present in the dictionary.
The given key 'IL_007d: endfinally' was not present in the dictionary.
The given key 'IL_0037: endfinally' was not present in the dictionary.
The given key 'IL_004e: endfinally' was not present in the dictionary.
The given key 'IL_004f: endfinally' was not present in the dictionary.
\The given key 'IL_0054: endfinally' was not present in the dictionary.
The given key 'IL_004d: endfinally' was not present in the dictionary.
The given key 'IL_004f: endfinally' was not present in the dictionary.
The given key 'IL_0060: endfinally' was not present in the dictionary.
The given key 'IL_004f: endfinally' was not present in the dictionary.
The given key 'IL_0070: endfinally' was not present in the dictionary.
|The given key 'IL_00ab: endfinally' was not present in the dictionary.
The given key 'IL_0038: endfinally' was not present in the dictionary.
The given key 'IL_0038: endfinally' was not present in the dictionary.
The given key 'IL_0042: endfinally' was not present in the dictionary.
The given key 'IL_0045: endfinally' was not present in the dictionary.
The given key 'IL_0048: endfinally' was not present in the dictionary.
The given key 'IL_004b: endfinally' was not present in the dictionary.
The given key 'IL_007c: endfinally' was not present in the dictionary.
The given key 'IL_0080: endfinally' was not present in the dictionary.
The given key 'IL_0082: endfinally' was not present in the dictionary.
The given key 'IL_0088: endfinally' was not present in the dictionary.
/The given key 'IL_0075: endfinally' was not present in the dictionary.
The given key 'IL_0092: endfinally' was not present in the dictionary.
The given key 'IL_0075: endfinally' was not present in the dictionary.
The given key 'IL_0092: endfinally' was not present in the dictionary.
The given key 'IL_0048: endfinally' was not present in the dictionary.
The given key 'IL_0041: endfinally' was not present in the dictionary.
The given key 'IL_0077: endfinally' was not present in the dictionary.
The given key 'IL_0050: endfinally' was not present in the dictionary.
/The given key 'IL_0024: endfinally' was not present in the dictionary.
|The given key 'IL_009d: endfinally' was not present in the dictionary.
The given key 'IL_00a8: endfinally' was not present in the dictionary.
#---]  70% \The given key 'IL_002a: endfinally' was not present in the dictionary.

Coverage Statistics:

Method successfully translated: 90977 (89%)
Method partially translated: 10933 (11%)
Instructions translated: 1694058 (73%)
Instructions skipped: 632882 (27%)
======================================

Code translation completed. Analyzing...

./run_infersharp.sh: line 61: /mnt/c/bin/infersharp/infer/lib/infer/infer/bin/infer: No such file or directory

real    83m0.945s
user    0m0.429s
sys     0m4.804s
matjin commented 2 years ago

Thank you for sharing this. I am currently investigating!

matjin commented 2 years ago

Hi! Just wanted to follow up -- this issue should have been resolved in the latest binaries that we've uploaded.

Another potential issue -- it looks like you're trying to run the run_infersharp.sh script from within WSL which might potentially pose an issue -- that script is intended to be invoked from Bash within Windows.

MortenAanaes commented 2 years ago

Yes! Thank you. I can confirm that I can now run Infer#, using the VS Code plug-in, on my code base 👍