Java SE binary crash - swing

I have a Java swing application that subscribes to a lot of data and displays this data in various ways. Under heavy load I have come to encounter that the JRE simply stops working with message "Java(TM) Platform SE binary has stopped working". This obviously shuts down my application and I need to restart it. I have tried to google for ways to troubleshoot this issue as I do not get a stacktrace in my code or anything that I can work with but I have found very little useful information beyond upgrading/re-installing the JRE and running virus scans. I have done both of these measures and rebooted the server but the problem still persists. I have tried to monitor the process with Java VisualVM (see dump below) but I am no expert on this tool and may not know what to look for. The observation that I have made is that the 'crashes' appear to coincide with Garbage Collections.
The issue is quite easy to reproduce and occurs after about 10 minutes of running the application. I do not run the application with any specific jvm parameters. The Java version is 1.6.0_31 (was _25 before upgrade) and I run on Windows 7 64-bit.
In the pic below from VisualVM the Java binary has just stopped working which appears to coincide with the GC-run.
Any help or ideas so that I can troubleshoot or remedy the problem is greatly appreciated. Thanks.

Three things to check:
If you've implemented the finalize() method anywhere, make sure it doesn't directly or indirectly lock any objects; this can cause a catatrophic deadlock correlated with GC.
If you've got native code, any number of weird things can happen if the code is not using global references correctly, including deadlocks and weird memory corruption, which would again correlate with GC activity.
Finally, GC might just be "stirring the pot" and exposing vanilla deadlocks which exist otherwise in the application; check your synchronization protocols.

Garbage collection pauses the VM's application threads while it happens, which might be exposing a race condition somewhere.

Related

When using PM2 to debug Node.js, is there a CLI option to avoid a command prompt opening for every thread using the cluster module?

I'm using node.js's cluster module to fork 16 threads to fully leverage my i9 9900k with a node.js program. I need to debug memory leaks and PM2 seems to offer the best analysis capabilities of a Node.js program that I've been able to find, but when I run the program with PM2, it opens an additional command prompt for every thread forked and 16 windows popping up in my face every time I run it isnt optimal. Is there a CLI option for PM2 to avoid this?
A quick google didn't turn anything up but sometimes you gurus know a thing or two google doesn't.
Quick answer - no. You can not set the behaviour you want through PM2 options (at least I couldn't manage to find it as well).
Though, if you ask me. I think it is not a great way to look for some memory leaks by introducing more entropy in your debug setup. Make a minimal reproducible example with one Node.js script, that will have those memory leaks and use available tooling to gather snapshots, where you will find relative changes to the memory consumption which leads you to the solution.
There are a lot of articles out there, like:
Finding And Fixing Node.js Memory Leaks: A Practical Guide
Memory Leaks Demystified
Well, you got the idea. Hope it helps you find a leak.

Reverse Engineering / Log or intercept program instructions

I'm trying to find a way of replicating the action / instruction that a physical button being pushed on a control panel sends to the software of a CNC machine of ours.
Ultimately I would like to integrate this instruction into an executable file I could make using AutoIT, but that is further down the line!
After some googling, resulting in all kinds of weird and wonderful results, I'm at a loss of how to begin this task. I believe I need to either use debugging software to find the instruction as it takes place, or possibly Process Monitor?
The machine runs off of a Windows XP machine.
Unfortunately obtaining this information from the manufacturer is not an option.
If anyone could help point me in the right direction that would be appreciated,
Thanks
Edit: I have since come across Windows Hooks, Detours and Interception, but still haven't made much progress!
Your topic is too broad ... You might as well be asking "How do I reverse engineer?" First thing I would do would be to load up the program in a debugger, put a breakpoint in the callback function and find out what the button is doing. What you will most likely find is that it's pushing some information onto the stack and making a call to an external .DLL such as an API or device driver ( you could probably find out which DLL using Process Monitor too ). Just load that .DLL up into your new program and make the same call.

Google Chrome Crash Report Analysis

I am new to the field of crash analysis. I recently, by accident, happened to crash Google Chrome. I do not know the reason as to why the crash really happened. I'd like to know it in depth though.
When the crash happened, there was a Crash report that was generated. I have saved that report in a text file on my system, as I did not know what to do with it at the out start.
Now I have heard people in the info sec world talk about things like, analyzing and reversing a crash dump, fuzzing a crash dump etc. and trying to reproduce the crash.
I am interested in understanding how these things are done and in the first place what they actually are. I need help with resources that can help me understand how to analyze and reproduce a crash etc. I happened to come across: -Chrome: Found a crash, is it a security vulnerability? and Best way to triage crashes found via fuzzing, on Linux? but these resources seemed a bit advance and not very basic. Also googling up gave me some resources of how to analyze a BSOD in Windows, but I could not find anything relevant for Google Chrome Crash Analysis.
Please help provide some good resources where I can understand these concepts.
My Platform is Mac OSX 10.9.2 and my Google Chrome is Version 35.0.1916.153.
Im afraid this is a broad topic. For a head start, read about use after free , index out of read/write class of bugs. These are the most common in browsers.
By reproducing they mean you do the same step of things which made the browser crash and see if it is crashing again. Like lets say opening a malformed HTML/PDF/Font (or any browser input, there are many many more file types.) If you could reproduce the crash, you could attach Chrome to a debugger and check the registers at the time of crash.
To know if the crash is of any use, see this particular question on SE. For OSX, there is an amazing tool called Crashwrangler by Apple itself. If Crashwrangler reports the crash as exploitable, it is a definite security bug. Else you would need to do manual analysis to reach a conclusion. For this you need some knowledge about assembly language and software exploitation. OpenSecurityTraining has some amazing content on this. I highly recommend it. Start with x86 Assembly on the beginner section and finally MOV to reverse engineering. It is important to know how the stack is laid out in the memory and registers to understand a crash dump. I wish you all the best in the journey. Hope this helps.

Chromium: is communicating with the page faster than communicating with a worker?

Suppose I've got the following parts in my system: Storage (S) and a number of Clients (C). The clients are separate Web Workers and I'm actually trying to emulate something like shared memory for them.
Right now I've got just one Client and it's communicating with the Storage pretty intensively. For the sake of testing it is spinning in a for-loop, requesting some information from the Storage and processing it (processing is really cheap).
It turns out that this is slow. I've checked the process list and noticed chrome --type=renderer eating lots of CPU, so I thought that it might be redrawing the page or doing some kind of DOM processing after each message, since the Storage is running in the page context. Ok, I've decided to try to move the Storage to a separate Worker so that the page is totally idle now and… ended up getting even worse performance—exactly twice slower (I've tried a Shared Worker and a Dedicated Worker with explicit MessageChannels with the same results).
So, here is my question: why sending a message from a Worker to another Worker is exactly twice slower than sending a message from a Worker to the page? Are they sending messages through the page? Is it “by design” or a bug? I was going to check the source code, but I'm afraid it's a bit too complex and, probably, someone is already familiar with this part of Chromium internals…
P.S. I'm testing in Chrome 27.0.1453.93 on Linux and Chrome 28.0.1500.20 on Windows.

VS2008 partially freezing when switching to HTML design view

This is an odd freeze. When I switch from source view to design view for an HTML or ASPX file, the client area freezes, but I can still click on other tabs and menus.
What am I missing here? Really don't feel like reinstalling VS2008.
I had the same problem, and found one resolution.
In VS 2008, In a page that was using a master page, the either frequency while working in source view or switching to design view, IDE would freeze for 10-20 seconds.
In my master template, I had references to the Google hosted JQuery, Jquery UI, and one or two more scripts off site. These were placed directly in my master page's head section.
I downloaded the js and then by deleting any offsite references, my IDE would be smooth again in both design and source mode.
I also discovered I could put the scripts inside my ToolkitScriptManager (I'm using AjaxControlToolkit) and added the Mode="Release", and could place the http://www.google.com references for the scripts. The IDE is still working fine for me.
This is often due to the Design mode downloading external resources that are timing out. As #JonK mentioned, for him it was jQuery references. I have seen this when the ConnectionString was set to production databases that could not be accessed on my development machine, even though I wasn't debugging (running) the site only editing code, it would still try to connect and because it couldn't it would stall waiting for the timeout.
VS2008 is mostly single-threaded for UI operations like this, so if it is downloading a slow or non-existent network path it hangs like this.
VS2008 can make all kinds of network requests, so these two examples may not solve it for you. The best way I have found to diagnose the problem is to use the Microsoft tool Process Monitor, filter by the Process webdev.exe, and watch for I/O requests that are long running and/or throwing errors. In my case, I could find the place that was having a problem because there would be a 20 second gap in between the hundreds of I/O entries in Process Monitor. Then, just back-tracked from when that gap began and I eventually found the request that was causing the problem.
This may not be possible for you, but if you can, an upgrade to VS2010 would help; it does a much better job of running process on multiple threads in more places so you don't have to worry about this as much.
Have you tried restarting your computer and then reopening your project?