List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:April 10 2000 11:16am
Subject:BSDI 4.1 With MYSQL
View as plain text  

>>>>> "Rodrick" == Rodrick Brown <System Administrator>
> <rodrick@stripped> writes:

Rodrick> OS: BSDI BSD/OS 4.1 i386
Rodrick> This system is fully patched from M410-001 to M410-011
Rodrick> System Specs: Dual Pentium III 500 256MB ram 

Rodrick> IN client/get_password.c file. At line 148 (just before
Rodrick> DBUG_RETURN(my_strdup(buff, ...));),  I added the following line


Thank for providing an account to look at this.

There seems to be 2 problems with your system;

Double arguments are not returned properly by your compiler or the
conversion from unsigned long to double doesn't work properly:

This happens in the rnd() function in the MySQL server:

 Breakpoint 4, rnd (rand_st=0x812ecb8) at password.c:51
51        rand_st->seed1=(rand_st->seed1*3+rand_st->seed2) %
rand_st->max_value;Current language:  auto; currently c
(gdb) step
52        rand_st->seed2=(rand_st->seed1+rand_st->seed2+33) %
53        return (((double) rand_st->seed1)/rand_st->max_value_dbl);
(gdb) p rand_st[0]
$12 = {seed1 = 122727521, seed2 = 600435124, max_value = 1073741823, 
  max_value_dbl = 1073741823}
(gdb) p (double) rand_st->seed1
$13 = 122727521
(gdb) p (double) rand_st->seed1/1073741823
$14 = 0.11429891094034436
(gdb) fin
Run till exit from #0  rnd (rand_st=0x812ecb8) at password.c:53
0x8071b1d in create_new_thread (thd=0x813e000) at
1435        thd->scramble[i]= (char) (rnd(&sql_rand)*94+33);
Value returned is $15 = 8.9555548571104126e-270

In other words, the function should return 0.11.. but it returns a
very small results and this confuses the password handling totally in
mysqld. I even tried to compile the above functions without
optimization, but this didn't change anything :(

I did some more checking and the problems seems that long values can't
be converted to (double) by your installed compiler :(

gdb) set tmp=5
(gdb) p tmp
$5 = 5
(gdb) next
54        tmp=(double) (long) rand_st->seed1;
0x8073791       56      }
(gdb) p rand_st->seed1
$7 = 180065144
(gdb) p tmp
$6 = 8.275783586691418e-313

To fix this, I would suggest you to try to get gcc 2.95.2
and check if things works better with this.

The other problem is that when a thread calls pthread_exit(), the
thread system will send a SIG_ABORT to the mysqld server main thread
that dies because of this; (The above should only happen if the main
thread dies, not for a sub thread)

This indicates that there is some bug in pthread_exit();  Without
access to a pthread library compiled for debugging, it's very hard to
say what's going on :(

Sorry, for not being able to provide more information;  If you can
recompile everything with glibc 2.95.2 + the pthread library with
debugging I could login again and do some more checking.

subscribe mysql-announceMichael T. Babcock12 Mar
  • BSDI 4.1 With MYSQLMichael Widenius10 Apr
  • Re: New version of mysqlguiJeremy D. Zawodny17 Nov
    • Re: New version of mysqlguiSinisa Milivojevic18 Nov
Re: subscribe mysql-announceFred Lindberg13 Mar