github / codeql-action

Actions for running CodeQL analysis
MIT License
1.15k stars 319 forks source link

CodeQL out of memory #245

Open BrightRan opened 4 years ago

BrightRan commented 4 years ago

Associated GitHub Community ticket: https://github.community/t/codeql-out-of-memory/135280

The customer set a workflow like as this. When the set the CodeQL action to run for the C# language, the step "Perform CodeQL Analysis" failed with the following errors (more details, see here):

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000007e2300000, 200278016, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 200278016 bytes for Failed to commit area from 0x00000007e2300000 to 0x00000007ee200000 of length 200278016.
# An error report file with more information is saved as:
# D:\a\Dnn.Platform\Dnn.Platform\hs_err_pid6332.log
Error: Error running analysis for csharp: Error: The process 'C:\hostedtoolcache\windows\CodeQL\0.0.0-20200826\x64\codeql\codeql.exe' failed with exit code 1
Error: The process 'C:\hostedtoolcache\windows\CodeQL\0.0.0-20200826\x64\codeql\codeql.exe' failed with exit code 1
Error: No SARIF files found to upload in "../results".
bdukes commented 3 years ago

Updates from the GitHub Community ticket:

    - name: configure Pagefile
      uses: al-cheb/configure-pagefile-action@v1.2
      with:
          minimum-size: 8GB
          maximum-size: 32GB
          disk-root: "D:"
jsjoeio commented 3 years ago

We're seeing a similar issue in cdr/code-server: see logs

Run github/codeql-action/upload-sarif@v1
Uploading sarif files: ["trivy-image-results.sarif"]
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

<--- Last few GCs --->

[2047:0x42960e0]   211606 ms: Mark-sweep 1968.4 (1973.9) -> 1968.4 (1970.9) MB, 1146.9 / 0.0 ms  (average mu = 0.902, current mu = 0.000) last resort GC in old space requested
[2047:0x42960e0]   212790 ms: Mark-sweep 1968.4 (1970.9) -> 1968.4 (1970.9) MB, 1183.6 / 0.0 ms  (average mu = 0.811, current mu = 0.000) last resort GC in old space requested

<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x1374fd9]
Security context: 0x1df0d8ac08a1 <JSObject>
    1: outputHash(aka outputHash) [0x23868395bba1] [/home/runner/work/_actions/github/codeql-action/v1/lib/fingerprints.js:~63] [pc=0x4e7bc427b85](this=0x2d8a3d4404a9 <undefined>)
    2: hash(aka hash) [0x4b2344f8471] [/home/runner/work/_actions/github/codeql-action/v1/lib/fingerprints.js:~41] [pc=0x4e7bc42400b](this=0x2d8a3d4404a9 <undefined>,0x23868395bbe1 <JSF...

 1: 0x9da7c0 node::Abort() [/home/runner/runners/2.278.0/externals/node12/bin/node]
 2: 0x9db976 node::OnFatalError(char const*, char const*) [/home/runner/runners/2.278.0/externals/node12/bin/node]
 3: 0xb39f1e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/runner/runners/2.278.0/externals/node12/bin/node]
 4: 0xb3a299 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/runner/runners/2.278.0/externals/node12/bin/node]
 5: 0xce5635  [/home/runner/runners/2.278.0/externals/node12/bin/node]
 6: 0xcf54fd v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/home/runner/runners/2.278.0/externals/node12/bin/node]
 7: 0xcbc118 v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::RootIndex, int, v8::internal::Object, v8::internal::AllocationType) [/home/runner/runners/2.278.0/externals/node12/bin/node]
 8: 0xcbc220 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::RootIndex, int, v8::internal::AllocationType) [/home/runner/runners/2.278.0/externals/node12/bin/node]
 9: 0xecb760 v8::internal::HashTable<v8::internal::StringTable, v8::internal::StringTableShape>::NewInternal(v8::internal::Isolate*, int, v8::internal::AllocationType) [/home/runner/runners/2.278.0/externals/node12/bin/node]
10: 0xecb7be v8::internal::HashTable<v8::internal::StringTable, v8::internal::StringTableShape>::New(v8::internal::Isolate*, int, v8::internal::AllocationType, v8::internal::MinimumCapacity) [/home/runner/runners/2.278.0/externals/node12/bin/node]
11: 0xecbe8b v8::internal::HashTable<v8::internal::StringTable, v8::internal::StringTableShape>::EnsureCapacity(v8::internal::Isolate*, v8::internal::Handle<v8::internal::StringTable>, int, v8::internal::AllocationType) [/home/runner/runners/2.278.0/externals/node12/bin/node]
12: 0xed4af1 v8::internal::Handle<v8::internal::String> v8::internal::StringTable::LookupKey<v8::internal::InternalizedStringKey>(v8::internal::Isolate*, v8::internal::InternalizedStringKey*) [/home/runner/runners/2.278.0/externals/node12/bin/node]
13: 0xed4be6 v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) [/home/runner/runners/2.278.0/externals/node12/bin/node]
14: 0x100b30b v8::internal::Runtime_GetProperty(int, unsigned long*, v8::internal::Isolate*) [/home/runner/runners/2.278.0/externals/node12/bin/node]
15: 0x1374fd9  [/home/runner/runners/2.278.0/externals/node12/bin/node]