tidev / node-ios-device

Queries connected iOS devices and installs apps
Other
122 stars 37 forks source link

not exiting and CPU to 100% #22

Closed farfromrefug closed 5 years ago

farfromrefug commented 8 years ago

With the latest versions, when requesting devices, node does stop and CPU gets to 100% This does not happen all the time but really often.

If i run the debugger i get an exception on CFRunLoopStop

This does not happen if i roll back to 0.10.0

cb1kenobi commented 8 years ago

Can you please test with the new version 0.11.1?

farfromrefug commented 8 years ago

@cb1kenobi it was with 0.11.1. I am always working with your master builds.

cb1kenobi commented 8 years ago

@farfromrefug Hmm. Can you try building from the CLI and this time, prefix the command with:

DEBUG=node-ios-device <cmd>

I'd be curious what the log output says.

Also, maybe we just play with node-ios-device by itself:

git clone https://github.com/appcelerator/node-ios-device.git
cd node-ios-device
npm install
DEBUG=node-ios-device node test/test-devices.js
DEBUG=node-ios-device node test/test-log.js

To test the installing of the app, you can run:

DEBUG=node-ios-device node test/test-installApp.js /path/to/a/built/.app

There's also a test-trackDevices.js but Titanium doesn't use it, yet.

The devices test is pretty simple and quick. The log test is a bit more involved and has been problematic in the past. The install app test is also simple, though it also dumps log output, so it might be a good idea to comment out the log() call in the installApp test.

farfromrefug commented 8 years ago

I am already "debugging" node-ios-device directly using lldb and the test script test/test-devices.js. I don't even need to use it with an app to get the issue, just run the test script, even without a device connected and it hans. I will try and run it with debug logs. But i can already tell you i get an exception on stop as i said before. THough vscode does not give me the exact exception, and it does not crash but hangs.

cb1kenobi commented 8 years ago

What version of Node.js are you using? Perhaps there's a problem with the node::AtExit() not firing correct and thus node-ios-device doesn't clean up the runloop thread?

cb1kenobi commented 8 years ago

@farfromrefug What version of Node.js are you using?

farfromrefug commented 8 years ago

I encountered the issue with node 5 and 6. Now i am debugging the module with node 6.4. But if it was node::atExit() why would it create an exception in CFRunLoopStop ?

cb1kenobi commented 8 years ago

@farfromrefug I'm on Node 4.5.0. I'll update to 6.4.0 and see if I can reproduce.

The reason I suggest node::atExit() is because that's what calls stopRunLoop() which calls CFRunLoopStop() and maybe the exit behavior changed? Maybe there's a race condition? Maybe something changed in libuv and events aren't purged before exiting?

farfromrefug commented 8 years ago

@cb1kenobi i am also thinking about race condition. Especially because it does not happen every time. (BTW sorry i can't do more, like give you more info before the first week of september as i am on holidays ;))

cb1kenobi commented 8 years ago

I've updated to Node.js v6.5.0, but still haven't run into any issues. I'll keep testing as I go about my work in hopes of reproducing the issue. Enjoy the holiday!

cb1kenobi commented 5 years ago

Since there hasn't been other reports of this issue in the past 2+ years, I'm closing this issue.