Software :: Detecting An Infinite Loop In A Process?
Apr 1, 2011
I am trying to develop a process monitor, or use existing monitors to achieve the below given actions.
1) Restart a processes if it crashes.
2) Restart a processes if it is stuck in an infinite loop.
The sample code below describes the structure of the process.
while(1)
{
statement 1....
statement 2....
while (1)
{
[Code].....
The goal is to restart the process if it is stuck in a loop, inside the outer while loop. Given this scenario, what would be the most efficient way to monitor such a process?
A sample solution would look something like this: statement 3 will write to file1 every time it is executed and we know that the maximum execution time of the outer while loop is 30 seconds. A second, timer driven process, checks for file1 being modified every 30 seconds. If the file is not modified, process 1 will be restarted assuming, process1 is stuck in a while loop.
View 2 Replies
ADVERTISEMENT
Oct 27, 2010
i was playing around with c++ recently and for laughs and giggles i came up with this little program
Code:
#include <iostream>
using namespace std;
int main ()
{
[Code]....
theoretically that should be an infinite loop but it in fact does terminate eventually echoing out 'FIRE!'
just wondering if even though in theory this should be an infinite loop (a number repetedly divided by 2 should never reach 0 thus the conditions of the loop should never be satisfied, hence infinite loop) perhaps in practice limitations of the variable types prevent this?
View 2 Replies
View Related
Mar 25, 2010
I think i came across a bug in X server in squeeze. I would report it to the bug tracking system in debian packages but the think is I am not entierly sure about it.When i start X (whether it is through startx or service gdm start or auto startup through init when the pc boots) the computer PC seems to lock up.The screen goes black right after X initializes and before anything is show in the screen and if i wait a about 10 minutes the monitor either goes in standby or out of range. PC seems unresponsive to both keyboard commands and mouse but my LCD screen in my G15shows the time skips 1 sec every 2 sec (from 19:22:22 goes straight to 19:22:24).
I have a custom 2.6.33 kernel which i build but it happens with both 2.6.32-trunk and 2.6.32-3 offical kernels from the squeeze repository so i dont think that this is the problem.My PC is a P4 3.75Ghz with 2Gb RAM and an NVidia 6800GT with the binary drivers from nvidia. I have tried diffrent versions from my grapgics drivers (NVIDIA-Linux-x86-173.14.25-pkg1.run & NVIDIA-Linux-x86-195.36.15-pkg1.run) with no change in the behaviouThis is the syslog from the time my pc started and then "stuck". I left it for some time before i hard reset it
View 14 Replies
View Related
Mar 17, 2010
I want to figure out what is going on in this small script.Its really strange.I think its the infinite loop again.All I want to do is to collect some data from the zenity dialog box in an array and then echo it.Here is the code
Code:
#!/bin/bash
#export PS4='+${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: ' debugging info
[code]...
View 5 Replies
View Related
Jun 3, 2010
I'm using debian etch and I've installed some automatic updates, after that some programs weren't running. So I restarted the pc. Now that the computer boot up normally but when it reaches the login screen it just emit a sound in the pc's speaker,he login screen flickers and is showed another login screen again and again and again (it's automatic). I can logon using the option single-user mode in the grub options, any idead on how can I fix it?
View 5 Replies
View Related
Apr 14, 2011
I have a java server console program that I have configured xinetd to start when connection comes in on a given port and then the program runs in an infinite loop receiving inputstream from telephone exchanges. The thing is, when a new chunk of stream comes from the exchange xinetd forks a new process each time. I tried setting the wait parameter to yes and restarted the deamon, but no success. How can I stop this behavior and have the deamon just direct the stream to the process already running? Am I missing something in my config or is it just incorrect?
My config is as follow:
defaults
{
instances = 60
log_type = SYSLOG authpriv
log_on_success = HOST PID
log_on_failure = HOST
cps = 50 10
}
includedir /etc/xinetd.d
And then my actual config,
service aos_larmar
{
socket_type = stream
protocol = tcp
user = root
type = UNLISTED
wait = yes
instances = 256
server = /home/gunnl/java/start.sh
port = 5204
disable = no
}
My server OS is, Red Hat Enterprise Linux ES release 4 (Nahant Update 7)
View 1 Replies
View Related
Jan 26, 2011
When I boot one of my machines, it gets as far as GRUB, then proceeds to a blank screen for a second, and then repeats the cycle all over again - ad infinitum. I have tried previous kernels on the list with the same results Also, I cant boot into recovery mode either.
I have run Memtest successfully from the GRUB options and no errors appear in the results. I have tried booting from a Live CD and here I get as far as the "OS choosing screen". When I then select one and hit Enter, the screen goes blank and the machine reboots as before.
View 5 Replies
View Related
Feb 15, 2011
I upgraded to 10.10, system rebooted but it is stuck at a constant loop.
I can go into safe graphics mode and things look fine except compiz isn't running. I have tried going into login and changing it to log me in automatically but the problem remains.
I've tried using my previous kernal and I have the same issue as this newer one.
I've tried loading gdm from CLI and the problem is still there.
View 2 Replies
View Related
Apr 18, 2011
I'm doing a dual boot Ubuntu 11.04 and Windows 7 on my Asus UL80v. When I restart and keep going into Ubuntu I'm fine, but I think if I go to Windows and then restart, the infinite start up happens, and I'm currently stuck in this. It'll go to the OEM screen, then a black screen with a cursor, then it goes black, and then back to the OEM screen and so on and so forth.
Luckily I have Ubuntu 10 on my flash drive, so I'm booting to that while I try to figure out this. Which reminds me, when I use the flash drive, there's an option to boot to local disk which also does not work, if that's worth anything. Before this happened, I ran check disk on windows because I ran into some partition troubles. There seemed to be no problems, and I can still access the drives from this flash Ubuntu.
View 1 Replies
View Related
Jun 25, 2011
I installed Xubuntu and was thrilled to see that it had already setup my Brother HL-2140 USB laser printer.However, there is something seriously wrong with the setup. When you try and print, even a test page - it just churns through the entire paper tray printing nothing. Also, when you restart the computer it tries to print the jobs again. I went to Printing and selected the printer but could not find where you could see the print job queue. I did see it during troubleshooting and was able to delete the jobs on the troubleshooting screen.
View 3 Replies
View Related
Aug 19, 2009
there's 2 scripts that i want to run when my server start.I a bit new to linux, i found that i could use the script rc.local to run things at startup, although, what i want to run is 2 infinite loop, so the first loop run but not the second.
View 14 Replies
View Related
Oct 28, 2010
It happens really randomly. Suddenly keyboard and mouse stop to react. Screen freezes. However if I have for instance skype running during that "crash", I can still continue to talk over internet. For me looks like x serwer crash. Xorg logs however are empty. I had to hard reboot only to get control over pc (magic sys key + SUB) only works. Trying switch to another session is not working. I run Slackware 13.1. Kindly asking to help me to solve that irritating issue. I pasted errors usually I find at Xorg.0.log.old after hard reboot only
Code:
2.6.35.4 #2 SMP Tue Sep 14 19:33:55 CEST 2010 i686 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel GNU/Linux
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 8800 GT/PCI/SSE2
OpenGL version string: 3.2.0 NVIDIA 195.36.15
OpenGL shading language version string: 1.50 NVIDIA via Cg compiler
[Code]...
View 1 Replies
View Related
Sep 16, 2010
I have recently been running into the "EQ overflowing" message. It has been happening when I open an image with gimp or a xls with open office. I noticed some were having this issue with earlier kernels. I am using the nouveau driver to run two nvidia cards with three monitors. I am currently running the 2.6.34.6-54.fc13.x86_64 kernel. Here is the output of my Xorg.0.log file:
[Code]...
View 1 Replies
View Related
Aug 17, 2011
Fedora 15, fresh install.I changed the wallpaper from default to a solid colour. After switching between gradient to colour the system crashed logged me out and upon logging in it simply runs endlessly accessing my harddisk but never actually loading the desktop.I can kill X and reboot, but it's the same problem waiting for me on restart. I really don't want to re-install or delete users (to put it in context, I just spent 3 days trying to install Fedora because Anaconda doesn't know how to install GRUB correctly).
View 5 Replies
View Related
Oct 20, 2010
I have just upgraded from 10.4 to 10.10 (x64), and now when I run gnu screen the new shell session goes into an infinite loop displaying:
Quote: Linux dave-desktop 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010 x86_64 GNU/Linux
Ubuntu 10.10
Welcome to Ubuntu! * Documentation: [URL]...
0 packages can be updated.
0 updates are security updates.
repeatedly until I hit CTRL-C and break out of screen. I tried tmux and that did the same thing, so it is a problem with the shell initialisation rather than with the screen program. However I can start bash, zsh or sh directly in a terminal with no problem.
View 1 Replies
View Related
Jan 13, 2010
When running a program that has infinite loops in the terminal , how to bring back the command prompt ? ( I'm using Fedora core 5 )
View 7 Replies
View Related
May 31, 2011
I downloading fedora 15 X64, when i want installing fedora in detecting hardware process, it is hanged! and not loaded but i easy install fedora 14. When some of process in fedora 15 loaded and show me please wait for detect hardware it is not work and like hanged.
View 5 Replies
View Related
Jul 9, 2010
I hade created a file with following text entries.
content of fileitems.txt
kdeaccessibility-4.4.92
kdeadmin-4.4.92
kdeartwork-4.4.92
kdebase-4.4.92
How do I read the file one line at a time and so its ready to do something with that line.
View 3 Replies
View Related
Apr 30, 2010
I'm trying to make a fresh install of Ubuntu 10.04 on my system. I have 9.10 correctly setup on what I see here as devsda2. devsda3 does contain /home. devsda1 is for Vista. They are on a 500Gb hard drive. I also have a second 500Gb hard drive, formerly on a raid 0 with the first one, but now independent (raid deactivated from bios). It is here know as /dev/sdb, and contains other 3 partitions. Raid 0 is not hardware, but is an intel fake raid.
I then have other 4 drives, causing me NO problem.
I start live mode of Ubuntu 10.04 with noraid option. When I try to setup Ubuntu, during the process, where it comes to manually select partitions, the two 500Gb hard drives disappears, such that I'm not able to install Ubuntu on what now is /dev/sda2
If I start live mode of Ubuntu without noraid option, I will see the two 500Gb hd as being part of a raid 0, such that I can't use them.
The other 4 hd normally appear in both cases.
View 3 Replies
View Related
Aug 19, 2015
I tried to install Debian 8.1 on Lenovo Edge 125, but on stage ''detecting network hardware' of install process my laptop stopped and froze, so I don't know what to do. (Previously I've installed Debian 6 or 7 on this laptop and every thing was OK).
View 6 Replies
View Related
Jun 20, 2010
When I add the line (sleep 5 ) & in the script then the "while read" loop does not read all lines from the file, but only prints the first line.But when I remove the ( sleep 5 ) & from the script, then the script prints all lines as defined in the file.And how to solve the problem? I want to create a new process (for which the sleep is just an example) in the while loop:
$ more test
#!/bin/ksh
while read -r line ; do
[code]....
View 1 Replies
View Related
Sep 1, 2010
I have a mytext file with month and year as two separate fields. likemytext fil
08 2010
09 2010
10 2010
........
........
........
I want to read the values of each field i.e., month and year into an awk script.
View 10 Replies
View Related
Aug 2, 2010
Last week I dropped my keyboard, came back about an hour later, and without realizing the keyboard was on the ground hitting a random button I went to add a bookmark to my menu panel(I think that's what it's called). An unknown amount of the selected bookmark then posted to my menu panel and now i am not even able to select my Applications, Places, or System options without the bookmarked task opening. Is there anyway of clearing out that entire menu panel and having a fresh start?
EDIT: All I did was delete the .gtk-bookmarks file and restart the computer. There were still alot of theme on the panel but i was able to delete them and everything returned to normal.
View 3 Replies
View Related
Oct 16, 2010
I was possibly overzealous in uninstalling packages using deborphan. I uninstalled various libraries and progams that I don't use (ppp, gimp, etc.), but I must have touched something useful, since the machine will no longer boot.
I thought this might cause a few problems, but expected to be able to recover, at least using the Recovery Mode. This isn't the case, sadly.
The main symptom is an infinite boot process, even using the recovery-mode boot. Things proceed as normal (grub screen, few lines of startup messages), but then a ton of text starts pouring onto the screen. It scrolls much too fast to read, and the Pause/Break key won't stop it. I do notice that there is a lot of talk about devices and udev, but can't make out more than that. The text doesn't obviously repeat, so I tried just waiting it out, but gave up after a couple hours.
View 3 Replies
View Related
Apr 11, 2011
How to print "hello" infinite times without using implicit or explicit loop.
View 1 Replies
View Related
Sep 14, 2015
For some reason my Conky is making my machine do infinite DNS requests to the last host I'm connected with. For example, if I visit forums.debian.net it'll start the infinite DNS request to this host. If I close the navigator it stops. If I try to connect to irc.freenode.net it starts the DNS requests. If I disconnect it stops. Why is it happening?
That's my script:
Code: Select allbackground no
update_interval 1
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
[Code] .....
View 0 Replies
View Related
Jan 18, 2011
Running Ubuntu 10.10. I was trying to get mythtv going and in my infinite wisdom decided to reboot to fix a install problem. Anyway now I get a "windows classic grey" login prompt - which seems to be a symptom of the more serious next problem: My desktop is black, mouse is black, taskbar exists but I only see the clock. No desktop icons etc etc.
View 1 Replies
View Related
Nov 11, 2010
I've some file with .sh extensions that runs some softwares.Now,how do I stop running that filesI know we run the command ./start_tomcat.sh to start the apache.Is there any command to stop that file/process or is it just kill the process to stop the process
View 2 Replies
View Related
Jan 20, 2011
Not sure where to post this, I am runing 10.04 LTS, 64 bit and things have been great, until..... I activated a Ubuntu One account and once I did, my Ubuntu One folder would immediately close upon opening and my downloads folder would immediately close upon opening. I delt with it, no big deal. So I decided that I need to get my crap off the Ubuntu One account so I downloaded them all from the website onto my desktop. Now none of my folders immediately close upon opening and ever couple seconds my desktop flashes and a windows quickly opens and closes stating "starting file manager".
I found a couple of posts the looked like fixes, but nothing has worked. clicked off show_desktop in gconf-editor which stops the "starting file manager", but does not stop the folder from immediately closing. I also found this, [URL]... but I don't know hoe to apply the patch nor if I should. I have tried some other things, but I cant find the threads again to provide. I believe one was the killall Nautilus then apply Linux Essentials, which I don't think even ran at all.
View 1 Replies
View Related
Jan 8, 2010
one tell me the internal working of kill command. that is how it kills a process internally or from where it picks file to continue its process.
View 3 Replies
View Related