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):
Michael> ===========================
Michael> #include <sys/resource.h>
Michael> #include <errno.h>
Michael> #include <stdio.h>
Michael> int main()
Michael> {
Michael> struct rlimit rl;
Michael> uint x;
Michael> x = 100;
Michael> if (!getrlimit(RLIMIT_NOFILE,&rl))
Michael> {
Michael> printf("getrlimit: cur=%ld max=%ld\n", rl.rlim_cur, rl.rlim_max);
Michael> }
Michael> rl.rlim_cur = x;
Michael> rl.rlim_max = x;
Michael> printf("assign: cur=%ld max=%ld\n", rl.rlim_cur, rl.rlim_max);
Michael> if (setrlimit(RLIMIT_NOFILE,&rl))
Michael> {
Michael> printf("Err: errno=%ld cur=%ld max=%ld\n",errno,rl.rlim_cur,rl.rlim_max);
Michael> }
Michael> printf("setrlimit: cur=%ld max=%ld\n", rl.rlim_cur, rl.rlim_max);
Michael> 0;
Michael> }
Michael> ===========================
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.
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.
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 ?
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.
Michael> Michael
Michael> On Tue, 4 Dec 2001, Hans-Joerg Puch wrote:
>> Hello,
>> I was trying a normal installation on a HP UX 10.20 based HP 9000/712.
>> The log looks like this:
>> ___________________________________
>> Preparing db table
>> Preparing host table
>> Preparing user table
>> Preparing func table
>> Preparing tables_priv table
>> Preparing columns_priv table
>> Installing all prepared tables
>> 011204 15:37:50 Warning: setrlimit couldn't increase number of open
>> files to more than 60
>> 011204 15:37:50 Warning: Changed limits: max_connections: 50
>> table_cache: 64
>> scripts/mysql_install_db[292]: 3477 Memory fault(coredump)
>> Installation of grant tables failed!
This could happen if the above machine's libraries are somehow not
compatible with ours. It would be nice to know why...
Regards,
Monty
---------------------------------------------------------------------
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