Stanislav Meduna wrote:

> Am I seeing ghosts? Anyone got other mysterious
> problems with current UML kernel? Could it be that
> some state-saving method is corrupting fp registers
> or something like that? Was there some change in the
> UML / vanilla kernel recently?

Confirmed: I can reproduce openssl changing a double
value in unrelated process. I was not able to come
up with a code not relying on external software yet:

===
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
#include <signal.h>

testdblchg()
{
   volatile double x0 = 2.0;
   volatile double x1;
   int iter = 0;

   fprintf(stderr, "Starting loop, pid=%d\n", getpid());

   while(1)
   {
     ++iter;
     x1 = x0;
     x0 += 1.0;
     if (x0 != x1 + 1)
     {
       kill(getppid(), SIGTERM);
       fprintf(stderr, "Double variable changed! pid=%d, iteration=%d, 
should=%g, 
is=%g\n", getpid(), iter, x1+1, x0);
       exit(1);
     }
     sleep(1);
   }
}

testcrypto()
{
   while(1)
   {
     system("openssl genrsa -out /dev/null 4096");
     sleep(1);
   }
}

main()
{
   if (fork() == 0)
     testdblchg();

   testcrypto();
}
===

Output:
$ ./a.out
Starting loop, pid=16920
Generating RSA private key, 4096 bit long modulus
......++
.......................................................................................................................................................................++
e is 65537 (0x10001)
Generating RSA private key, 4096 bit long modulus
...................................Double variable changed! pid=16920, 
iteration=15, 
should=nan, is=nan
Terminated

$ uname -a
Linux dirk 2.6.26 #1 Wed Jul 30 10:56:10 CEST 2008 i686 GNU/Linux

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : User Mode Linux
model name      : UML
mode            : skas
host            : Linux seldon-base 2.6.23.17 #2 SMP Sat Jun 21 15:04:22 CEST 
2008 i686
bogomips        : 4771.02

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-2' 
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared 
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext 
--enable-threads=posix 
--enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr 
--enable-targets=all --enable-cld --enable-checking=release 
--build=i486-linux-gnu 
--host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.1 (Debian 4.3.1-2)

$ dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  libc6          2.7-10         GNU C Library: Shared libraries


Regards
-- 
                                            Stano

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to