rpwoodbu / mosh-chrome

Mosh for Chrome
GNU General Public License v3.0
372 stars 59 forks source link

NaCl crashes on Windows in Chrome 52.0.2743.116 m (64-bit) #124

Open rpwoodbu opened 8 years ago

rpwoodbu commented 8 years ago

As reported by @neocryptek:

Just updated my Chrome to Version 52.0.2743.116 m (64-bit) on Windows and I get the same problem with Mosh v0.3.0.258. Was working great before updating Chrome.

Mosh says this (doesn't get any further):

Loading NaCl module (takes a while the first time after an update).
[...............]

And the stacktrace is:

init: hterm

Uncaught TypeError: this.moshNaCl_.postMessage is not a function
mosh.CommandInstance.onTerminalResize_  @   mosh_window.js:242
hterm.Terminal.IO.onTerminalResize_ @   hterm.js:7741
hterm.Terminal.realizeSize_ @   hterm.js:5484
hterm.Terminal.onResize_    @   hterm.js:7536
notifyList  @   hterm.js:2293

extensions::uncaught_exception_handler:8 Error in response to storage.get: TypeError: Cannot read property 'length' of undefined
    at Object.lib.encodeUTF8 (chrome-extension://ooiklbnjmhbcgemelgfhaeaocllobloj/hterm/hterm_deps.js:4388:26)
    at hterm.Terminal.IO.print.hterm.Terminal.IO.writeUTF16 (chrome-extension://ooiklbnjmhbcgemelgfhaeaocllobloj/hterm/hterm.js:7787:22)
    at null.callback (chrome-extension://ooiklbnjmhbcgemelgfhaeaocllobloj/mosh_window.js:120:30)
    at mosh.CommandInstance.run (chrome-extension://ooiklbnjmhbcgemelgfhaeaocllobloj/mosh_window.js:118:23)
    at hterm.Terminal.runCommandClass (chrome-extension://ooiklbnjmhbcgemelgfhaeaocllobloj/hterm/hterm.js:5256:16)
    at terminal.onTerminalReady (chrome-extension://ooiklbnjmhbcgemelgfhaeaocllobloj/mosh_window.js:40:14)
    at .<anonymous> (chrome-extension://ooiklbnjmhbcgemelgfhaeaocllobloj/hterm/hterm.js:4762:37)
    at .<anonymous> (chrome-extension://ooiklbnjmhbcgemelgfhaeaocllobloj/hterm/hterm.js:5135:7)handler @ extensions::uncaught_exception_handler:8(anonymous function) @ extensions::uncaught_exception_handler:100safeCallbackApply @ extensions::sendRequest:23handleResponse @ extensions::sendRequest:74
mosh_window.html:1 

NativeClient: Nexe crashed during startup
rpwoodbu commented 8 years ago

Thanks for the report, @neocryptek. I have one report of this working just fine in that precise version of Chrome on Windows 10. So my first thought is that something's weird about your machine. Can you repro this repeatably? Can you repro this on another machine? Does the "Mosh (dev)" app crash, too? What happens if you uninstall and reinstall the app? (I wonder if some bits got clobbered somehow.)

neocryptek commented 8 years ago

I'm on Windows 7. Same stack trace after uninstall and reinstall of the app.

Just installed Mosh (dev) v0.3.5 and it has the same problem (though it doesn't print out anything to the terminal window):

init: hterm

extensions::uncaught_exception_handler:8 Error in response to storage.get: TypeError: Cannot read property 'length' of undefined
    at Object.lib.encodeUTF8 (chrome-extension://hmgggebkhjjkiimkjlknpdgapncghehh/hterm_all.js:4402:26)
    at hterm.Terminal.IO.print.hterm.Terminal.IO.writeUTF16 (chrome-extension://hmgggebkhjjkiimkjlknpdgapncghehh/hterm_all.js:12636:22)
    at null.callback (chrome-extension://hmgggebkhjjkiimkjlknpdgapncghehh/mosh_window.js:114:30)
    at mosh.CommandInstance.run (chrome-extension://hmgggebkhjjkiimkjlknpdgapncghehh/mosh_window.js:112:23)
    at hterm.Terminal.runCommandClass (chrome-extension://hmgggebkhjjkiimkjlknpdgapncghehh/hterm_all.js:10105:16)
    at terminal.onTerminalReady (chrome-extension://hmgggebkhjjkiimkjlknpdgapncghehh/mosh_window.js:34:14)
    at .<anonymous> (chrome-extension://hmgggebkhjjkiimkjlknpdgapncghehh/hterm_all.js:9611:37)
    at .<anonymous> (chrome-extension://hmgggebkhjjkiimkjlknpdgapncghehh/hterm_all.js:9984:7)handler @ extensions::uncaught_exception_handler:8
mosh_window.html:1 

NativeClient: Nexe crashed during startup

I did find another windows 7 machine with the same version of Chrome (but 32bit) and I was able to launch Mosh successfully. So it seems likely something is wrong with my machine.

rpwoodbu commented 8 years ago

It'd be cool if you could find another Windows 7 machine that is 64-bit. It is disconcerting that this happens on both apps. This could possibly be a Chrome bug (wouldn't be the first NaCl-related crash bug that affected a particular platform I've dealt with). Also, I just released a new version of the dev track, so you might want to try that one one more time. You should also try some other NaCl apps, such as Secure Shell, to see if the problem manifests across the board.

Unfortunately, it seems unlikely I'll be able to do anything here. Therefore I'm closing this issue. Please continue to add details here as you discover them, though. If it becomes apparent that there's something I can do, I'll be glad to reopen.

cccCody commented 7 years ago

I get Nexe crashes too, running chrome 62.0.3202.62 on win 10 64 v1703, regular mosh-chrome and (dev)

rpwoodbu commented 7 years ago

@cccCody That's interesting that you're seeing this on Windows 10. So that theory is shot. Can you try running the "Secure Shell" app and making a connection? That app also uses NaCl/Nexe.

cccCody commented 7 years ago

sure. nexe crashes there too:

NativeClient: Nexe crashed during startup
nassh_command_instance.js:875 loading plugin failed ProgressEvent
errorHandler @ nassh_command_instance.js:875
cccCody commented 7 years ago

https://bugs.chromium.org/p/chromium/issues/detail?id=130793 ?

cccCody commented 7 years ago

Okay, I got a workaround that might offer a clue. It works if I open EMET and disable Data Execution Prevention for chrome.exe.

rpwoodbu commented 7 years ago

That's very interesting indeed. It definitely seems like a Chrome bug. I'll be curious to know if it is reproducible on another machine with the same exact versions of Chrome and Windows.

Unfortunately, this gets me back to what I said in a previous comment on this issue: It seems unlikely I'll be able to do anything here. This is compounded by the fact that support for Chrome Apps on everything but Chrome OS is deprecated and will go away entirely soon.

I have made a Windows "port" of Mosh for Chrome that you might try. It is very much a "beta". Find it here.

rpwoodbu commented 7 years ago

@cccCody That's quite interesting about DEP. You might try opening an issue in the Chromium bug tracker with that hint. But don't expect too much movement on it, considering the deprecation. (NaCl is also deprecated in favor of WebAssembly... or maybe just PNaCl, not sure.)

rpwoodbu commented 7 years ago

NB: To all who may read this issue and think they should turn off Data Execution Prevention: DO NOT DO THIS!

This is fine for debugging and testing, but this significantly reduces the security of the browser. The browser is the single biggest target for attackers. Do not browse the web with this protection disabled.

cccCody commented 7 years ago

Thanks, I didn't know about chrome apps dropping windows support. I switched to the native windows version. I have to turn off DEP for that too, but that seems better than doing it for all of chrome.

rpwoodbu commented 7 years ago

That's very interesting that you still have to do that with the "native" version. Under the hood, that is using a rather crusty old copy of Chromium.

Are you 100% sure you're not actually enabling DEP? Poking around, I found some (old) issues where NaCl wouldn't load because it required DEP. Then again, it is entirely possible that they broke it somehow.

cccCody commented 7 years ago

Here's the entry I added: mosh_nw