Kernel died, restarting in the middle of my simulation (spyder) - python-3.x

I am using the spyder interface with a python script that works through many time steps in succession. At a random point in my code, the process will terminate and the console will say "kernel died, restarting...". I tried running the same script in pycharm and the process also terminates, seemingly at a random point, with some exit code which I assume means the same thing.
Anyone have any tips on how to get rid of this problem? Even a workaround so I can get some work done. This is incredibly frustrating.
Note: I recently moved and got a new router and internet service, not sure if that might affect things.

Related

Python multiprocessing deadlock when calling logger-issue6721

I have a code running in Python 3.7.4 which forks off multiple processes. I believe I'm hitting a known issue (issue6721: https://github.com/python/cpython/issues/50970). I setup the child process to send "progress report" through a pipe to the parent process and noticed that sometimes a log statement doesn't get printed and that the code gets stuck in a deadlock situation.
After reading issue6721, I'm not sure I'm still understanding why parent might hold logger Handler lock after a log statement is done execution (i.e the line that logs is executed and the execution has moved to the next line of code). I totally get it that in the context of C++, the compiler might re-arrange instructions. Not fully understand it in context of Python. In C++ I can have barrier instructions to stop the compiler moving instructions beyond a point. Is there something similar that can be done in Python to avoid having a lock getting copied to child process?
I have seen solutions using "atfork" which is a library that seems not supported (so I can't really use it).
Does anyone know a reliable and standard solution to this problem?

Terminal CLi in Nodejs shutting down unexpectedly for no reason

I created an algorithm in nodejs using the cli terminal that receives an input of various values and makes the automated process of checking them in an api, so far so good, the problem is that he often stops this process and closes without any error or explanation. I have this problem with the VPS more than with my machine.
I forgot to mention that this process is done in parallel, the entries are separated into arrays and executed simultaneously x times at a time.
I thought it could be a possible memory leak since the process is a bit heavy but I have already done the test with less compliance and the result is the same and if it were he would warn me, the worst of all is that it only happens sometimes. Whoever had a similar problem could tell me how it was solved?
There is no code in the algorithm that closes the program, only after closing the loop, but it didn't have it before and even then it happened.

Does anyone have an idea how to find what or who is calling findstr.exe to run speratically?

I have Windows 10, and about a week ago I installed Avast Device Driver Updater and it did update my chipset, intel processor, and Intel RAID drivers, which were the only ones I allowed it to with no problems. However a couple of days after I started noticing that a CMD window just pops up out of no where and seemingly when it wants to, and it runs a bunch of FINDSDR commands on a bunch of directories that I don't have on my laptop. The window then closes before I have a chance to read any of the paths and quicker then I can catch it to copy anything. The problem is that I can not find the program, shell script, or anything that would be running that might be causing this to run.
I do know that it always tries the to find the same directories, and they fail every time. But I just cant read them... I checked and according to Avast, the Driver Updater does not run any scripts like this, so it should not be the updater process, and just to be sure, I have stopped it from Auto Loading at Boot, and I turned off all it's functions in the settings.
So, I would like to know if anyone knows of any tricks that would help me identify what is calling the findstr.exe, or a way to trap it, while it's running (though even it I trapped it, I don't know how I can use that info to find the culprit that is causing it to run. I am hoping some one know how I can figure out what or where its running from and whos making it run. Any ideas? Thanks a bunch in advance!

What could cause an executable, called by a powershell script, to hang when it exits

I'm debugging a particularly strange problem...
As a part of my team's test suite, we run a powershell script that calls an executable I wrote in C#.
Every blue-mooned Tuesday, the executable will hang indefinitely until we kill the process. Most days it works just fine, and I haven't gotten it to repro.
The curious part is that this exe hangs after it's done doing all it's work. It's output the last line of data and the main thread is exiting. There's no multithreading in this process, and CPU is at 0% and thread count is 1.
All I/O (other than console writes) is done earlier in the execution, and there's no exception catching anywhere, so if something throws we should see it.
I don't need a definitive "this is the issue," but I have no idea what could cause this behavior. If you could respond with any theories on why this would be happening (no matter how far fetched) that'd be great.
Version info
OS: Windows 2008 R2
Powershell: v2 (comes with R2)
.NET: v4
Heh, this is worth a shot. Got
Console.ReadLine()
anywhere at the end of some line of logic?
I've got a behaviour like that on one of my "C" console program. It was well working started via "CMD.EXE" but when I use it via "POWERSHELL.EXE" it hang (systematicaly) at the end of exécution.
In this code, there are keyboard pooling loop (while (! _kbhit()), and at the moment I solve the problem by consuming (getch()) the keydown that fired the last loop. I don't understand exactly why.
In the Powershell script the result of the exe file is affected to a var.

What do you do with badly behaving 3rd party processes in Linux?

Anytime I have a badly behaving process (pegging CPU, or frozen, or otherwise acting strangely) I generally kill it, restart it and hope it doesn't happen again.
If I wanted to explore/understand the problem (i.e. debug someone else's broken program as it's running) what are my options?
I know (generally) of things like strace, lsof, dmesg, etc. But I'm not really sure of the best way start poking around productively.
Does anyone have a systematic approach for getting to the bottom of these issues? Or general suggestions? Or is killing & restarting really the best one can do?
Thanks.
If you have debugging symbols of the program in question installed, you can attach to it with gdb and look what is wrong there. Start gdb, type attach pid where pid is the process id of the program in question (you can find it via top or ps). Then type Ctrl-C to stop it. Saying backtrace gives you the call stack, that means it tells which line of code is currently running and which functions called the currently running function.

Resources