github icon indicating copy to clipboard operation
github copied to clipboard

Attempting to call a function in a renderer window that has been closed or released. Function provided here: Object.<anonymous>

Open Arcanemagus opened this issue 7 years ago • 16 comments

Description

When Atom is closed an error is printed to the CLI it was launched from about an attempt to call to a renderer window that has been closed.

Steps to Reproduce

  1. Open Atom
  2. Close Atom

Expected behavior:

No errors printed to the terminal.

Actual behavior:

The following error stack is printed to the terminal:

Attempting to call a function in a renderer window that has been closed or released. Function provided here: Object.<anonymous> (C:\Temp\atom\out\Atom x64\resources\app\node_modules\github\lib\worker.js:65:20.
Error: Attempting to call a function in a renderer window that has been closed or released. Function provided here: Object.<anonymous> (C:\Temp\atom\out\Atom x64\resources\app\node_modules\github\lib\worker.js:65:20.
    at WebContents.callIntoRenderer (C:\Temp\atom\out\Atom x64\resources\electron.asar\browser\rpc-server.js:190:19)
    at emitOne (events.js:101:20)
    at WebContents.emit (events.js:188:7)

Reproduces how often:

100% of the time, whether in safe mode or not.

Versions

Windows 10 x64

Build from https://github.com/atom/atom/pull/14372/commits/4cbff3044604988e2c2553af0d78e71c13c25696.

Atom : 1.18.0-dev-4cbff3044 x64 Electron: 1.3.15 Chrome : 52.0.2743.82 Node : 6.5.0

[email protected] (bundled in the build)

Additional Information

Whether the github panel is opened or not doesn't seem to matter. The project that was open had 2 changed files.

Arcanemagus avatar May 09 '17 21:05 Arcanemagus

This is only when you quit Atom, not when only closing a single window, correct?

BinaryMuse avatar May 09 '17 21:05 BinaryMuse

Correct.

Arcanemagus avatar May 09 '17 21:05 Arcanemagus

Okay. This is a race down in Electron's RPC code. I'll provide some more context tomorrow but I'm not sure of an easy fix yet.

BinaryMuse avatar May 09 '17 21:05 BinaryMuse

@Arcanemagus Just confirming — you said that this was fixed for you, right?

BinaryMuse avatar May 10 '17 21:05 BinaryMuse

I wasn't seeing it on a build based on https://github.com/atom/atom/pull/14372/commits/30ee14bd1317c5d15568d4cfae08bb4eb46a0a23, although you pointed out seeing a similar message in the build from that commit here.

Arcanemagus avatar May 10 '17 22:05 Arcanemagus

Hmmm, this is actually back on a build of https://github.com/atom/atom/pull/14372/commits/fb9fd2fbfcf2f6fa07f43efcde20d4ee109df6a4.

Arcanemagus avatar May 10 '17 22:05 Arcanemagus

Stack trace has changed slightly:

Attempting to call a function in a renderer window that has been closed or released. Function provided here: Object.<anonymous> (C:\Temp\atom\out\Atom x64\resources\app\node_modules\github\lib\worker.js:70:22.
Error: Attempting to call a function in a renderer window that has been closed or released. Function provided here: Object.<anonymous> (C:\Temp\atom\out\Atom x64\resources\app\node_modules\github\lib\worker.js:70:22.
    at WebContents.callIntoRenderer (C:\Temp\atom\out\Atom x64\resources\electron.asar\browser\rpc-server.js:190:19)
    at emitOne (events.js:101:20)
    at WebContents.emit (events.js:188:7)

Arcanemagus avatar May 10 '17 22:05 Arcanemagus

Here's a stack trace from a build based on merging the Electron 1.6 and Node.js 7 branches into master:

Attempting to call a function in a renderer window that has been closed or released.
Function provided here: Object.<anonymous> (C:\Temp\atom\out\Atom x64\resources\app\node_modules\github\lib\worker.js:70:22
Remote event names: destroyed, crashed

Looks like it might have a tad more information, likely due to the Electron update.

Arcanemagus avatar May 12 '17 20:05 Arcanemagus

Interestingly on the released Atom v1.18.0-beta0 I don't see a message from this, but if I build the same commit I see the stack trace from https://github.com/atom/github/issues/769#issuecomment-300633172 so there must be some sort of wrapper in the installer version that is hiding that message.

Arcanemagus avatar May 19 '17 17:05 Arcanemagus

Having the same issue.. Did you ever resolve it?

eicksl avatar Jun 26 '17 01:06 eicksl

I had the same error. My trick is to change the rights for the ~/.atom/nohub.out file.

$ sudo chown username ~/username/.atom/nohup.out

Hope it helps.

pachevalier avatar Jun 28 '17 08:06 pachevalier

In the settings, there's an option "Restore Previous Windows on Start". If you set it to "no", it will fix the problem, at least for me. Hope this would help.

zonggen avatar Oct 19 '17 19:10 zonggen

@pachevalier Hi, I'm getting same error message and I'm not able to solve it. @anonymousrice solution didn't work for me. Could you explain it in more detail please? I'm sorry to bother with a (probably) newbie question but I'm jut starting with all of this. Thank you

lamikk avatar Mar 03 '18 16:03 lamikk

Exactly same error for me with electron 3.0.10 on macOS Mojave.

electron  Attempting to call a function in a renderer window that has been closed or released.
          Function provided here: makePdf.js:150:13
          Remote event names: closed

popod avatar Dec 14 '18 14:12 popod

I had the same error. My trick is to change the rights for the ~/.atom/nohub.out file.

$ sudo chown username ~/username/.atom/nohup.out

Hope it helps.

yes that is the solution. Although you are being redundant ~/username/.atom/nohup.out best to give whole path and recursive to clean up stuff

sudo chown -R USERNAME /home/USERNAME/.atom

aleon1220 avatar Dec 19 '18 01:12 aleon1220

Linking to a bunch of places

Issues with the same name: https://github.com/atom/atom/issues/19161 https://github.com/electron/electron/issues/24772 https://github.com/atom/github/issues/954

Screenshot of failed and passed tests displaying this error

In the wild: https://github.com/atom/atom/issues/22872 https://github.com/search?p=1&q=Attempting+to+call+a+function+in+a+renderer+window+that+has+been+closed+or+released&type=Code

There's also two versions of this error, not windows...

Attempting to call a function in a renderer window that has been closed or released.
Function provided here: worker.js:60:22
Remote event names: crashed, destroyed

and windows

Attempting to call a function in a renderer window that has been closed or released.
Function provided here: Object.<anonymous> (D:\a\github\github\lib\worker.js:60:22
Remote event names: crashed, destroyed

icecream17 avatar Oct 22 '21 14:10 icecream17