On Fri, 14 Dec 2001, Michael Widenius wrote:

> 
> Hi!
> 
> 
> Michael> A couple of others have reported this in the last month.  I reported what
> Michael> I believe to be the same problem on Mon, 29 Oct 2001 with mysql 3.23.43
> Michael> built from source with gcc 2.95.3 according to the instructions in the
> Michael> manual.  I believe the problem is that enabling largefile support, as is
> Michael> done in the official binaries, breaks getrlimit/setrlimit in HPUX 10.20,
> Michael> at least for us.  It seems that when you enable largefiles (define
> Michael> _FILE64), rlim_t changes from uint32_t to uint64_t, and something goes
> Michael> horribly wrong.
> 
> Actually everything works perfectly :)
> 
> Michael> Try this simple c program (based on set_maximum_open_files in mysqld.cc):
[snip]
> 
> Michael> I named this rlimtest.c.  Here's what I get:
> 
> <cut>
> 
> Michael> $ gcc -D_FILE64 rlimtest.c                                          
> Michael> $ ./a.out                                                           
> Michael> getrlimit: cur=137119232 max=60
> Michael> assign: cur=2063670312 max=100
> Michael> setrlimit: cur=137119232 max=100
> 
> Michael> As you can see, I get nonsense with _FILE64.  
> 
> This is becasue rl.rlimit_cur and rl.rlim_max are 64 bit integers, but
> you are using printf() on 32 bit integers!
> 
> Fix:  cast all integer arguments to printf to (long) or print the
>        integers are high-byte / low-byte.
> 
> I did the casts to long and the above worked perfectly for me.

Of course, you are right.  As I said, I took this code from
set_maximum_open_files in mysqld.cc: simply turning the 1st
sql_print_error line into the printf lines.  I should have looked more
carefully, but I thought I had something here, as I'll explain below.
(Strange, though, that rl.rlimit_max printed fine without the cast to
long.)

> Michael> Strictly speaking, then, this is a bug in either HPUX or gcc (probably
> Michael> HPUX), not in mysql.  On the other hand, those of us who have this problem
> Michael> cannot use the precompiled binary.  
> 
> The precompiled binary should work ok.

I tried the precompiled binary (3.23.43) and got the same error.
 
> Michael> My workaround is to compile mysql from source, adding --disable-largefile
> Michael> to the options recommended in the manual.  Perhaps there is a better way
> Michael> -- maybe a fix for HPUX?
> 
> What kind of errors do you get if you don't use --disable-largefile ?

As I reported in my earlier email on Oct. 29, I get essentially the same
error as was reported here, namely, setrlimit fails.  I configured as you
recommend, run make, then make test.  I get:

=======================
$make test
cd mysql-test ; ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
011214 21:50:26  Warning: setrlimit couldn't increase number of open files
to more than 60
011214 21:50:26  Warning: Changed limits: max_connections: 50
table_cache: 64
011214 21:50:26  ../sql/mysqld: Shutdown Complete

Installing Slave Databases
011214 21:50:26  Warning: setrlimit couldn't increase number of open files
to more than 60
011214 21:50:26  Warning: Changed limits: max_connections: 50
table_cache: 64
011214 21:50:27  ../sql/mysqld: Shutdown Complete

[snip]

isam                           0.0      0.0      4.6       [ pass ]
isolation                     ....     ....     ....       [ skipped ]
join                          ....     ....     ....       [ fail ]


Aborting. To continue, re-run with '--force'.
============================

As you can see, setrlimit fails to increase the allowed number of open
files, then the join test fails because it wants to open more than 60, the
default on my system.  The ouput quoted here is from 3.23.46 built today,
but it's the same as I got in October with 3.23.43.


> Michael> I also note that every post I could find on Google on the subject of
> Michael> building mysql from source on HPUX 10.20 recommended --disable-largefile
> Michael> (though none I saw actually said why).
> 
> I haven't seen this before.

I should clarify: None of these said you need --disable-largefile.  When I
ran into the problem above, I went looking for solutions.  I found several
threads in which someone said it didn't work on HPUX 10.20, then someone
else replied with "I built it this way and it worked."  I noticed that
each of these replies differed from the recommended build mainly by adding
--disable-largefile to configure.  None of them pointed to that
explicitly, but I added --disable-largefile and rebuilt and it worked.  
No more rlimit warning and join test passed.

This led me to look at mysqld.cc where setrlimit is called, which led me
to my test program, which led me down the wrong path, apparently, as
you've pointed out.  Still, adding --disable-largefile fixes the problem
with setrlimit for me.

Michael


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to