github icon indicating copy to clipboard operation
github copied to clipboard

Uncaught TypeError: Cannot read property 'split' of null

Open cebtenzzre opened this issue 6 years ago • 5 comments

Steps to reproduce:

  1. git-imerge merge <branch> where <branch> has a few conflicts and there are many (probably at least 50) commits since the branches diverged
  2. resolve some conflicts
  3. if no crash yet, goto 2

Generally it only takes a few iterations of this. My guess is that due to to extremely frequent incremental changes (the Git tab is updating many times per second), some kind of race condition is happening, either internal to Atom, or between git and Atom.

Atom: 1.34.0 x64 Electron: 3.1.4 OS: "Arch Linux" Thrown From: github package 0.23.3

Stack Trace

Uncaught TypeError: Cannot read property 'split' of null

At /usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:1319

TypeError: Cannot read property 'split' of null
    at Diff.lineDiff.tokenize (/usr/lib/atom/node_modules/text-buffer/node_modules/diff/lib/diff/line.js:22:32)
    at Diff.diff (/usr/lib/atom/node_modules/text-buffer/node_modules/diff/lib/diff/base.js:36:39)
    at Object.diffLines (/usr/lib/atom/node_modules/text-buffer/node_modules/diff/lib/diff/line.js:47:19)
    at transact (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:801:29)
    at TextBuffer.transact (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:1316:16)
    at TextBuffer.setTextViaDiff (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:796:10)
    at CommitController.componentDidUpdate (/usr/lib/atom/node_modules/github/lib/controllers/commit-controller.js:130:30)
    at commitLifeCycles (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:14256:22)
    at commitAllLifeCycles (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:15342:7)
    at HTMLUnknownElement.callCallback (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:100:14)
    at Object.invokeGuardedCallbackDev (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:138:16)
    at invokeGuardedCallback (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:187:29)
    at commitRoot (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:15481:7)
    at completeRoot (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:16496:34)
    at performWorkOnRoot (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:16440:9)
    at performWork (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:16358:7)
    at performSyncWork (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:16330:3)
    at requestWork (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:16230:5)
    at scheduleWork$1 (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:16096:11)
    at Object.enqueueSetState (/usr/lib/atom/node_modules/react-dom/cjs/react-dom.development.js:11185:5)
    at ObserveModel.Component.setState (/usr/lib/atom/node_modules/react/cjs/react.development.js:273:16)
    at ObserveModel.didUpdate (/usr/lib/atom/node_modules/github/lib/views/observe-model.js:48:12)
    at ModelObserver._refreshModelData (/usr/lib/atom/node_modules/github/lib/models/model-observer.js:57:14)

Commands

     -1:49.8.0 tabs:close-all-tabs (div.title)
     -1:45 intentions:highlight (input.hidden-input)
     -1:45 core:save (input.hidden-input)
     -1:29.1.0 intentions:highlight (input.hidden-input)
     -1:29.1.0 core:save (input.hidden-input)

Non-Core Packages

atom-overtype-mode 0.4.0 
autocomplete-clang 0.11.5 
autocomplete-cmake 0.3.1 
build 0.70.0 
build-cmake 0.12.0 
busy-signal 2.0.0 
clang-format 2.0.7 
column-select 1.0.1 
define-jump 1.0.1 
docblockr 0.13.7 
file-watcher 2.0.0 
find-selection 0.16.0 
highlight-selected 0.14.0 
intentions 1.1.5 
language-cmake 1.1.0 
language-lisp 0.2.0 
language-x86asm 0.9.0 
linter 2.3.0 
linter-clang 4.1.2 
linter-cpplint 2.1.0 
linter-ui-default 1.7.1 
minimap 4.29.9 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
scroll-sync 0.2.4 
slickedit-select 1.6.2 
split-diff 1.6.0 
Sublime-Style-Column-Selection 1.7.5 
symbols-tree-view 0.14.0 
todo-show 2.3.2 

cebtenzzre avatar Feb 24 '19 18:02 cebtenzzre

Thanks for the report!

Atom: 1.34.0 x64 Electron: 3.1.4

Based on these versions, it looks like you're using an unofficial build or distribution of Atom (the official stable 1.34.0 release ships with Electron 2.0.16). Often these customized versions of Atom are modified versions of the Stable branch of Atom with mismatched versions of built-in components. These updated components are taken from the Beta channel or master branch and then injected into the Stable version and a new Atom package is generated. Because of the way Atom is constructed, using these mismatched components can cause mysterious and hard-to-diagnose problems. You can find out more about why we chose to not support unofficial distributions here.

You can find instructions for installing an official version of Atom in the Flight Manual. If you are still seeing this problem on an official build please let us know!

rsese avatar Feb 26 '19 06:02 rsese

@rsese Sorry, I didn't know that the atom package on Arch Linux isn't supported. It does in fact apply a small set of patches, and one changes it to use the system Electron.

I've installed the atom-editor-bin package from the AUR. It uses the official .deb installer. Here's the output of atom --version:

Atom    : 1.34.0
Electron: 2.0.16
Chrome  : 61.0.3163.100
Node    : 8.9.3

I moved my old ~/.atom directory, and started Atom with atom --safe. Now, there is no crash popup, but the Git tab contents disappear. Looking at the developer console, the same crash with the same backtrace is still happening.

cebtenzzre avatar Feb 27 '19 19:02 cebtenzzre

Now, there is no crash popup, but the Git tab contents disappear. Looking at the developer console, the same crash with the same backtrace is still happening.

This was with the same repro steps yes?

rsese avatar Feb 28 '19 21:02 rsese

Well, not the same exact set of commits, but the same operation (git-imerge merge).

cebtenzzre avatar Feb 28 '19 22:02 cebtenzzre

This is happening to me too. After merge some branch, it will throw and exception and git tab is closing, and cant use git on command.

I'm using Atom Nightly 1.63.0-nightly1 x64, on MacOs.

ademiawansyah avatar Nov 10 '22 03:11 ademiawansyah