Re: Apache 1.3.28 SEGFAULTS and doesn't produce a core file

2003-11-29 Thread Blair Zajac
Won't doing something like this work on Linux?

--- src/main/http_main.c.0  2002-09-27 10:40:24.0 -0700
+++ src/main/http_main.c2003-06-26 17:11:35.0 -0700
@@ -123,6 +123,7 @@
 #ifdef HAVE_BSTRING_H
 #include bstring.h   /* for IRIX, FD_SET calls bzero() */
 #endif
+#include sys/prctl.h

 #ifdef MULTITHREAD
 /* special debug stuff -- PCS */
@@ -4261,6 +4262,17 @@
 }
 #endif

+if (strlen(ap_coredump_dir)) {
+if (prctl(PR_SET_DUMPABLE, 1)) {
+ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
+ set dumpable failed - this child will not coredump
+  after software errors);
+   } else {
+ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
+ set dumpable succeeded);
+   }
+}
+
 ap_child_init_modules(pchild, server_conf);

 /* done with the initialization critical section */

There's a similar call to prctl(PR_SET_DUMPABLE, 1) in the http
2.0 tree.

Best,
Blair

-- 
Blair Zajac [EMAIL PROTECTED]
Plots of your system's performance - http://www.orcaware.com/orca/


RE: server/exports.c includes now missing apu_compat.h

2003-09-06 Thread Blair Zajac
 Subject: RE: server/exports.c includes now missing apu_compat.h
 Date: Fri, 5 Sep 2003 19:38:17 +0200
 From: Sander Striker [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 
  From: Blair Zajac [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 05, 2003 7:32 PM
 
  Hello,
 
  Just tried building apr/apr-util and httpd-2.1 from CVS head and got
  the following compile error:
 
 [...]
  If I manually delete 'include apu_compat.h' from exports.c it
  compiles just fine.
 
 Did you run ./buildconf ?

Yes.  I have a shell script that I use to build apr/apr-util and
httpd-2.1.  The script doesn't change and it just broke since the
ap*_comput.h files were removed.

apache_dir_to_use=httpd-2.1

if test -d $apache_dir_to_use; then
set -e

if true; then
# rm -fr apr apr-util
# cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic co apr
# cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic co apr-util

tag=-r APACHE_2_0_BRANCH
if test -d $apache_dir_to_use/CVS; then
cd $apache_dir_to_use
#cvs update -dP $tag
cd ..
else
rm -fr $apache_dir_to_use
cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic co $tag 
$apache_dir_to_use
fi
if test -d h; then
mv h h.$$
rm -fr h.$$ 
fi
mkdir h
cd h
cptree -x CVS ../$apache_dir_to_use . /dev/null
cd srclib/
mkdir apr
#lndir ../../../apr apr
cptree -x CVS ../../apr apr /dev/null
mkdir apr-util
#lndir ../../../apr-util apr-util
cptree -x CVS ../../apr-util apr-util /dev/null

cd ..
./buildconf 21 | tee xxa
fi

  Should httpd 2.1 compile and link against APR 1.0 branch or CVS HEAD
  now, as include/apr_compat.h, and include/apu_compat.h were removed
  from HEAD.
 
 HEAD.  There is no 1.0 branch, only a 0.9 branch.

Right, 0.9.  The apr_compat.h was removed in HEAD.

Best,
Blair

-- 
Blair Zajac [EMAIL PROTECTED]
Plots of your system's performance - http://www.orcaware.com/orca/


ssl_engine_init.c compile warning

2003-03-05 Thread Blair Zajac
On APACHE_2_0_BRANCH, I'm seeing this compiler warning on RedHat 8.0.94 using
gcc 3.2.2 with openssl-0.9.7-6:

/bin/sh /export/home1/blair/Code/Apache/2.0/h/srclib/apr/libtool --silent --mode
=compile gcc  -pthread  -g -O2 -I/usr/kerberos/include -Wl,-rpath,/opt/i386-linu
x/db-4.1/lib  -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_S
OURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER   -I/export/home1/blair/Cod
e/Apache/2.0/h/srclib/apr/include -I/export/home1/blair/Code/Apache/2.0/h/srclib
/apr-util/include -I/opt/i386-linux/db-4.1/include -I. -I/export/home1/blair/Cod
e/Apache/2.0/h/os/unix -I/export/home1/blair/Code/Apache/2.0/h/server/mpm/prefor
k -I/export/home1/blair/Code/Apache/2.0/h/modules/http -I/export/home1/blair/Cod
e/Apache/2.0/h/modules/filters -I/export/home1/blair/Code/Apache/2.0/h/modules/p
roxy -I/export/home1/blair/Code/Apache/2.0/h/include -I/usr/include/openssl -I/e
xport/home1/blair/Code/Apache/2.0/h/modules/dav/main -prefer-pic -c ssl_engine_i
nit.c  touch ssl_engine_init.slo
ssl_engine_init.c: In function `ssl_init_ctx_callbacks':
ssl_engine_init.c:512: warning: assignment from incompatible pointer type

Best,
Blair

-- 
Blair Zajac [EMAIL PROTECTED]
Plots of your system's performance - http://www.orcaware.com/orca/


server/config.c typo, missing )

2003-01-14 Thread Blair Zajac
There's a typo in server/config.c at line 1285 in the APACHE_2_0_BRANCH
branch, a missing )

--- config.c14 Jan 2003 16:54:36 -  1.156.2.2
+++ config.c14 Jan 2003 18:06:57 -
@@ -1282,7 +1282,7 @@
 APR_FILEPATH_TRUENAME, p);
 if (newpath  (rv == APR_SUCCESS || APR_STATUS_IS_EPATHWILD(rv)
   || APR_STATUS_IS_ENOENT(rv)
-  || APR_STATUS_IS_ENOTDIR(rv)) {
+  || APR_STATUS_IS_ENOTDIR(rv))) {
 return newpath;
 }
 else {

Otherwise, this compile error results:

config.c: In function `ap_server_root_relative':
config.c:1285: parse error before '{' token

Best,
Blair

-- 
Blair Zajac [EMAIL PROTECTED]
Plots of your system's performance - http://www.orcaware.com/orca/



SSL core dump with httpd-2.0 HEAD

2002-12-22 Thread Blair Zajac
I'm getting a core dump on apr/apr-util/httpd-2.0 from HEAD today
with ssl

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8192 (LWP 6694)]
0x4013d6f7 in apr_bucket_alloc (size=48, list=0x805cb9c)
at apr_buckets_alloc.c:127
127 list-freelist = node-next;


(gdb) bt
#0  0x4013d6f7 in apr_bucket_alloc (size=48, list=0x805cb9c)
at apr_buckets_alloc.c:127
#1  0x4013bfba in apr_bucket_transient_create (
buf=0xe905 Address 0xe905 out of bounds, length=3909091333,
list=0x30) at apr_buckets_simple.c:151
#2  0x4031a537 in bio_filter_out_flush (bio=0xe905) at ssl_engine_io.c:174
#3  0x4031a77f in bio_filter_out_ctrl (bio=0x805cb9c, cmd=-385875963,
num=-2816, ptr=0x0) at ssl_engine_io.c:297
#4  0x400bb4e2 in BIO_ctrl () from /lib/libcrypto.so.2
#5  0x400be5aa in buffer_ctrl () from /lib/libcrypto.so.2
#6  0x400bb4e2 in BIO_ctrl () from /lib/libcrypto.so.2
#7  0x40040a0d in ssl3_accept () from /lib/libssl.so.2
#8  0x4004f82a in SSL_accept () from /lib/libssl.so.2
#9  0x4004b72d in ssl23_get_client_hello () from /lib/libssl.so.2
#10 0x4004b632 in ssl23_accept () from /lib/libssl.so.2
#11 0x4004f82a in SSL_accept () from /lib/libssl.so.2
#12 0x4031b56d in ssl_io_filter_connect (filter_ctx=0x8125e10)
at ssl_engine_io.c:1053
#13 0x4031b957 in ssl_io_filter_input (f=0x81368d8, bb=0x8127ca8,
mode=3909091333, block=134597532, readbytes=0) at ssl_engine_io.c:1220
#14 0x080724c1 in ap_get_brigade (next=0x805cb9c, bb=0xe905,
mode=3909091333, block=3909091333, readbytes=-385875963)
at util_filter.c:513
---Type return to continue, or q return to quit---
#15 0x080724c1 in ap_get_brigade (next=0x805cb9c, bb=0xe905,
mode=3909091333, block=3909091333, readbytes=-385875963)
at util_filter.c:513
#16 0x080735f8 in ap_rgetline_core (s=0x8137900, n=8192, read=0xb3ec,
r=0x81378e8, fold=0, bb=0x8127ca8) at protocol.c:255
#17 0x08073c2e in read_request_line (r=0x81378e8, bb=0x8127ca8)
at protocol.c:670
#18 0x0807429a in ap_read_request (conn=0x8137900) at protocol.c:932
#19 0x0805eba8 in ap_process_http_connection (c=0x8125a20) at http_core.c:285
#20 0x0806fee5 in ap_run_process_connection (c=0x8125a20) at connection.c:85
#21 0x08064e68 in child_main (child_num_arg=-385875963) at prefork.c:696
#22 0x08064fc4 in make_child (s=0xe905, slot=0) at prefork.c:790
#23 0x080650e6 in startup_children (number_to_start=1) at prefork.c:808
#24 0x0806590f in ap_mpm_run (_pconf=0x809d4b0, plog=0x80c7558, s=0x809f250)
at prefork.c:1024
#25 0x0806ba7f in main (argc=3, argv=0xb644) at main.c:651
#26 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6

This apache has mod_dav_svn linked into it, but the page being requested
is the sites home page.

Best,
Blair

-- 
Blair Zajac [EMAIL PROTECTED]
Plots of your system's performance - http://www.orcaware.com/orca/



Re: Runaway SSL httpd server processes

2002-04-07 Thread Blair Zajac

Doug MacEachern wrote:
 
 i haven't been able to reproduce this, but the patch below (also in
 cvs) may fix.  seeing that ssl_io_hook_read sets rc = 0 if SSL_read
 returns -1 and SSL_get_error is SSL_ERROR_WANT_READ.  ssl_io_input_read
 was *always* returning APR_SUCCESS if it got 0 bytes.  now it only does so
 if SSL_ERROR_WANT_READ was the reason, otherwise returns APR_EOF.
 
 Index: modules/ssl/ssl_engine_io.c
 ===
 RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_io.c,v
 retrieving revision 1.72
 diff -u -r1.72 ssl_engine_io.c
 --- modules/ssl/ssl_engine_io.c 5 Apr 2002 07:31:44 -   1.72
 +++ modules/ssl/ssl_engine_io.c 7 Apr 2002 06:25:36 -
 @@ -485,7 +485,7 @@
 
  rc = SSL_read(ssl, buf, len);
 
 -if (rc  0) {
 +if (rc = 0) {
  int ssl_err = SSL_get_error(ssl, rc);
 
  if (ssl_err == SSL_ERROR_WANT_READ) {
 @@ -673,6 +673,10 @@
  if (ctx-inbio.mode == AP_MODE_SPECULATIVE) {
  char_buffer_write(ctx-cbuf, buf, rc);
  }
 +}
 +else if ((rc == 0)  (errno != EINTR)) {
 +/* something other than SSL_ERROR_WANT_READ */
 +return APR_EOF;
  }
  else if ((rc == -1)  (ctx-inbio.rc == APR_SUCCESS)) {
  /*

Doug,

Thanks.  This patch did the trick.  I'm not seeing any runaway processes
processes any more.

Best,
Blair

-- 
Blair Zajac [EMAIL PROTECTED]
Web and OS performance plots - http://www.orcaware.com/orca/