Sooo..... 23hr without crash!
- TC17.1 vmlinuz & core.gz
- TC15 applications
- RUNNING my home controls application
- WITHOUT http calls
- WITHOUT x10-pheripheral being connected to usb and using libusb 1.0 library calls
- WITH 1wire-pheripheral being connected to usb and using libusb 2.0 library calls
- RUNNING stress program
- also running some standard apps: vnc-server, ssh, samba, apache
previously 5x "crash within 9hrs"
- TC17.1
- RUNNING my home controls application including http & libusb calls
- RUNNING stress program
- also running some standard apps: vnc-server, ssh, samba, apache
This brings big suspicion that the http calls in my application are the problem.
As said, the http calls from my application are written in a "not so clean part of code" using raw socket calls. It's a very old part of code that I wrote in 2009. If I would do that today I would likely use curl.
A further hint that the socket calls are the problem is that the crash-frequency went from multiple days to less than 9hrs when I added network-writes to my stress program (code at bottom). I'm writing to my network connected 2nd computer that I mounted using gifs:
sudo mount -t cifs -o vers=1.0,username=tc //192.168.2.203/root /remoteSo, NOT using nfs. That means that the network actions also use tcp sockets. (note, there is no wisdom behind this choice, it was just the first option I found on google when I did this).
Going forward....
Yesterday I hardened the http module of my application using my 2nd system. I made sure that all socket related calls now have proper error handling. I also included some syslog messages for every "added error-handling". This way I will see what errornous behavior previously went uncatched.
I did already testrun this on my 2nd system and I did sure see socket-errors that previously went uncatched.
I just rebooted basically full blown configuration:
- TC17.1 vanilla from TC download area including applications
- full-blown RUNNING my home controls application, including hardened http calls and libusb calls freshly compiled under TC17.1
- RUNNING stress program, freshly compiled under TC17.1
- also running some standard apps: vnc-server, ssh, samba, apache
Let's see whether this can run without crash!
I skipped a few steps in gradually working from yesterday configuration to current situation. Reason:
- running TC17.1 kernel with TC15 application did not seem to bring more robustness, not much reason to run like that
- disabling the X10 interface I kind of judge "less likely" to have added much to the robustness. It uses the libusb1.0 interface (by libusb compatibility library) but as the 1wire interface using the libusb2.0 library is functioning fine I donot see much danger.
If it starts crashing I will work backwards.
snippet of top to show load:
Mem: 476748K used, 484720K free, 42048K shrd, 4116K buff, 291860K cached
CPU: 24.9% usr 46.9% sys 0.0% nic 12.1% idle 1.6% io 0.0% irq 14.2% sirq
Load average: 1.91 1.93 1.98 4/207 4353
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
4084 3882 tc R 3128 0.3 0 42.2 ./stress17
4176 1 tc R 11584 1.2 0 21.9 /krubo/work/krubo17 /krubo/work/1wire.def
3360 2 root SW 0 0.0 0 9.8 [cifsd]
4331 2 root IW 0 0.0 0 3.1 [kworker/u4:0-ev]
4234 2 root IW 0 0.0 0 2.7 [kworker/u4:3-ev]
15 2 root IW 0 0.0 0 1.6 [rcu_sched]
4352 3882 tc R 3600 0.3 0 0.6 top
3382 1 root S 54584 5.6 0 0.4 /usr/local/sbin/rsyslogd
14 2 root SW 0 0.0 0 0.4 [ksoftirqd/0]
4009 1 root S 8192 0.8 0 0.2 x0vncserver -PasswordFile=/home/tc/.vnc/passwd
3877 3785 tc S 7972 0.8 0 0.2 sshd-session: tc@pts/0
3919 3874 tc S 405m 43.0 0 0.0 /usr/local/sbin/httpd -k start
3921 3874 tc S 404m 42.9 0 0.0 /usr/local/sbin/httpd -k start
4087 3874 tc S 391m 41.6 0 0.0 /usr/local/sbin/httpd -k start
3937 3874 tc S 384m 40.9 0 0.0 /usr/local/sbin/httpd -k start
3874 1 root S 162m 17.2 0 0.0 /usr/local/sbin/httpd -k start
3878 1 root S 44976 4.6 0 0.0 Xvesa -br -screen 1024x768x32 -shadow -2button -mouse /dev/input/mice
4142 3687 root S 19208 1.9 0 0.0 /usr/local/sbin/smbd -D
3701 3687 root S 18868 1.9 0 0.0 /usr/local/sbin/smbd -D
3687 1 root S 18812 1.9 0 0.0 /usr/local/sbin/smbd -D
4031 1 tc S 9852 1.0 0 0.0 wbar
3914 1 tc S 9628 1.0 0 0.0 flwm
code of stress program:
int Stress()
{ int i;
float d1[200], d2[200];
FILE *fd;
while (1)
{ fd = fopen("/remote/home/tc/stress.txt", "w");
if (fd)
{ for (i=0; i<100; i++)
d1[i] = 1.111*i;
for (i=0; i<100; i++)
d2[i] = d1[i]/ 1.111;
for (i=0; i<100; i++)
d1[i] = d2[i] * 1.111;
for (i=0; i<100; i++)
fprintf(fd, "dum %d\n",d1[i]);
fclose(fd);
}
}
return 1;
}