Return-Path: Received: from smtp-out.tiscali.be (spoolm2.tiscalinet.be [212.35.2.51]) by dsl2.external.hp.com (Postfix) with ESMTP id A37BB482A for ; Fri, 14 Feb 2003 02:57:17 -0700 (MST) Date: Fri, 14 Feb 2003 10:57:15 +0100 Message-ID: <3E484410000014A0@ocpmta7.freegates.net> From: "Joel Soete" To: parisc-linux@parisc-linux.org Cc: "Bad Max" , "Randolph Chung" , "John David Anglin" , "Carlos O'Donell" MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Subject: [parisc-linux] glibc mallopt() pb with squid [was: Squid freeze] Sender: parisc-linux-admin@lists.parisc-linux.org Errors-To: parisc-linux-admin@lists.parisc-linux.org List-Help: List-Post: List-Subscribe: , List-Id: parisc-linux developers list List-Unsubscribe: , List-Archive: Hi all, I come back to you with squid problem and glibc-2.3. For recall, "Bax Max" asks help concerning squid hanging. As in first reading, the Max's problem sounds similar to the one I encountered before it works on my hppa testing (sarge) Debian, I suggest him to verify some details (specially ulimits). Well, it did not help. Curious, I so installed squid testing dpkg on an unstable Debian and effectively it hang (very earlier because even simply query version do not work)? Then I grab sources and try first to recompile the package with gcc-3.2 and glibc-2.3.1-11 without optimisation (in mind the problem encountered in kernel build): didn't help. I ran so ddd to have a rough idea of the locking point; it appeared that squid hangs at the first mallopt() in the following code: [snip] int main(int argc, char **argv) { int errcount = 0; int n; /* # of GC'd objects */ time_t loop_delay; mode_t oldmask; #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) int WIN32_init_err; #endif debug_log = stderr; if (FD_SETSIZE < Squid_MaxFD) Squid_MaxFD = FD_SETSIZE; #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) if ((WIN32_init_err = WIN32_Subsystem_Init())) return WIN32_init_err; #endif /* call mallopt() before anything else */ #ifdef HAVE_MALLOPT #ifdef M_GRAIN /* Round up all sizes to a multiple of this */ mallopt(M_GRAIN, 16); #include #include #include /* getpid(), geteuid() */ #include #include /* setgroups() */ #include /* mkdir() */ #include #define MAXPATHLEN 256 /* waitpid() */ #include /* mallopt() */ #include #define SQUID_MAXFD 4096 /* autoconf.h */ /* Define if you have the mallopt function. */ #define HAVE_MALLOPT 1 /* dlmalloc.c */ #define M_GRAIN 3 /* UNUSED in this malloc */ #define M_MXFAST 1 /* UNUSED in this malloc */ int Squid_MaxFD; /* SQUID_MAXFD */ FILE *debug_log = NULL; int main(int argc, char **argv) { int errcount = 0; debug_log = stderr; if (FD_SETSIZE < Squid_MaxFD) Squid_MaxFD = FD_SETSIZE; fprintf(stderr, "nb_err: %d\n", errcount); /* call mallopt() before anything else */ #ifdef HAVE_MALLOPT fprintf(stderr, " HAVE_MALLOPT \n"); #ifdef M_GRAIN /* Round up all sizes to a multiple of this */ fprintf(stderr, " M_GRAIN set: %d\n", M_GRAIN); mallopt(M_GRAIN, 16); #endif #ifdef M_MXFAST /* biggest size that is considered a small block */ fprintf(stderr, " M_MXFAST set: %d\n", M_MXFAST); mallopt(M_MXFAST, 256); #endif #ifdef M_NBLKS /* allocate this many small blocks at once */ fprintf(stderr, " M_NBLKS set: %d\n", M_NBLKS); mallopt(M_NLBLKS, 32); #endif #endif /* HAVE_MALLOPT */ return 0; } which I compile as near as possible as the original code: gcc -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/etc/squid.conf\" -I. -I. -I../include -I. -I. -I../include -I../include -g -Wall -D_REENTRANT -c foo.c gcc -g -Wall -D_REENTRANT -g -o tst foo.o Unforunately, tst run fine. I finally check the precompile text of the original main.c sources in which I just encountered: 1) # 187 "/usr/include/malloc.h" 3 extern int mallopt (int __param, int __val) 2) [snip] mallopt(3.16); mallopt(1,256); ... Why so squid hang on this mallopt() and not tst? Is some gcc, libc gurus (Carlos, Dave, Randolph?) could help us more to understand this pb (squid bug or gcc - glibc bug?) Thanks in advance, Joel PS: I try to find more details in the pre-assemble (-S) test of the original sources but I not yet able to read this kind of stuff and understand what is done, sorry? --------------------------------- Vous surfez avec une ligne classique ? Faites des economies avec Tiscali Complete ... Plus d'info sur http://complete.tiscali.be