public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* salinfo-0.4 patch
@ 2004-01-28 21:22 Ben Woodard
  2004-01-28 21:50 ` Keith Owens
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ben Woodard @ 2004-01-28 21:22 UTC (permalink / raw)
  To: linux-ia64

Here is a tiny patch for salinfo-0.4. There is a problem with when it
deals with multiple errors. The decoded error messages fill up with
progressively more white space. 

The problem seems to be that the indent variable doesn't get cleared
between errors and so the indent level gets progressively deeper until
the file grows to astronomical purportions. My understanding from the
sys admins is that when we first booted up some machines with a salinfo
daemon about half of them crashed because the backlog of errors that had
accumulated in the SAL. As the salinfo_decode daemon processed these
sequentially, and the level of indenting grew, the size of the decoded
files in /var/log/salinfo grew to several megabytes each and quickly
filled up /var and then bad things happened.

While poking around in the iprint function, I also found an error
message that looks like it is better suited for stderr rather than
stdout so I retargetted it.

diff -ru salinfo-0.4/mca.c salinfo-0.4-ben/mca.c
--- salinfo-0.4/mca.c	2003-12-04 12:03:18.000000000 -0800
+++ salinfo-0.4-ben/mca.c	2004-01-27 16:47:44.000000000 -0800
@@ -104,8 +104,9 @@
 				fputs("  ", stdout);
 			startofline = 0;
 			if (++iprintf_count > 1000000 /* arbitrary */) {
-				printf("\n\nError: iprintf line count exceeded, aborting output\n\n");
-				fflush(stdout);
+				fprintf(stderr,
+					"\n\nError: iprintf line count exceeded, aborting output\n\n");
+				fflush(stderr);
 				exit(1);
 			}
 		}
@@ -1502,7 +1503,7 @@
 	decode_oem_cpu = cpu;
 	decode_oem_oemdata_fd = oemdata_fd;
 
-	iprintf_count = 0;
+	iprintf_count = indent = 0;
 
 	if (debug > 1)
 		prt_record_header(lh);




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-30  2:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-28 21:22 salinfo-0.4 patch Ben Woodard
2004-01-28 21:50 ` Keith Owens
2004-01-28 23:32 ` Ben Woodard
2004-01-30  2:36 ` Ben Woodard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox