ungit icon indicating copy to clipboard operation
ungit copied to clipboard

crash when I use patch functionality

Open gigi206 opened this issue 6 years ago • 6 comments

Hello,

I downloaded node-V9.9.0 and I install ungit with npm : npm install -g ungit

When I want to commit a patch (I click on the filename patch, then commit), the server crash.

From webpage :

Whooops
Unfortunately ungit interrupted its work because: git-crash-error
The following tips will help solve this problem depending on the error: 

General:
something went wrong, reload the page to start over
check server out or logs for errors
~/.ungitrc must contain valid JSON. Minimal valid json is "{}"
Connection Lost:
check status of server or network connection to the ungit server
Ad Blockers and Privacy Extensions:
add ungit server url to adblocker exception (with port definition) or disable for a while
Git does not have enough permissions:
check if you could write to .git directory (preferably on unix systems)
Other:
Find or report bug at ungit github.
Just common sense; do a quick search before posting, someone might already have created an issue (or resolved the problem!).
If you're posting a bug; try to include as much relevant information as possible (ungit version, node and npm version, os, any git errors displayed, output from cli console and output from the browser console).

From console nodejs :

<--- Last few GCs --->

[17847:0x37696d0]    28200 ms: Mark-sweep 599.6 (608.0) -> 599.6 (608.0) MB, 192.1 / 0.0 ms  allocation failure GC in old space requested
[17847:0x37696d0]    28400 ms: Mark-sweep 599.6 (608.0) -> 599.6 (607.0) MB, 200.1 / 0.0 ms  last resort GC in old space requested
[17847:0x37696d0]    28586 ms: Mark-sweep 599.6 (607.0) -> 599.6 (607.0) MB, 185.8 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 0xf2c1e325529 <JSObject>
    1: /* anonymous */(aka /* anonymous */) [/home/gigix/T?l?chargements/node-v9.9.0-linux-x64/lib/node_modules/ungit/src/git-parser.js:~287] [pc=0xf1ff3c621ae](this=0x2e9fd3b82201 <null>,patchLineList=0x3faf0bb77071 <JSArray[3]>,text=0x3faf0bb7d179 <String[106]\: diff --git a/1.txt b/1.txt\nindex d00491f..c1f3abd 100644\n--- a/1.txt\n+++ b/1.txt\n@@ -1 +1,2 @@\n-1\n+11\n+12\n>)
    2: tryCatcher...
stderr: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/home/gigix/Téléchargements/node-v9.9.0-linux-x64/bin/node]
 2:
stderr: 0x8cefac [/home/gigix/Téléchargements/node-v9.9.0-linux-x64/bin/node]
 3:
stderr: v8::Utils::ReportOOMFailure(char const*, bool) [/home/gigix/Téléchargements/node-v9.9.0-linux-x64/bin/node]
 4:
stderr: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/home/gigix/Téléchargements/node-v9.9.0-linux-x64/bin/node]
 5:
stderr: v8::internal::Factory::NewUninitializedFixedArray(int) [/home/gigix/Téléchargements/node-v9.9.0-linux-x64/bin/node]
 6:
stderr: 0xd89393 [/home/gigix/Téléchargements/node-v9.9.0-linux-x64/bin/node]
 7:
stderr: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [/home/gigix/Téléchargements/node-v9.9.0-linux-x64/bin/node]
 8: 0xf1ff3b042fd

Stopped keeping ungit alive

Error seems to be : JavaScript heap out of memory

I use on my laptop :

$ free -m                                    
              total        used        free      shared  buff/cache   available
Mem:          15927        4255        6877         588        4794       11322
Swap:             0           0           0

gigi206 avatar Mar 27 '18 19:03 gigi206

So it seems to be complaining about the invalid ~/.ungitrc.

This obviously needs more fix from ungit side but for now can you run echo '{}' > ~/.ungitrc and see if that fixes your problem?

jung-kim avatar Mar 27 '18 20:03 jung-kim

I tried

echo '{}' > ~/.ungitrc

or removed the file, but unfortunatly same behavior

gigi206 avatar Mar 27 '18 20:03 gigi206

It's strange, I have no problem on Windows but on Linux it crashes only when I try to patch :

  • Windows : OK
  • Fedora 27 : KO
  • SLES 12SP3 : KO
<--- Last few GCs --->

[8797:0x2cc46b0]    35321 ms: Mark-sweep 599.4 (607.5) -> 599.4 (607.5) MB, 180.5 / 0.0 ms  allocation failure GC in old space requested
[8797:0x2cc46b0]    35506 ms: Mark-sweep 599.4 (607.5) -> 599.3 (606.0) MB, 184.9 / 0.0 ms  last resort GC in old space requested
[8797:0x2cc46b0]    35686 ms: Mark-sweep 599.3 (606.0) -> 599.3 (606.0) MB, 180.2 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 0x1de29dc25529 <JSObject>
    1: /* anonymous */(aka /* anonymous */) [/home/gigix/node-v9.9.0-linux-x64/lib/node_modules/ungit/src/git-parser.js:~287] [pc=0x2e4966d44a6e](this=0x3651a7802201 <null>,patchLineList=0x26317d0df789 <JSArray[4]>,text=0x26317d0df6c9 <String[163]\: diff --git a/1.txt b/1.txt\nindex 56a6051..c55eb7a 100644\n--- a/1.txt\n+++ b/1.txt\n@@ -1 +1,3 @@\n-1\n\\ No newline at end of file\n+0\n+1\n+2\n\\...
stderr: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1:
stderr: node::Abort() [/home/gigix/node-v9.9.0-linux-x64/bin/node]
 2:
stderr: 0x8cefac [/home/gigix/node-v9.9.0-linux-x64/bin/node]
 3:
stderr: v8::Utils::ReportOOMFailure(char const*, bool) [/home/gigix/node-v9.9.0-linux-x64/bin/node]
 4:
stderr: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/home/gigix/node-v9.9.0-linux-x64/bin/node]
 5:
stderr: v8::internal::Factory::NewUninitializedFixedArray(int) [/home/gigix/node-v9.9.0-linux-x64/bin/node]
 6:
stderr: 0xd89393 [/home/gigix/node-v9.9.0-linux-x64/bin/node]
 7:
stderr: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [/home/gigix/node-v9.9.0-linux-x64/bin/node]
 8: 0x2e4966b842fd
Stopped keeping ungit alive

gigi206 avatar Mar 29 '18 18:03 gigi206

I'm trying to set up a test env and profile the memory usage but is this done in a small vm with <2g ram?

jung-kim avatar Apr 08 '18 21:04 jung-kim

It is not done on a VM but on my computer (I have a dual boot) with 16G memory.

gigi206 avatar May 18 '18 17:05 gigi206

https://stackoverflow.com/a/35650414 :

To solve this issue you need to run your application by increasing the memory limit by using the option --max_old_space_size. By default the memory limit of Node.js is 512 mb. node --max_old_space_size=2000 server.js

bes-internal avatar Dec 04 '18 00:12 bes-internal