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

Processing 2.0 fails to launch sketches (due to modified hosts file) #1868

Closed
mattg73 opened this Issue Jun 9, 2013 · 27 comments

Comments

Projects
None yet
9 participants
@mattg73

mattg73 commented Jun 9, 2013

First posted as Issue #1817 under beta 9. I still can't get processing 2.0 full release to launch sketches. This problem never occurred under 2.0b8 and earlier (and still doesn't) it only effects beta 9 and the 2.0 release so I suspect it is something to do with Processing rather than Anti-virus software or my Firewall settings as Ben suggested in his original comments.

To fix this I've tried:

Downloading and installing a fresh version of Processing 2.0
Downloading and installing up to date java and removing old versions
Downloading up to date NVidia graphics drivers
Definitely preventing the firewall from blocking Processing access
Deleting all anti-virus and malware software from my computer
Switching off anti-aliasing
Trying all levels of memory allocation within Processing
Killing just about every running process I can within Task Manager that might be blocking the sketch from running

None of this makes any difference: when I press the run button or select run or present from the sketch menu nothing happens other than the run button highlighting yellow and a java process starting in Task Manager (and that can only be killed in Task Manager - pressing the stop sketch button does not terminate the process).

I can get sketches to work if I export an application. Launching this displays the sketch window as I'd expect but it's a bit tedious to have to do every time!

I'm at a bit of a loss as to what to try next. I appreciate there are a myriad ways my unique PC configuration may cause some obscure problem but as it stands I'm basically faced with three options:

  1. Stick with 2.0b8
  2. Export an application every time I want to test my sketch
  3. Buy a new PC

Having donated $50 to the Processing Foundation (which I think you guys totally deserve BTW) to download the software, I was hoping I'd be able to use it. Any update on this bug would be appreciated. Thanks

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Jun 10, 2013

Member

Does this happen when using the OpenGL renderers (P2D/P3D), or with the default renderer too?

Member

codeanticode commented Jun 10, 2013

Does this happen when using the OpenGL renderers (P2D/P3D), or with the default renderer too?

@mattg73

This comment has been minimized.

Show comment
Hide comment
@mattg73

mattg73 Jun 11, 2013

Thanks for the response. Occurs with all three renderers. For what it's worth, none of the example movies play so it's not a coding issue either.

mattg73 commented Jun 11, 2013

Thanks for the response. Occurs with all three renderers. For what it's worth, none of the example movies play so it's not a coding issue either.

@aengelke

This comment has been minimized.

Show comment
Hide comment
@aengelke

aengelke Jun 11, 2013

Contributor

Processing communicates on the ports 8000 - 8999. Are these ports used on your computer?

Contributor

aengelke commented Jun 11, 2013

Processing communicates on the ports 8000 - 8999. Are these ports used on your computer?

@mattg73

This comment has been minimized.

Show comment
Hide comment
@mattg73

mattg73 Jun 11, 2013

Had a look using CurrPorts:

http://www.nirsoft.net/utils/cports.html

And, right enough, java.exe shows up on Local Port 8958 but the nearest active ports either side of it are system processes on 7438 and 9666 so no obvious conflict there. There are two javaw.exe processes at ports 62002 and 62005 but I presume these relate to the Processing IDE rather than the (invisible) sketch window.

Out of curiosity I loaded up 2.0b8, which does run sketches, and it similarly has a javaw.exe process at 62231 but has NO java.exe process at all, even though it is displaying the running sketch window just fine. There is a java.exe process listed in the Task Manager Processes window though.

Helpful in narrowing things down?

mattg73 commented Jun 11, 2013

Had a look using CurrPorts:

http://www.nirsoft.net/utils/cports.html

And, right enough, java.exe shows up on Local Port 8958 but the nearest active ports either side of it are system processes on 7438 and 9666 so no obvious conflict there. There are two javaw.exe processes at ports 62002 and 62005 but I presume these relate to the Processing IDE rather than the (invisible) sketch window.

Out of curiosity I loaded up 2.0b8, which does run sketches, and it similarly has a javaw.exe process at 62231 but has NO java.exe process at all, even though it is displaying the running sketch window just fine. There is a java.exe process listed in the Task Manager Processes window though.

Helpful in narrowing things down?

@ThomasLengeling

This comment has been minimized.

Show comment
Hide comment
@ThomasLengeling

ThomasLengeling Jun 12, 2013

I have the same problem, I cant run the new Processing 2.0 on Windows 8 64bits.
When I lunch processing I get the intro logo then it fades and nothing happens afterwards. It strange because the processing 2.0b9 64 bits beta works perfect on my machine.
I have windows 8 64bits, an NVidia graphics card, all the firewalls are disable.

