linux-um archives
 help / color / mirror / Atom feed
From: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
To: Peter <peter.repliesignored@rimuhosting.com>
Cc: user-mode-linux-devel@lists.sourceforge.net,
	Jeff Dike <jdike@addtoit.com>
Subject: Re: [uml-devel] Memory corruption/errors?
Date: Wed, 22 Dec 2004 22:33:59 +0100	[thread overview]
Message-ID: <41C9E847.2060405@fujitsu-siemens.com> (raw)
In-Reply-To: <41C9D1F0.4000605@rimuhosting.com>

[-- Attachment #1: Type: text/plain, Size: 1888 bytes --]

Peter wrote:
> I don't recall seeing an error where the obs and exp were equal.  I saw 
> plenty where they were not equal.
> 
> The code is pretty simple:
> double observed = a[i];
> double expected = (double) i;
> if (observed != expected) {
>           printf ("failed at i=%u, k=%u (obs %.18g vs exp %.18g)\n",i, 
> k,observed, expected);
> };
> 
> Maybe it is just some unexpected handling on the != operator with doubles?
> 
> Are you seeing cases where obs!=exp?  And difference if you run it on a 
> uni-proc server vs. a smp server?
No. I just found a problem in SKAS sigcontext handling.
The fp-registers are not restored correctly. Then, I remembered the problems
with memtest, which uses floatpoint.
I modified the test to have sighandlers being started evey 10ms, using
the fpu in the sighandler. Then, *many* error occured in my "memtest2".
Without the modification, I couldn't reproduce the problems.

Two questions:
1) are you able to reproduce the problems in TT-mode?
2) do you have any idea, why a signal handler using floatpoint should be started,
    while running the original memtest?

Have attached my memtest2.c

Regards
Bodo

P.S.: Mail with full description of the problem I've found will follow soon.
> 
> Regards, Peter
> 
> Bodo Stroesser wrote:
> 
>> Carl wrote:
>>
>>> Hi,
>>>
>>> Running the piece of code from the URL below is generating errors on
>>> various UML kernels:
>>>
>>> http://downloads.rimuhosting.com/memtest.c
>>>
>>> Kernels tested are: 2.4.27, 2.4.27-bs1, 2.6.9-bb4.
>>>
>>> Different UML host servers have been tried too, and only UMLs running on
>>> SMP (dual Xeon) servers seem to have the problem (P4s with HT are fine).
>>>
>>> Can anyone else reproduce the errors? Any ideas?
>>>
>>> Thanks, Carl
> 
> Do you see messages like this one
> 
>     "failed at i=17240, k=85 (obs 17240 vs exp 17240)"
> 
> with obs and exp being equal?


[-- Attachment #2: memtest2.c --]
[-- Type: text/plain, Size: 1138 bytes --]

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>

#define N (20*1024)

void sighdlr(int sig)
{
    double a;

    a = 256;

    double observed = a;
    double expected = 257;

    if ( observed == expected )
	printf("Error in sighdlr()\n");
}

int
main (void)
{
    size_t i, k;
    struct itimerval itimer = { { 0, 10000}, { 0, 10000} };

    signal(SIGALRM, sighdlr);
    setitimer( ITIMER_REAL, &itimer, NULL);

    for (k = 1; k < 1000; k++) {
	double *a = malloc (N * sizeof (double));
	if (a == 0) {
	    printf ("malloc failed at k=%u\n", k);
	    exit (1);
	}

	for (i = 0; i < N; i++) {
	    a[i] = (double) i;
	    double observed = a[i];
	    double expected = (double) i;
	    if (observed != expected) {
		printf ("failed at i=%u, k=%u (obs %.18g vs exp %.18g)\n", i, k,
		        observed, expected);
	    }
	}

	for (i = 0; i < N; i++) {
	    double observed = a[i];
	    double expected = (double) i;
	    if (observed != expected) {
		printf ("failed at i=%u, k=%u (obs %.18g vs exp %.18g)\n", i, k,
		        observed, expected);
//		exit (1);
	    }
	}
	free (a);
    }
    exit (0);
}

  reply	other threads:[~2004-12-22 21:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-20 22:56 [uml-devel] Memory corruption/errors? Carl
2004-12-22 12:09 ` Bodo Stroesser
2004-12-22 19:58   ` Peter
2004-12-22 21:33     ` Bodo Stroesser [this message]
2004-12-22 23:04       ` Peter
2004-12-22 23:15         ` Bodo Stroesser
2004-12-22 22:04 ` Bodo Stroesser
2004-12-22 22:07   ` Bodo Stroesser
  -- strict thread matches above, loose matches on Subject: below --
2004-12-23 13:26 [Fwd: Re: [uml-devel] Memory corruption/errors?] Bodo Stroesser
2004-12-24  2:32 ` Peter
2005-01-10  4:21   ` [uml-devel] Memory corruption/errors? peter
2005-01-10 10:10     ` Bodo Stroesser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41C9E847.2060405@fujitsu-siemens.com \
    --to=bstroesser@fujitsu-siemens.com \
    --cc=jdike@addtoit.com \
    --cc=peter.repliesignored@rimuhosting.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox