atom / autosave

Autosaves buffers when they lose focus
MIT License
64 stars 34 forks source link

Uncaught Error: Can't save destroyed buffer #77

Open zerdos opened 7 years ago

zerdos commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.14.0 x64 Electron: 1.3.13 OS: Mac OS X 10.12.2 Thrown From: autosave package 0.24.0

Stack Trace

Uncaught Error: Can't save destroyed buffer

At /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:1045

Error: Can't save destroyed buffer
    at TextBuffer.module.exports.TextBuffer.saveAs (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1055:15)
    at TextBuffer.module.exports.TextBuffer.save (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1049:19)
    at TextEditor.module.exports.TextEditor.save (/app.asar/src/text-editor.js:890:26)
    at Pane.module.exports.Pane.saveItem (/app.asar/src/pane.js:753:18)
    at Pane.saveItem (/app.asar/src/pane.js:3:59)
    at Object.autosavePaneItem (/app.asar/node_modules/autosave/lib/autosave.js:71:21)
    at Object.autosaveAllPaneItems (/app.asar/node_modules/autosave/lib/autosave.js:82:27)
    at /app.asar/node_modules/autosave/lib/autosave.js:29:26

Commands

     -2:29.2.0 core:backspace (input.hidden-input)
     -1:39.6.0 editor:toggle-line-comments (input.hidden-input)
     -1:39.3.0 core:save (input.hidden-input)
     -1:10 core:move-down (input.hidden-input)
     -1:08.9.0 core:move-up (input.hidden-input)
  2x -1:05.1.0 core:undo (input.hidden-input)
     -0:58.7.0 core:save (input.hidden-input)
     -0:44.2.0 core:copy (input.hidden-input)
     -0:44 find-and-replace:show (input.hidden-input)
     -0:43.8.0 core:paste (input.hidden-input)
     -0:40.6.0 core:copy (input.hidden-input)
     -0:40.3.0 find-and-replace:show (input.hidden-input)
     -0:40.1.0 core:paste (input.hidden-input)
     -0:39.2.0 core:undo (input.hidden-input)
  2x -0:36.8.0 core:copy (input.hidden-input)
     -0:30.4.0 find-and-replace:show (input.hidden-input)

Non-Core Packages

aesthetic-ui 2.0.0 
atom-beautify 0.29.17 
atom-pair 2.0.10 
genesis-syntax 1.0.9 
genesis-ui 0.5.0 
git-blame 0.4.11 
git-plus 7.2.2 
linter 1.11.21 
linter-eslint 8.1.0 
linter-scss-lint 3.0.4 
minimap 4.26.8 
monokai-seti 0.7.0 
platformio-ide-terminal 2.2.2 
redmond-syntax 1.0.2 
seti-syntax 1.0.1 
seti-ui 1.6.0 
tab-limit 0.2.1 
terminal-plus 0.14.5 
50Wliu commented 7 years ago

Hello @zerdos, what were you doing when this occurred?

ghost commented 7 years ago

could reproduce in atom 1.16.0-beta0
closing open files (opened in previous session of project) right after editor launch does throw this issue for me

rsese commented 7 years ago

Can you share more detailed steps to reproduce @ozo2003?

ghost commented 7 years ago
  1. open project
  2. open some files
  3. leave files opened
  4. close all atom instances
  5. launch atom
  6. close files you opened in previous session
tnypxl commented 7 years ago

I have this same issue. But its in combination with Scratch package: https://github.com/destradax/scratch

tnypxl commented 7 years ago

Steps to reproduce:

  1. Install Scratch atom package
  2. Toggle scratch on, put some text in there
  3. Toggle scratch off

You should see the error

rsese commented 7 years ago

Hmmm, still not able to reproduce with your steps @ozo2003 - do you see the error in safe mode? Also, if you haven't yet updated to 1.16.0 stable, can you do that as well?

rsese commented 7 years ago

@tnypxl - thanks, I'm able to reproduce with those steps (though I additionally have to choose Save when prompted to save changes or not after your step 3).

Stack Trace

Uncaught Error: Can't save destroyed buffer

At /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:1045

Error: Can't save destroyed buffer
    at TextBuffer.module.exports.TextBuffer.saveAs (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1064:15)
    at TextBuffer.module.exports.TextBuffer.save (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1058:19)
    at TextEditor.module.exports.TextEditor.save (/app.asar/src/text-editor.js:920:26)
    at Pane.module.exports.Pane.saveItem (/app.asar/src/pane.js:753:18)
    at Pane.saveItem (/app.asar/src/pane.js:3:59)
    at Object.autosavePaneItem (/app.asar/node_modules/autosave/lib/autosave.js:71:21)
    at /app.asar/node_modules/autosave/lib/autosave.js:32:28
    at /app.asar/src/pane-element.js:152:25)
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:141:28)
    at Pane.module.exports.Pane.setActiveItem (/app.asar/src/pane.js:300:22)
    at Pane.module.exports.Pane.activateItemAtIndex (/app.asar/src/pane.js:435:19)
    at Pane.module.exports.Pane.activatePreviousItem (/app.asar/src/pane.js:400:21)
    at Pane.module.exports.Pane.removeItem (/app.asar/src/pane.js:585:16)
    at /app.asar/src/pane.js:483:26
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:141:28)
    at TextEditor.module.exports.TextEditor.destroyed (/app.asar/src/text-editor.js:579:20)
    at TextEditor.module.exports.Model.destroy (/app.asar/src/model.js:31:58)
    at Object.closeScratchEditor (/packages/scratch/lib/scratch.js:96:17)
    at Object.toggleScratch (/packages/scratch/lib/scratch.js:69:9)
    at /packages/scratch/lib/scratch.js:36:33)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/app.asar/src/window-event-handler.js:106:36)
    at /app.asar/src/window-event-handler.js:3:59)

Commands

     -2:46.3.0 settings-view:open (input.hidden-input)
     -2:37.1.0 core:confirm (input.hidden-input)
     -2:13.5.0 pane:show-item-1 (div.package-detail.panels-item)
     -2:07.6.0 command-palette:toggle (input.hidden-input)
     -2:02.5.0 editor:consolidate-selections (input.hidden-input)
     -2:02.5.0 core:cancel (input.hidden-input)
  4x -1:59 scratch:toggle (input.hidden-input)
rsese commented 7 years ago

Not sure if that would be more of a https://github.com/destradax/scratch issue but I'll triage as a bug for now.

no-response[bot] commented 5 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.