ThomasLengeling commented Jun 12, 2013

I have the same problem, I cant run the new Processing 2.0 on Windows 8 64bits.
When I lunch processing I get the intro logo then it fades and nothing happens afterwards. It strange because the processing 2.0b9 64 bits beta works perfect on my machine.
I have windows 8 64bits, an NVidia graphics card, all the firewalls are disable.

@aengelke

This comment has been minimized.

Show comment
Hide comment
@aengelke

aengelke Jun 12, 2013

Contributor

@ThomasLengeling I think thats another issue.

Contributor

aengelke commented Jun 12, 2013

@ThomasLengeling I think thats another issue.

@aengelke

This comment has been minimized.

Show comment
Hide comment
@aengelke

aengelke Jun 12, 2013

Contributor

@mattg73 At how many KB memory does the java.exe process halts? (look in the task manager)

Contributor

aengelke commented Jun 12, 2013

@mattg73 At how many KB memory does the java.exe process halts? (look in the task manager)

@mattg73

This comment has been minimized.

Show comment
Hide comment
@mattg73

mattg73 Jun 12, 2013

Tried 3 different sketches of varying complexity from practically empty, through an example sketch, to my biggest project with multiple class files. Got 4,456K, 4,456K and 4,440K respectively (as listed under the Memory (Private working set) column)

mattg73 commented Jun 12, 2013

Tried 3 different sketches of varying complexity from practically empty, through an example sketch, to my biggest project with multiple class files. Got 4,456K, 4,456K and 4,440K respectively (as listed under the Memory (Private working set) column)

@aengelke

This comment has been minimized.

Show comment
Hide comment
@aengelke

aengelke Jun 20, 2013

Contributor

Could you provide an example sketch?

Contributor

aengelke commented Jun 20, 2013

Could you provide an example sketch?

@mattg73

This comment has been minimized.

Show comment
Hide comment
@mattg73

mattg73 Jun 21, 2013

I'm afraid something as simple as

println("Hello World");

fails. For what its worth you can get this as Hello.pde here:

http://sdrv.ms/Z5Ljdh

mattg73 commented Jun 21, 2013

I'm afraid something as simple as

println("Hello World");

fails. For what its worth you can get this as Hello.pde here:

http://sdrv.ms/Z5Ljdh

@KonradGmurek

This comment has been minimized.

Show comment
Hide comment
@KonradGmurek

KonradGmurek Jun 24, 2013

I've got exactly the same problem - tested on my sketches as well as on examples provided with Processing. Also tried some of the steps mattg73 mentioned (updating to latest version - 2.0.1 in both 32/64-bit versions, reinstalling Java, turning off firewall) and none of it helped. Similarly I see couple of java.exe processes hanging even after I quit Processing. And also processing 2.0b8 works fine for me.

My system is Windows Vista 64-bit

KonradGmurek commented Jun 24, 2013

I've got exactly the same problem - tested on my sketches as well as on examples provided with Processing. Also tried some of the steps mattg73 mentioned (updating to latest version - 2.0.1 in both 32/64-bit versions, reinstalling Java, turning off firewall) and none of it helped. Similarly I see couple of java.exe processes hanging even after I quit Processing. And also processing 2.0b8 works fine for me.

My system is Windows Vista 64-bit

@tbolting

This comment has been minimized.

Show comment
Hide comment
@tbolting

tbolting Jul 30, 2013

I have the same thing! Processing 2.0.1 works like a charm on my Mac but does not work on my Vista 32b system :(
Looks weird, and the 2.0.b8 works welll too.

tbolting commented Jul 30, 2013

I have the same thing! Processing 2.0.1 works like a charm on my Mac but does not work on my Vista 32b system :(
Looks weird, and the 2.0.b8 works welll too.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Aug 7, 2013

Member

Try renaming your sketchbook folder so that it creates a new one. You may have a Tool or Mode or Library installed that's breaking things.

Member

benfry commented Aug 7, 2013

Try renaming your sketchbook folder so that it creates a new one. You may have a Tool or Mode or Library installed that's breaking things.

@mattg73

This comment has been minimized.

Show comment
Hide comment
@mattg73

mattg73 Aug 10, 2013

Thanks for the suggestion. Tried renaming my Processing sketch folder and Processing 2.01 correctly created a new one (I enjoyed the warning message). Unfortunately no luck then launching sketches.

mattg73 commented Aug 10, 2013

Thanks for the suggestion. Tried renaming my Processing sketch folder and Processing 2.01 correctly created a new one (I enjoyed the warning message). Unfortunately no luck then launching sketches.

@quarks

This comment has been minimized.

Show comment
Hide comment
@quarks

quarks Aug 16, 2013

I been experiencing a similar problem for 2 days now.

Processing launches (slowly - at least slower than before) but when I attempt to run a sketch (Java mode using the JAVA2D renderer) the display window takes several minutes to appear even though the java.exe process appears in Task Manager immediately.

I have tried

updating graphics drivers
re-installing latest Java
re-installing Processing (versions 2.0(64), 2.0.1(32 & 64) and 2.0.2(64))
using a new Processing folder (so no contributed libraries and tools)
enabled Processing's copy of java.exe access through my firewall

The worst of it is that after running a sketch and closing it and Processing down my computer is extremely unresponsive regarding using other applications e.g. Firefox. I have to reboot ny computer for it to become usable.

My OS is Windows 7 64 bit

quarks commented Aug 16, 2013

I been experiencing a similar problem for 2 days now.

Processing launches (slowly - at least slower than before) but when I attempt to run a sketch (Java mode using the JAVA2D renderer) the display window takes several minutes to appear even though the java.exe process appears in Task Manager immediately.

I have tried

updating graphics drivers
re-installing latest Java
re-installing Processing (versions 2.0(64), 2.0.1(32 & 64) and 2.0.2(64))
using a new Processing folder (so no contributed libraries and tools)
enabled Processing's copy of java.exe access through my firewall

The worst of it is that after running a sketch and closing it and Processing down my computer is extremely unresponsive regarding using other applications e.g. Firefox. I have to reboot ny computer for it to become usable.

My OS is Windows 7 64 bit

@mattg73

This comment has been minimized.

Show comment
Hide comment
@mattg73

mattg73 Aug 19, 2013

@quarks This may not be relevant but I noticed that the java.exe process continues to run even after I close processing. If I attempt to launch multiple sketches I accumulate multiple java.exe processes. I then have to force these processes to end within Windows Task Manager. If you're experiencing the same issue this might account for the slow down you experience. Emphasis on 'might'!

mattg73 commented Aug 19, 2013

@quarks This may not be relevant but I noticed that the java.exe process continues to run even after I close processing. If I attempt to launch multiple sketches I accumulate multiple java.exe processes. I then have to force these processes to end within Windows Task Manager. If you're experiencing the same issue this might account for the slow down you experience. Emphasis on 'might'!

@quarks

This comment has been minimized.

Show comment
Hide comment
@quarks

quarks Aug 19, 2013

@mattg73
Each running sketch will create its own java.exe but mine appear to end when I stop the sketch.

quarks commented Aug 19, 2013

@mattg73
Each running sketch will create its own java.exe but mine appear to end when I stop the sketch.

@weedySeaDragon

This comment has been minimized.

Show comment
Hide comment
@weedySeaDragon

weedySeaDragon Sep 5, 2013

Same issue here: cannot run any sketches at all (Win7 x64). I also see java.exe processes still existing (in Task manager) even after I kill Processing.

Interestingly, I'm working with ruby-processing [https://github.com/jashkenas/ruby-processing](using jRuby) and I can get sketches to run that way! [ruby-processing is essentially a ruby-wrapper that calls Processing via the Processing java API; the Processing .class files are included in a .jar file that ruby-processing can use]. I believe ruby-processing is using Processing 2.0.2

My JAVA_HOME is set to the same version of java under both scenarios.

Is everyone with this problem running x64 architecture (some flavor of Windows on a 64-bit machine)?

Could it have to do with x64 vs. x32 libraries / compilation with Processing? IOW, is it possible that Processing is not using the x64 libraries where it should be? (or is using some confused mix?)
I'm just throwing out ideas; I'm not sure that would cause this problem.

weedySeaDragon commented Sep 5, 2013

Same issue here: cannot run any sketches at all (Win7 x64). I also see java.exe processes still existing (in Task manager) even after I kill Processing.

Interestingly, I'm working with ruby-processing [https://github.com/jashkenas/ruby-processing](using jRuby) and I can get sketches to run that way! [ruby-processing is essentially a ruby-wrapper that calls Processing via the Processing java API; the Processing .class files are included in a .jar file that ruby-processing can use]. I believe ruby-processing is using Processing 2.0.2

My JAVA_HOME is set to the same version of java under both scenarios.

Is everyone with this problem running x64 architecture (some flavor of Windows on a 64-bit machine)?

Could it have to do with x64 vs. x32 libraries / compilation with Processing? IOW, is it possible that Processing is not using the x64 libraries where it should be? (or is using some confused mix?)
I'm just throwing out ideas; I'm not sure that would cause this problem.

@weedySeaDragon

This comment has been minimized.

Show comment
Hide comment
@weedySeaDragon

weedySeaDragon Sep 5, 2013

I did a little more investigating. I use Resource Monitor (from Microsoft) to track CPU, etc. It shows what processes are using network resources (TCP, ports, etc), and it also can show you the wait chain of a process (what a process is waiting on). When I run ruby-processing (the ruby wrapper around the Processing Java API):

  • no network I/O happens at all. no ports are opened
  • the javaw.exe and java.exe processes terminate as they should (they don't hang around after I've closed all windows/exited from the apps

But when I run Processing itself:

  • network ports are opened
  • the java.exe process doesn't terminate normally because it is waiting on Network I/O (according to what the Resource Monitor reports)

So that seems to be a key part: Processing is trying to do some network i/o and that network i/o is blocking things somehow and (at the least) keeping java.exe from terminating normally.

HTH.

weedySeaDragon commented Sep 5, 2013

I did a little more investigating. I use Resource Monitor (from Microsoft) to track CPU, etc. It shows what processes are using network resources (TCP, ports, etc), and it also can show you the wait chain of a process (what a process is waiting on). When I run ruby-processing (the ruby wrapper around the Processing Java API):

  • no network I/O happens at all. no ports are opened
  • the javaw.exe and java.exe processes terminate as they should (they don't hang around after I've closed all windows/exited from the apps

But when I run Processing itself:

  • network ports are opened
  • the java.exe process doesn't terminate normally because it is waiting on Network I/O (according to what the Resource Monitor reports)

So that seems to be a key part: Processing is trying to do some network i/o and that network i/o is blocking things somehow and (at the least) keeping java.exe from terminating normally.

HTH.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Sep 5, 2013

Member

The “network communication” is a socket opened on your machine so that the PDE can talk to the sketch that was just launched (and send error messages, etc to it). If you have a firewall enabled, or told Windows that java.exe or javaw.exe was not allowed to access the network, that can cause this issue.

Member

benfry commented Sep 5, 2013

The “network communication” is a socket opened on your machine so that the PDE can talk to the sketch that was just launched (and send error messages, etc to it). If you have a firewall enabled, or told Windows that java.exe or javaw.exe was not allowed to access the network, that can cause this issue.

@weedySeaDragon

This comment has been minimized.

Show comment
Hide comment
@weedySeaDragon

weedySeaDragon Sep 5, 2013

I solved the issue for my system: I had an entry for my machine in the \Windows\System32\drivers\etc\hosts file that was causing the problem.

Thanks, @benfry -- knowing that the opened sockets were there on purpose (and what the purpose is) was helpful. That narrowed my focus to think about what could be specific to Windows OS and localhost. Windows defines/deals with localhost a bit differently (= poorly) than other OSs. Often you need to have some specific entries in the hosts file to make everything work OK. IOW, you need to make sure that localhost and 127.0.0.1 and ::1 will all resolve correctly to your machine. Some applications (processes) use "127.0.0.1", some use "localhost", some use "::1" -- they all need to be pointing to your machine correctly. (That's true for all OSs, but this particular thing is more problematic with Windows.)
The specific way that Processing creates a socket address uncovered the problem in my hosts file. The entry in my hosts file wasn't causing a problem for any other program.

I suggest that "Make sure your \Windows\System32\drivers\etc\hosts defines localhost clearly and correctly" to the troubleshooting page. [http://wiki.processing.org/w/Troubleshooting]. I tried to explain things clearly above so that folks that aren't so technical can grok it. Here's a page that I think explains things simply: [http://www.dummies.com/how-to/content/network-administration-the-hosts-file.html] in case that's helpful for the troubleshooting page.

weedySeaDragon commented Sep 5, 2013

I solved the issue for my system: I had an entry for my machine in the \Windows\System32\drivers\etc\hosts file that was causing the problem.

Thanks, @benfry -- knowing that the opened sockets were there on purpose (and what the purpose is) was helpful. That narrowed my focus to think about what could be specific to Windows OS and localhost. Windows defines/deals with localhost a bit differently (= poorly) than other OSs. Often you need to have some specific entries in the hosts file to make everything work OK. IOW, you need to make sure that localhost and 127.0.0.1 and ::1 will all resolve correctly to your machine. Some applications (processes) use "127.0.0.1", some use "localhost", some use "::1" -- they all need to be pointing to your machine correctly. (That's true for all OSs, but this particular thing is more problematic with Windows.)
The specific way that Processing creates a socket address uncovered the problem in my hosts file. The entry in my hosts file wasn't causing a problem for any other program.

I suggest that "Make sure your \Windows\System32\drivers\etc\hosts defines localhost clearly and correctly" to the troubleshooting page. [http://wiki.processing.org/w/Troubleshooting]. I tried to explain things clearly above so that folks that aren't so technical can grok it. Here's a page that I think explains things simply: [http://www.dummies.com/how-to/content/network-administration-the-hosts-file.html] in case that's helpful for the troubleshooting page.

@quarks

This comment has been minimized.

Show comment
Hide comment
@quarks

quarks Sep 6, 2013

@aenw
I modified the hosts file to add the following lines
127.0.0.1 localhost
::1 localhost
and I have downloaded 2.0.3 and enabled java.exe access through my firewall but I am still experiencing the same problem in that Processing is slow to lauch and when I run a sketch the display window takes several minutes to appear.

quarks commented Sep 6, 2013

@aenw
I modified the hosts file to add the following lines
127.0.0.1 localhost
::1 localhost
and I have downloaded 2.0.3 and enabled java.exe access through my firewall but I am still experiencing the same problem in that Processing is slow to lauch and when I run a sketch the display window takes several minutes to appear.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Sep 6, 2013

Member

@quarks not running at all vs running slowly is a very different sort of issue. It's possible they're related, but let's stick to the issue description. If sketches are starting up slowly, please open a separate issue.

@aenw we have a lot of per-platform code on how localhost is set due to the issues you describe. Prior to this, had you made changes to your hosts file? I don't know why we'd be getting different results on different installations of the same version of Windows (outside of the obvious ::1 vs 127.0.0.1 change for ip6 vs ip4).

Member

benfry commented Sep 6, 2013

@quarks not running at all vs running slowly is a very different sort of issue. It's possible they're related, but let's stick to the issue description. If sketches are starting up slowly, please open a separate issue.

@aenw we have a lot of per-platform code on how localhost is set due to the issues you describe. Prior to this, had you made changes to your hosts file? I don't know why we'd be getting different results on different installations of the same version of Windows (outside of the obvious ::1 vs 127.0.0.1 change for ip6 vs ip4).

@weedySeaDragon

This comment has been minimized.

Show comment
Hide comment
@weedySeaDragon

weedySeaDragon Sep 8, 2013

@benfry Yes -- I'd made changes to my hosts file a year or two ago and still had an old IP address lurking in there for localhost. I could see when I ran Processing that it opened up a socket to the correct IP address for my machine, but it also opened up a socket to an IP address of a different machine on my net. It turns out that the other IP address was the old address for my machine. I had been using an older version of Processing (ca. 2011) and probably my hosts file was ok at that time. No other app has complained, so I'd forgotten about the changes.
So there's no problem with Processing. The issue was me, and that I didn't understand that Processing used sockets (and thus the hosts file) to communicate with sketches. Hence I think just adding info in the documentation is all that's needed here.

weedySeaDragon commented Sep 8, 2013

@benfry Yes -- I'd made changes to my hosts file a year or two ago and still had an old IP address lurking in there for localhost. I could see when I ran Processing that it opened up a socket to the correct IP address for my machine, but it also opened up a socket to an IP address of a different machine on my net. It turns out that the other IP address was the old address for my machine. I had been using an older version of Processing (ca. 2011) and probably my hosts file was ok at that time. No other app has complained, so I'd forgotten about the changes.
So there's no problem with Processing. The issue was me, and that I didn't understand that Processing used sockets (and thus the hosts file) to communicate with sketches. Hence I think just adding info in the documentation is all that's needed here.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Sep 26, 2013

Member

Yeah, this isn't a Processing bug... It'd be great if you could add something to the troubleshooting page on the Wiki.

Member

benfry commented Sep 26, 2013

Yeah, this isn't a Processing bug... It'd be great if you could add something to the troubleshooting page on the Wiki.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Nov 9, 2016

Member

For the next release (3.2.4 or 3.3), this will be detected and an error shown to the user: #4738

Member

benfry commented Nov 9, 2016

For the next release (3.2.4 or 3.3), this will be detected and an error shown to the user: #4738

@benfry benfry removed the invalid label Nov 9, 2016

@processing processing deleted a comment from jgreen99 Jul 19, 2018

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jul 19, 2018

Member

(Removing off-topic post and locking this long-since-closed issue.)

Member

benfry commented Jul 19, 2018

(Removing off-topic post and locking this long-since-closed issue.)

@processing processing locked as off topic and limited conversation to collaborators Jul 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.