From: Ian Pratt Subject: Re: xen-2.0 20040923 and previous: rpm crash in xenU Date: Sat, 25 Sep 2004 11:34:13 +0100 Sender: xen-devel-admin@lists.sourceforge.net Message-ID: References: <4153FF86.1000805@thegreen.co.uk> Return-path: In-reply-to: Your message of "Fri, 24 Sep 2004 12:05:42 BST." <4153FF86.1000805@thegreen.co.uk> Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Peri Hankey Cc: xen-devel@lists.sourceforge.net, Ian.Pratt@cl.cam.ac.uk List-Id: xen-devel@lists.xenproject.org > I have previously mentioned a floating point exception in rpm which > seemed at one point to be connected with block-device handling in xenU > systems, as both problems occurred at the same time. As I now get only > the rpm floating point exception (sporadically), I have examined it further: > > gettimeofday({1096021305, 741150}, NULL) = 0 > nanosleep({0, 20000000}, {1076798912, 1075195904}) = 0 > gettimeofday({1096021305, 741150}, NULL) = 0 > --- SIGFPE (Floating point exception) @ 0 (0) --- > +++ killed by SIGFPE +++ > I've tried hard to reproduce this but failed. It might be worth having a look at the rpm source to check that the nanosleep is wrapped in a while loop, and where the presumed division by zero is really coming from. Since the strace prints the arguments that gettimeofday is passed rather than returns, we can't really tell from the trace what gettimeofday is actually returning. If there's a following call in the trace using the same struct we can probably deduce it. I've appended the test program I've used to debug this and other time issues. You might want to run it on your system just to check. Thanks, Ian #include #include #include #include /**************************************************************************/ /* rpcc: get full 64-bit Pentium TSC value */ static __inline__ unsigned long long int rpcc(void) { unsigned int __h, __l; __asm__ __volatile__ ("rdtsc" :"=a" (__l), "=d" (__h)); return (((unsigned long long)__h) << 32) + __l; } /* * find_cpu_speed: * Interrogates /proc/cpuinfo for the processor clock speed. * * Returns: speed of processor in MHz, rounded down to nearest whole MHz. */ #define MAX_LINE_LEN 50 int find_cpu_speed(void) { FILE *f; char s[MAX_LINE_LEN], *a, *b; int mhz = 2400; if ( (f = fopen("/proc/cpuinfo", "r")) == NULL ) goto out; while ( fgets(s, MAX_LINE_LEN, f) ) { if ( strstr(s, "cpu MHz") ) { /* Find the start of the speed value, and stop at the dec point. */ if ( !(a=strpbrk(s,"0123456789")) || !(b=strpbrk(a,".")) ) break; *b = '\0'; fclose(f); return(atoi(a)); } } out: fprintf(stderr, "find_cpu_speed: error parsing /proc/cpuinfo for cpu MHz. Assume %d Mhz",mhz); return mhz; } int mhz; int looper (int N) { int i,a=12345; for(i=0;ilast) { if(count>5) { printf("[%lld.%lld %lld] duplicates= % 5d (% 5lldus)\t prev OK= % 6d\t fe %lldus (d=%lldus) skip = %lld\n", gt_firsteventtime/1000000,gt_firsteventtime%1000000, firsteventtime, count, (lasteventtime-firsteventtime)/mhz, okcount,(firsteventtime-start)/mhz, (firsteventtime-lastfirsteventtime)/mhz, skip); okcount = 0; lastfirsteventtime = firsteventtime; } count = 0; firsteventtime = 0; okcount++; } last = now; xlast = xnow; } #if 0 while(1) { int i; gettimeofday(&a, NULL); for(i=0;i<10000;i++); gettimeofday(&b, NULL); start = (((long long)a.tv_sec) * 1000000) + a.tv_usec; stop = (((long long)b.tv_sec) * 1000000) + b.tv_usec; if(1||stop