On Sun, 16 Dec 2001, Michael Widenius wrote:
<cut> > As this works on our HP-UX machine, it means that some library that we > are using is not compatible with yours :( > > 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> As I reported in my earlier email on Oct. 29, I get essentially the same > Michael> error as was reported here, namely, setrlimit fails. I configured as you > Michael> recommend, run make, then make test. I get: > > Michael> ======================= > Michael> $make test > Michael> cd mysql-test ; ./mysql-test-run > Michael> Installing Test Databases > Michael> Removing Stale Files > Michael> Installing Master Databases > Michael> 011214 21:50:26 Warning: setrlimit couldn't increase number of open files > Michael> to more than 60 > Michael> 011214 21:50:26 Warning: Changed limits: max_connections: 50 > Michael> table_cache: 64 > Michael> 011214 21:50:26 ../sql/mysqld: Shutdown Complete > > <cut> > Michael> join .... .... .... [ fail ] > > Michael> Aborting. To continue, re-run with '--force'. > Michael> ============================ > > Michael> As you can see, setrlimit fails to increase the allowed number of open > Michael> files, then the join test fails because it wants to open more than 60, the > Michael> default on my system. The ouput quoted here is from 3.23.46 built today, > Michael> but it's the same as I got in October with 3.23.43. > > Thanks; Now I have a much better understanding of this problem. > > On our system I can increase the number of open files to 500, without > any problems. As can I, with largefiles disabled. <cut> > Very strange! > > Could you try to modify your test to do the proper casts and see if > you can find what is going wrong on your system ? > If we can find a test that fails on your system but works on ours, we > would know a lot more about of how to fix this problem. Yes, as it turns out. The problem is in dce. It seems setrlimit is replaced with cma_setrlimit in dce/cma_ux.h. I'll provide the modified rlimtest.c and it's output below, but the short version is that including pthread.h and linking with -ldce causes the problem. Here's the code: /*=====================================*/ #include <sys/resource.h> #include <errno.h> #include <stdio.h> #include <pthread.h> int main() { struct rlimit rl; uint x; printf("Size of rlimit is %ld\n",sizeof(rl)); x = 510; if (!getrlimit(RLIMIT_NOFILE,&rl)) { printf("getrlimit: cur=%ld max=%ld\n", (long)rl.rlim_cur, (long)rl.rlim_max); } rl.rlim_cur = x; rl.rlim_max = x; printf("Changing to: cur=%ld max=%ld\n", (long)rl.rlim_cur, (long)rl.rlim_max); if (setrlimit(RLIMIT_NOFILE,&rl)) { printf("\nERROR: errno=%i\n", errno); } else { printf("\nSUCCESS\n"); } 0; } /*=====================================*/ Here's the output: stassenm@dr ~ $gcc -I/opt/dce/include -ldce rlimtest.c stassenm@dr ~ $./a.out Size of rlimit is 8 getrlimit: cur=60 max=1024 Changing to: cur=510 max=510 SUCCESS That worked, but then I mention largefile: stassenm@dr ~ $gcc -D_FILE64 -I/opt/dce/include -ldce rlimtest.c stassenm@dr ~ $./a.out Size of rlimit is 16 getrlimit: cur=60 max=1024 Changing to: cur=510 max=510 ERROR: errno=22 As you can see, setrlimit (really cma_setrlimit64 in this case) returns an error. Error 22 is EINVAL, which seems to cover most of the possible ways to go wrong. The good news (for you, at least) is that seems pretty clearly an HPUX bug on my machine, unless I'm still missing something, though I'm wondering what's different about mine, since it works on yours. > Regards, > Monty 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