Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nw.js v0.14.0-rc3 only starting as hidden processes after running once #4674

Open
colludium opened this issue Apr 3, 2016 · 20 comments
Open
Milestone

Comments

@colludium
Copy link

If an image asset is changed and then nw.js is started again, nw.js does not appear to run; although it opens in a number of background processes, the app window does not display. The fix is to delete the nwjs and app folders in User/AppData. This was produced using the win32 version of the nightly.

@rogerwang
Copy link
Member

What exactly was changed?

@colludium
Copy link
Author

I did some more testing and it appears that sometimes the nw.exe continues to run as a background process when X is used to close the nw window. It is possible that the saved data might not be the cause of this bug report. I'm doing some more testing and will post my results here.

@colludium
Copy link
Author

OK, I've been able to reduce my game so that I can provide you with a copy of the package.nw that repeatedly reproduces the bug on my machine. After the first run, the app closes down correctly, but it does not restart unless the User/Local/AppData/App folder has ben deleted from the previous run (it does start nw.exe background processes though).

The runtime script is minified so I hope it doesn't prevent you from identifying the problem. Please use this link https://dl.dropboxusercontent.com/u/184657779/nwjs%20bug/nw_bug_PackageNW.zip to download the package.nw (2 Mb). If you wish to check the whole app, in case it's a download error etc, then you can download the complete export using this link https://dl.dropboxusercontent.com/u/184657779/nwjs%20bug/nw_Bug_Whole.zip (47 Mb - construct 2 export). I'll leave these links up for a couple of days and then remove them. I hope this helps!!

@colludium colludium changed the title nw.js v0.14.0-rc3 not starting after a change of image assets nw.js v0.14.0-rc3 only starting as hidden processes after running once Apr 3, 2016
@rogerwang rogerwang added this to the 0.14.0 milestone Apr 8, 2016
@rogerwang
Copy link
Member

I didn't reproduce the issue you described. But it crashed with the debug version. I'll fix it and see if it makes difference for you.

@rogerwang
Copy link
Member

This should be caused by a bug in nw.App.clearCache() where it hangs the app.

@colludium
Copy link
Author

Cool. I'm ready to test at any time to confirm the fix. Cheers.

@rogerwang
Copy link
Member

@colludium
Copy link
Author

Unfortunately that appears to have not fixed the problem... I have created a more robust package.nw file that hopefully will let you reproduce the bug this time.https://dl.dropboxusercontent.com/u/184657779/nwjs%20bug/packageNW_v2.zip.

I did some more testing and found that if I run win32 export then the bug consistently occurs as described above - the game runs first time, thereafter it only opens into a background nw.exe process (and the only way to get it to run again is to delete the user/appdata/game folder). However, if I run the win64 version the bug never occurs and then if I then run the win32 export the bug never occurs and the win32 can repeatedly run correctly (ie something in the win64 cache process is negating the bug in the win32 export).

@rogerwang
Copy link
Member

Is this bug in 0.13 nightly build? http://dl.nwjs.io/live-build/04-10-2016/723bab6-897a464-c2a3dcf-65b297d

@rogerwang
Copy link
Member

And with win32 version, the first time you run it well and after quitting the game, does all 'nw.exe' process end successfully? Is there any process left in the system? It might be stalling the 2nd run by a lock file in the user data dir

@colludium
Copy link
Author

Using the nightly build 0.13 from your link above, the bug does not exist - I can open and close correctly multiple times.

And with win32 version, the first time you run it well and after quitting the game, does all 'nw.exe' process end successfully?

Yes. All processes appear to close correctly with no background nw.exe processes after the first run of the game. On 2nd+ runs I see a brief glimpse of a nw.exe window but that disappears and then multiple nw.exe processes run (usually 2 or 3 with one of them using up 30% cpu). Closing them and trying to run the nw.exe again results in the same unless the appdata folder is cleared.

@rogerwang
Copy link
Member

What's your OS version? Can you send me a copy of the buggy user data dir after the first run?

@colludium
Copy link
Author

Sure thing. Here's the user data file after a first run - https://dl.dropboxusercontent.com/u/184657779/nwjs%20bug/nwjsstarthiddenbug.zip.

I noted a bug file inside the win32 folder - this only happened occasionally during my tests (I just noticed it and, after removing the file, it didn't happen again); it contained:

[0410/160458:ERROR:image_metadata_extractor.cc(114)] Couldn't load libexif. 126

My system details:

Windows 10 Pro
version 1511
OS Build 10586.164
Intel i5-3320M
64 bit

@rogerwang
Copy link
Member

It starts well here with the data on a win10.

Could you follow the steps here and send me the log ? https://www.chromium.org/for-testers/enable-logging

@colludium
Copy link
Author

I might not be doing this correctly, but I think this is right.... I added --enable logging --v=1 to the package.json file. I ran the nw.exe twice from a clean appdata folder; it ran and closed correctly the first time and did not fully start the second time (background processes only). After each time I saved the error logs here: https://dl.dropboxusercontent.com/u/184657779/nwjs%20bug/nwjs%20debugs.zip.

@rogerwang
Copy link
Member

Thanks. Could you please run it again with argument: '--trace-startup --trace-startup-file=C:\trace.json --trace-startup-duration=7' and send the trace.json file? Note that it'd be better to add this to the command line argument when you launch the exe from console.

@colludium
Copy link
Author

I'm a bit of an amateur at this.... How do I run from command line - is there a set of steps I can follow or can I get away with putting that command in the package.json? Thanks.

@rogerwang
Copy link
Member

  1. unzip the package.nw you sent me to a directory 'foo'.
  2. download a copy of nw and extract it
  3. open a console by running cmd.exe
  4. in the console, run your app with '\path\to\nw.exe \path\to\foo' and make sure the bug reproduces
  5. run your app with '\path\to\nw.exe --trace-startup --trace-startup-file=C:\trace.json --trace-startup-duration=7 \path\to\foo'

@colludium
Copy link
Author

I can run the app using cmd prompt but the step 5 does not cause a .json file to be saved anywhere on the C: drive. So I started nw.exe and debugged it with visual studio (this was also new to me) and obtained the following from Debug - I hope this is of use, if not, please let me know what to try next (or an alternative way to run internal debug logging).

https://dl.dropboxusercontent.com/u/184657779/nwjs%20bug/nw_debug_vs_output.txt

@rogerwang rogerwang modified the milestones: 0.14.0, 0.14.x Apr 14, 2016
@Christywl
Copy link
Contributor

I try to reproduce this issue, but the sample links are '404'. Could you please upload a sample again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants