nodekit-io / nodekit-darwin

{NK} NodeKit is the universal, open-source, embedded engine that provides a full ES5 / Node.js instance inside desktop and mobile applications for macOS, iOS, Android, and Windows. [Swift 2.3 Darwin]
http://nodekit.io
Apache License 2.0
22 stars 4 forks source link

Mac OSX app crashes #1

Open lamuertepeluda opened 8 years ago

lamuertepeluda commented 8 years ago

The app compiles but then breaks at NKC_SwiftSocket.swift line 728 EXC_BAD_ACCESS (code=1...)

Early 2008 MBP x86, OSX El Capitàn

Log:

+creating JavaScriptCore Renderer
+NodeKit WebView-JavaScriptCore JavaScript Engine E1
+URL: internal://localhost/splash/views/StartupSplash.html
+NodeKit JavaScriptCore JavaScript Engine E2
+E2 Injected io.nodekit.electro/lib-electro/_nke_main.js 
+E2 Injected io.nodekit.scripting/NKScripting/nkscripting.js 
+E2 Injected io.nodekit.scripting/NKScripting/promise.js 
+E2 JavaScript Engine is ready for loading plugins
+E2 Injected io.nodekit.electro.app/plugin/nodekit_sample.NKE_App.js 
+E2 Injected io.nodekit.electro.BrowserWindow/plugin/nodekit_sample.NKE_BrowserWindow.js 
+E2 Injected io.nodekit.electro.WebContentsUI/plugin/nodekit_sample.NKE_WebContentsUI.js 
+E2 Injected io.nodekit.electro.WebContentsWK/plugin/nodekit_sample.NKE_WebContentsWK.js 
+E2 Injected io.nodekit.electro.dialog/plugin/nodekit_sample.NKE_Dialog.js 
+E2 Injected io.nodekit.electro.ipcMain/plugin/nodekit_sample.NKE_IpcMain.js 
+E2 Injected io.nodekit.electro._menu/plugin/nodekit_sample.NKE_Menu.js 
+E2 Injected io.nodekit.electro.protocol/plugin/nodekit_sample.NKE_Protocol.js 
+URL: internal://localhost/splash/images/logo.png
+URL: internal://localhost/splash/images/logo.svg
+E2 Injected io.nodekit.platform.process/plugin/nodekit_sample.NKC_Process.js 
+E2 Injected io.nodekit.platform.fs/plugin/nodekit_sample.NKC_FileSystem.js 
+E2 Injected io.nodekit.platform.console/plugin/nodekit_sample.NKC_Console.js 
+E2 Injected io.nodekit.platform.crypto/plugin/nodekit_sample.NKC_Crypto.js 
+E2 Injected io.nodekit.platform.TCP/plugin/nodekit_sample.NKC_SocketTCP.js 
+E2 Injected io.nodekit.platform.UDP/plugin/nodekit_sample.NKC_SocketUDP.js 
+E2 Injected io.nodekit.platform.Timer/plugin/nodekit_sample.NKC_Timer.js 
+E2 Injected io.nodekit.core/lib/_nodekit_bootstrapper.js 
+E2 Injected io.nodekit.test/plugin/nodekit_sample.SamplePlugin.js 
Starting PACKAGE.JSON
STARTING TEST APPLICATION
+creating Nitro Renderer
+NodeKit Nitro JavaScript Engine E3
+E3 Renderer Loaded
+E3 Injected io.nodekit.electro/lib-electro/_nke_renderer.js 
+E3 Injected io.nodekit.scripting/NKScripting/nkscripting.js 
+E3 Injected io.nodekit.scripting/NKScripting/promise.js 
+E3 JavaScript Engine is ready for loading plugins
+E3 Injected io.nodekit.electro.ipcRenderer/plugin/nodekit_sample.NKE_IpcRenderer.js 
+E3 Renderer Ready
a log message
TTY:an info message

a warning message
TTY:an error message

TTY:Sun Feb 28 2016 17:04:47 GMT+0100 (CET)

%s: %dms
INVALID LOG
/var/folders/2z/t7rll4dj5rb0z3hssmqlzdt00000gn/T/pork-recipes.txt
INVALID LOG
INVALID LOG
BufferStream write 101
BufferStream write 101
END CALLED
101101
BufferStream end undefined
TTY:util.debug: Use console.error instead

TTY:DEBUG: a debug message

TTY:util.error: Use console.error instead

TTY:message to stderr

TTY:and

TTY:[object Object]

TTY:util.puts: Use console.log instead

TTY:message to stdout

TTY:and

TTY:[object Object]

TTY:util.print: Use console.log instead

TTY:message to stdout
TTY:and
TTY:[object Object]
%s - %s
TypeError: undefined is not an object (evaluating 'io.nodekit.platform.TCP[9].emit')
TypeError: this._emitCloseIfDrained is not a function. (In 'this._emitCloseIfDrained()', 'this._emitCloseIfDrained' is undefined)
TypeError: undefined is not an object (evaluating 'io.nodekit.platform.TCP[21].emit')
PORT: 62345
TypeError: undefined is not an object (evaluating 'io.nodekit.platform.TCP[24].emit')
CONNECTED
SERVER CONNECTED
(lldb) 

I don't know if this helps figuring out...

guybarnard commented 8 years ago

Thanks for raising. Most of those errors in the logs are actually part of the Node platform tests (and caught and verified as exceptions), but there did seem to be an issue with Swift sockets on the latest build; interesting it was not occurring on IOS but was on OSX.

Also note that these tests do require and open a TCP socket, so if you are not allowing that (must give explicit permission to the popup OSX window) then suggest replacing the sample folder with your own app that does not use TCP. I added an increased catch which should alleviate the problem for now, but please note the tests are still a work in process and so if you are just looking to play around with NodeKit then you may be better off replacing until the tests stabilize.

I will add a build passing badge to the README page once we reach that point of stability. The windows version does now test for clean compiles on each build, something I havent added to darwin just yet.