We are about to switch to a new forum software. Until then we have removed the registration on this forum.
this is not a question, but a little research before eventually reporting a bug.
So I usually spend a lot of time using processing,and I rarley have troubles(xcept when basic programs refuse to work).
But a now 4 times regular programs not interacting with the SO or even the underlying java caused windows to crash die( 8-X ),in some cases even corrupting the hard disk forcing me to reinstall everything;Because of the destruction of some of the programs and an archaic fear of triggering the crash again doublececking the crash cause I never reported the accidents.
ON MY WIN 7 DESKTOP:
the first time the crash appened while trying Android mode, but sadly I dont remember any of the code or the purpose of that or the other programs;
The last crash appened right now with this code,on my desktop but this time nothing was damaged I was able to find the code:
float fps = 2;
Boolean saveFrames = !false; // set to false if you don't want the frames saved to file
String fileName = "IMG_"; // a text string that will start the file names of each saved image
String fileType = ".jpg"; // you can choose "tif", "tga", "jpg", "png" Files.
String filePath0 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam0";
String filePath1 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam1";
String filePath2 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam2";
String Time;
Capture cam0;
Capture cam1;
Capture cam2;
public void setup() {
size(640, 480);
frameRate(fps);
String[] cameras = Capture.list();
for (int i = 0; i < cameras.length; i++) {
print("camera " + i + ": ");
println(cameras[i]);
}
// The camera can be initialized directly using an
// element from the array returned by list():
try {
cam0 = new Capture(this, cameras[1]);
cam0.start();
cam1 = new Capture(this, cameras[80]);
cam1.start();
// cam2 = new Capture(this, cameras[21]);
// cam2.start();
}
catch (Exception e) {
println("Error attaching camera(s): " + e.getMessage());
exit();
}
}
public void draw() {
cam0.read();
set(0, 0, cam0);
setTimestamp();
if (saveFrames) {
saveFrame( filePath0 + fileName + "_cam0_" + Time + "_F##" + fileType );
}
cam1.read();
set(321, 0, cam1);
setTimestamp();
if (saveFrames) {
saveFrame( filePath0 + fileName + "_cam1_" + Time + "_F##" + fileType );
}
//cam2.read();
//set(0, 241, cam2);
//if(saveFrames) { saveFrame( filePath2 + fileName + "_cam2_" + Time + "_F##" + fileType ); }
}
// read actually date & time, create Variable
public void setTimestamp() {
String Year, Month, Day, Hour, Minute, Second;
Year = nf( year(), 4 );
Month = nf( month(), 2 );
Day = nf( day(), 2 );
Hour = nf( hour(), 2 );
Minute = nf( minute(), 2 );
Second = nf( second(), 2 );
Time = Year + Month + Day + "_T" + Hour + Minute + Second;
}
the bug might have been caused by this as it was the last edit before crashing. from
String filePath0 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam0";
String filePath1 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam0";
String filePath2 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam0";
to
String filePath0 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam0";
String filePath1 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam1";
String filePath2 = "C:/Users/nik/Documents/Processing/webcamFeeds/output/cam2";
Can Some code expert tell me if processing code is the cause of the crash or if it was caused by my computer or something else? I can't onestly try on other computers as I have only one and I can't run to my office and break computers there?
Have any of you had similar problem? Bye
Answers
Hi There! I've been programming java for quite some time (1998 or so) and have been doing Windows Desktop Support professionally for a very long time as well (I got my MCDST in 2002 ish). I reference my background because, as you can imagine, I've seen (or caused) many many Blue Screens and experience would lead me down a different path. I don't think java _or _ your code is the problem here. Java and by extension Processing, run on a virtual machine. It's really a whole lot like VMware or Parallels. Sun/Oracle/OpenJava did a whole lot of work to isolate or eliminate anything that could damage the Host Operating System of the computer. You have to start digging around in the JNI libraries to do any real damage.
Now In Windows 7 you really have three things that would cause a BSOD. (There are a bunch of uncommon ones due to hardware failure but we can start here.) First is a Bad Memory Module. Second is a failing Hard Drive. The Third, but common is a bad, old, corrupt or incorrect driver for a particular device. One of the things about Drivers is that they are not normal computer programs. Kernel Mode Drivers in Windows are Ring 0 - Kernel Extensions. What this means is that there is absolutely no security, consistency checking, or data verification between the Driver and the Windows Kernel (the core of the OS). And this is even the case for 'small' drivers like the ones that run on top of other drivers like USB. Anything goes wrong with them and there is a potential to cause one of these blue screens. The proper term is Kernel Exception, this means that the operating system was interrupted by a piece of hardware requesting that something be processed, but it was given data that it couldn't understand causing a memory error that it couldn't recover from (if your disk was performing a Write procedure at the time, it can blast your File System or even the Master Boot record on the drive, not to mention corrupting lots of data). - This is all simplified ofcorse but that's the basic BSOD rundown.
How does this help you out? Your code looks fine. you aren't doing anything unusual, and the code hasn't requested elevated access or priority (not even sure if it can withing the JVM). So i think that it's a driver that your interacting with in your code. Start with the driver for the webcam and it's intermediaries like Apple's Quicktime. Uninstall, reboot, download the newest from the Manufacturer's website (EG: Logitech or BisonCam vs Dell or HP), download and install the newest version of Quicktime (most java/processing libraries rely on the Quicktime interface. Or at least used to.) and check through your Device Manager to see if there are any other devices which have the Yellow Exclamation Point warning next to there icons. You want to re-install those just in case. Hope that helps!
Let's hope that the new processing v3 solves those problems...
Processing 3 can't do anything to fix bad drivers...
dunno if it was bad drivers... It used to crash with programs using no hardware.
Perhaps you ought to read what neon said, the problem is NOT with Processing or Java so expecting Processing 3 to fix you Windows BSOD problem is ridiculous.
I read it but couldn't it be processing asking for the wrong driver or something? Because as I wrote i had to reinstall the SO and drivers of course and yet sometimes there are crashs when compiling... Android mode cayused BSOD just as I installed it but then it worked fine
Don't see how Processing can ask for the wrong driver since it would ask Windows for it. Even so you have a driver that is incomoatible with your device and/ or Windows
Even if sometimes the bsod happened while compiling? Anyway If the problem is not about Processing... well I will see if there arw more problems the next time