A couple of others have reported this in the last month.  I reported what
I believe to be the same problem on Mon, 29 Oct 2001 with mysql 3.23.43
built from source with gcc 2.95.3 according to the instructions in the
manual.  I believe the problem is that enabling largefile support, as is
done in the official binaries, breaks getrlimit/setrlimit in HPUX 10.20,
at least for us.  It seems that when you enable largefiles (define
_FILE64), rlim_t changes from uint32_t to uint64_t, and something goes
horribly wrong.

Try this simple c program (based on set_maximum_open_files in mysqld.cc):
===========================
#include <sys/resource.h>
#include <errno.h>
#include <stdio.h>

int main()
{
  struct rlimit rl;
  uint x;
  
  x = 100;
  if (!getrlimit(RLIMIT_NOFILE,&rl))
  {
    printf("getrlimit: cur=%ld max=%ld\n", rl.rlim_cur, rl.rlim_max);
  }
  rl.rlim_cur = x;
  rl.rlim_max = x;
  printf("assign: cur=%ld max=%ld\n", rl.rlim_cur, rl.rlim_max);
  if (setrlimit(RLIMIT_NOFILE,&rl))
  {
    printf("Err: errno=%ld cur=%ld max=%ld\n",errno,rl.rlim_cur,rl.rlim_max);
  }
  printf("setrlimit: cur=%ld max=%ld\n", rl.rlim_cur, rl.rlim_max);
  0;
}
===========================

I named this rlimtest.c.  Here's what I get:

$ gcc rlimtest.c 
$ ./a.out                                                           
getrlimit: cur=60 max=1024
assign: cur=100 max=100
setrlimit: cur=100 max=100

but 

$ gcc -D_FILE64 rlimtest.c                                          
$ ./a.out                                                           
getrlimit: cur=137119232 max=60
assign: cur=2063670312 max=100
setrlimit: cur=137119232 max=100

As you can see, I get nonsense with _FILE64.  

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

My workaround is to compile mysql from source, adding --disable-largefile
to the options recommended in the manual.  Perhaps there is a better way
-- maybe a fix for HPUX?

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

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!
> 
> Examine the logs in ./data for more information.
> You can also try to start the mysqld daemon with:
> ./bin/mysqld --skip-grant &
> You can use the command line tool
> ./bin/mysql to connect to the mysql
> database and look at the grant tables:
> 
> shell> ./bin/mysql -u root mysql
> mysql> show tables
> 
> Try 'mysqld --help' if you have problems with paths. Using --log
> gives you a log in ./data that may be helpful.
> 
> The latest information about MySQL is available on the web at
> http://www.mysql.com
> Please consult the MySQL manual section: 'Problems running
> mysql_install_db',
> and the manual section that describes problems on your OS.
> Another information source is the MySQL email archive.
> Please check all of the above before mailing us!
> And if you do mail us, you MUST use the ./bin/mysqlbug script!
> ___________________________________________
> What's wrong?
> I did run ./bin/mysqldbug which created this:
> ____________________________________________
> SEND-PR: -*- send-pr -*-
> SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
> 
> SEND-PR: will all comments (text enclosed in `<' and `>').
> SEND-PR:
> From: root
> To: [EMAIL PROTECTED]
> Subject: [50 character or so descriptive subject here (for reference)]
> 
> >Description:
>         <precise description of the problem (multiple lines)>
> >How-To-Repeat:
>         <code/input/activities to reproduce the problem (multiple
> lines)>
> >Fix:
>         <how to correct or work around the problem, if known (multiple
> lines)>
> 
> >Submitter-Id:  <submitter ID>
> >Originator:
> >Organization:
>  <organization of PR author (multiple lines)>
> >MySQL support: [none | licence | email support | extended email support
> ]
> >Synopsis:      <synopsis of the problem (one line)>
> >Severity:      <[ non-critical | serious | critical ] (one line)>
> >Priority:      <[ low | medium | high ] (one line)>
> >Category:      mysql
> >Class:         <[ sw-bug | doc-bug | change-request | support ] (one
> line)>
> >Release:       mysql-3.23.46 (Official MySQL binary)
> 
> >Environment:
>         <machine, os, target, libraries (multiple lines)>
> System: HP-UX galileo B.10.20 A 9000/712 2000839175 two-user license
> 
> 
> Some paths:  /usr/contrib/bin/perl /usr/bin/make /usr/bin/cc
> 
> Compilation info: CC='gcc'  CFLAGS='-DHPUX -I/opt/dce/include -O3'
> CXX='gcc'  C
> XXFLAGS='-DHPUX -I/opt/dce/include -felide-constructors -fno-exceptions
> -fno-rtt
> i -O3 '  LDFLAGS=''
> LIBC:
> -r-xr-xr-x   1 bin        bin        1867776 May  2  2001 /lib/libc.1
> -r--r--r--   1 bin        bin        2456780 May  2  2001 /lib/libc.a
> lrwxr-xr-x   1 root       sys             15 Jun 10  1996 /lib/libc.sl
> -> /usr/l
> ib/libc.1
> -r-xr-xr-x   1 bin        bin        1867776 May  2  2001
> /usr/lib/libc.1
> -r--r--r--   1 bin        bin        2456780 May  2  2001
> /usr/lib/libc.a
> lrwxr-xr-x   1 root       sys             15 Jun 10  1996
> /usr/lib/libc.sl -> /u
> sr/lib/libc.1
> Configure command: ./configure  --prefix=/usr/local/mysql
> '--with-comment=Offici
> al MySQL binary' --with-extra-charsets=complex --with-server-suffix=
> --with-pthr
> ead --with-named-thread-libs=-ldce --with-lib-ccflags=-fpic
> --disable-shared
> Perl: This is perl, version 4.0
> ________________________________________
> Please help me with some instructions how to get mysql work om my
> computer!
> Yours,
> Hans-Jörg Puch
> 



---------------------------------------------------------------------
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