]> code.citadel.org Git - citadel.git/commitdiff
* Increase per-thread stack size from 128k to 256k. This fixes the
authorArt Cancro <ajc@citadel.org>
Fri, 21 Jan 2005 20:20:06 +0000 (20:20 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 21 Jan 2005 20:20:06 +0000 (20:20 +0000)
  crashing IMAP service on 64-bit Linux.

citadel/ChangeLog
citadel/sysdep.c

index 3b21ad9dab863b05a63eae95d593e4c0cd5ce798..ce430c59001add54f933c86807edfebfe2a03e72 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 629.9  2005/01/21 20:20:06  ajc
+ * Increase per-thread stack size from 128k to 256k.  This fixes the
+   crashing IMAP service on 64-bit Linux.
+
  Revision 629.8  2005/01/19 20:49:46  ajc
  * Minor fixenbugs after running with Valgrind
 
@@ -6283,4 +6287,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index a208e6531899c1978b75d969f15e165fed911da4..ae7e8279213e7afb3752cd01cf25f3b08b514077 100644 (file)
@@ -494,7 +494,7 @@ void client_write(char *buf, int nbytes)
        int old_buffer_len = 0;
 
        if (CC->redirect_fp != NULL) {
-               fwrite(buf, nbytes, 1, CC->redirect_fp);
+               fwrite(buf, (size_t)nbytes, (size_t)1, CC->redirect_fp);
                return;
        }
 
@@ -758,9 +758,11 @@ void create_worker(void) {
                return;
        }
 
-       /* we seem to need something bigger than FreeBSD's default 64k stack */
-
-       if ((ret = pthread_attr_setstacksize(&attr, 128 * 1024))) {
+       /* Our per-thread stacks need to be bigger than the default size, otherwise
+        * the MIME parser crashes on FreeBSD, and the IMAP service crashes on
+        * 64-bit Linux.
+        */
+       if ((ret = pthread_attr_setstacksize(&attr, 256 * 1024))) {
                lprintf(CTDL_EMERG, "pthread_attr_setstacksize: %s\n", strerror(ret));
                time_to_die = -1;
                pthread_attr_destroy(&attr);