How can I force my node.JS Application to crash with a custom error message - node.js

I was thinking that on macOS, you get a cool crash reporter that shows up when an application crashes. I wanted to force that with my app, that has a "Test Crash" button in a Tray Menu application (electronJS), and show a custom error message. If not, just making the app freeze up/hang would be good.
I was thinking about running a resource-heavy command that got looped super fast but that might use all the computer resources and then it'd be the one that crashes.
Is there any way to do this without process.exit()?

Related

Blueprism Application Modeller showing Launch instead of Identify when spying

I am using BluePrism v6.1.0 and I am trying to identify elements from a launched application in Application Modeller. (I used the Windows application type in the modeler configuration)
From some tutorials I saw, the launch button changes to Identify button after the app is launched, however, mine is still showing "Launch". Please see screenshot below
screenshot
You need to launch the application from the application modeller, not on your own.
Since you are using Windows 10, the built in applications are use differently than normal in windows 7. Here is how you can add the code to make it work with your system Screenshot. Also for future applications use this code in Windows Power Shell to get information about the application you wanted to work with in Window 10 : "Get-AppxPackage"
Not fully explained here but this can also mean not only is the app not launched but blueprism can't "see" the app is launched. Two ways to solve this so close the application and relaunch it then it will change to identify, OR you can attach the current instance of the object to the running application.
Either way the outcome is you're making blueprism see the active application so it will change the launch to an identify option.
Edit: watch out as well, if you connect your application to blue prism and then detach it blue prism will no longer see the running application hence will revert the identify option into a launch option.

NPM Nodejs crashes with BSOD

So I'm getting a blue screen of death whenever I have "npm start" running for a reactjs app. It's an intermittent crash, i.e. it doesn't happen every time I run it nor are there any exact steps to duplicate the crash, but I'll try to explain below under what circumstances it happens.
Create a reactjs app using create-react-app npm module.
Start the app using npm start. Chrome window opens, webpack is listening to changes I make to the source files.
Change any source file, and save it. NPM compiles it, Chrome page refreshes, and I can see my changes.
The above things work fine as expected "normally", but once in a while, right after I save a file, the system crashes with a BSOD saying DRIVER_IRQL_NOT_EQUAL_TO_OR_GREATER_THAN (NETIO.SYS) There is no definite "step" or action other than saving the file, or refreshing Chrome that would cause this to happen, and it also doesn't happen every single time.
Here are the steps I took to find out/eliminate the root cause of this issue:
Disabled by AV (Symantec Endpoint Protection).
Use a different browser (Mozilla, hell, even IE).
Changed the system (used a different laptop, although the same type - Microsoft Surface on Windows 10)
Updated all drivers, etc. (Verified by my organization admins)
Closing all other programs, etc. that might potentially be interfering (Atom IDE, Eclipse, etc.)
The necessary conditions for the crash to happen are:
npm start must be running (webpack server on localhost:3000)
A browser window must be open connected to localhost:3000 (if no browser is connected, it doesn't crash even if you change and save the file 200 times - I checked). Also, doesn't matter which browser (Checked with Mozilla/Edge/Chrome)
I believe the crash happens when NPM is recompiling the files and serving it to the browser (asking it to refresh using some websockets), but I'm not an expert on NodeJS/NPM so I'm not sure.
I've been stuck on this issue for more than 2 weeks now. Any help would be really appreciated. Kindly let me know if more information is needed.
The issue was with Symantec DLP (Data Loss Prevention) that was also installed on all our systems. The issue resolved itself after the admins added application exceptions for Nodejs, NPM, my reactjs project workspace paths.
Just posting this so that in case someone has a similar issue they can try this or remove Symantec DLP altogether.

Azure Emulator appears to hang on Web Role startup

I am trying to use the Azure emulator to debug a .net solution for VS2013, I am using IIS Express and Emulator Express. The project contains several worker roles, which start just fine, and one web roles that seems to hang intermittently. The weird thing is that if I reboot the computer and restart the debugger, it seems to work.
I see the following lines if I click on the "Show Compute Emulator UI" option, Web Role:
[fabric] Role Instance: deployment28(2907).MyApp.Cloud.MyApp.Web.0
[fabric] Role state Unhealthy
When it hangs, I can go to make an initial API call while the dialog is still displaying and see the Unhealthy error message displaying, I receive a response from the API call which would indicate the web role is running even though it is saying the role state is unhealthy and the dialog is still displaying. As a side note, before it returns I see a lot of Loading symbol messages on the lower left of the screen that usually displays a Ready message.
Here is the dialog that is displaying:
1) Why is it hanging if it is able to receive requests?
2) What is a way to troubleshoot a problem like this when you are using the IIS Express and emulator express?
3) What could be the cause of this problem and what are possible solutions?

Getting detailed crash dumps from a hooked exe

I am trying find a problem with my program that is hooking into a game. This is
vc++. Basically I launch the program and then hook into it using SDL. When I run the code from VS2010, all works fine. But when I try to run from command prompt, my program can launch the game, but after that the game crashes immediately.
I was viewing windows event logs, and it appears that there is an access violation. 0xc000005
How can I log any further details about the program that crashes? I tried "procdump" but that is not useful as I cannot INDIRECTLY target the hooked game from console. Rather it can only target my application that hooks.
Anyway of getting detailed dumps is highly appreciated in this case.
Thanks!
You can perform postmortem debugging by using a combination of the WER registry keys/values to trap any dump that is produced. I’ve used this method to prevent the WER system from collecting the dump file (.dmp). I’ve also written about this in another similar post. To accomplish this, you will need to create a registry key under
Software\Microsoft\Windows\Windows Error Reporting
if one does not already exist. The key should be
LocalDumps\your application.exe
Once that’s done, modify these keys/values to meet your needs:
DumpCount, DumpFolder, DumpType
You’ll need Administrator rights to create and modify the keys, and, you should reset everything you’ve modified when you’re done debugging.

VS12 Debugger crashes only for IE

I have an MVC3 app that's been working for quite a while and today began crashing anytime I launch a debugging session with IE as the initial browser. If my initial browser is Chrome or FF - no problem. Further....if I open the site with IE _after it's been launched to one of these other browsers, no problem. The debugger's break points respond just as expected. So that's pretty strange, yes?
I can F10 without hitting any problems until the point where the browser is invoked and, up to this point, haven't been able to catch the last couple lines in VS's output windows - it crashes and restarts without giving opportunity to copy any of that output.
Event viewer shows:
Fault bucket 3561940412, type 5
Event Name: CLR20r3
Exception code: 0xe0434352
(there's more erreta if you'd like deeper details) - searching against those codes looks like it's a fairly general/generic error.
I've stepped out to the file system and deleted the .obj and .bin folders for all the projects in the solution, rebooted a couple times, and am in the process of getting on with my life cuz, as of right now, this is easy enough to work around.
I suppose i could delete windows temp files and check again. Any other thoughts?

Resources