Hello, Following your tips I built Apache with -O0 and the segfaults in "mpm_prefork" no longer happen. Maybe its a gcc optimization issue. I dont know which -O OpenBSD uses by default, but I will try it also with -O1 and report back.
Now that it doesnt crash I fiddled a bit more with http2. # gdb --args httpd2 -X (gdb) run Starting program: /usr/local/sbin/httpd2 -X ... And when I do a "curl -v -http2 http://vhost.with.http2" ... Program received signal SIGABRT, Aborted. [Switching to thread 1016704] 0x000005c7a6ae089a in thrkill () at <stdin>:2 2 <stdin>: No such file or directory. in <stdin> Current language: auto; currently asm (gdb) bt full #0 0x000005c7a6ae089a in thrkill () at <stdin>:2 No locals. #1 0x000005c7a6adbf59 in *_libc_abort () at /usr/src/lib/libc/stdlib/abort.c:52 mask = 4294967263 sa = {__sigaction_u = {__sa_handler = 0x1, __sa_sigaction = 0x1}, sa_mask = 49, sa_flags = 0} #2 0x000005c7e7fa336b in apr_table_copy () from /usr/local/lib/libapr-1.so.5.0 No symbol table info available. #3 0x000005c805c85fa5 in h2_request_create_rec (req=0x5c840c98600, conn=0x5c84dcb5400) at h2_request.c:361 r = (request_rec *) 0x5c76fbf2400 p = (apr_pool_t *) 0x5c84dcb5000 access_status = 200 #4 0x000005c805c9b1cf in h2_task_process_request (req=0x5c840c98600, c=0x5c84dcb5400) at h2_task.c:223 r = (request_rec *) 0x5c804d7bb40 cs = (conn_state_t *) 0x5c7dbcde2e0 #5 0x000005c805c9b4dd in h2_task_process_conn (c=0x5c84dcb5400) at h2_task.c:255 ctx = (h2_ctx *) 0x5c804d7bb40 #6 0x000005c566b71f43 in ap_run_process_connection (c=0x5c84dcb5400) at connection.c:41 pHook = (ap_LINK_process_connection_t *) 0x5c84d082600 n = 0 rv = -1 #7 0x000005c566b7245d in ap_process_connection (c=0x5c84dcb5400, csd=0x5c77f4a4280) at connection.c:213 rc = -2 #8 0x000005c805c9ae43 in h2_task_do (task=0x5c7dbcdee80, worker=0x5c79f7f8880) at h2_task.c:186 status = 0 #9 0x000005c805ca1386 in execute (thread=0x5c82c394800, wctx=0x5c79f7f8880) at h2_worker.c:58 worker = (h2_worker *) 0x5c79f7f8880 status = 0 m = (h2_mplx *) 0x5c84dcb5300 #10 0x000005c845c2c77e in _rthread_start (v=Variable "v" is not available. ) at /usr/src/lib/librthread/rthread.c:145 retval = Variable "retval" is not available. (gdb) Any hints? On Sat, Jan 16, 2016 at 6:16 AM, David CARLIER <devne...@gmail.com> wrote: > Hi, > > all depends on the configuration. Also, what would be possible is to > try to compile apache with debug symbols (-O0) to have better trace of > the bug (the bug might occur line 732 of server/mpm/prefork/prefork.c > but it is just guess). > > Regards. > > On 15 January 2016 at 23:41, Stuart Henderson <st...@openbsd.org> wrote: > > I've disabled mod_http2 from being packaged for now, not sure how > > to debug it further at present. > > > > > > On 2016/01/14 18:58, Pedro de Oliveira wrote: > >> Hi there, > >> > >> Yesterday I was trying to play with the http2 module on Apache from > >> ports, as I saw it was added to the ports file list. The problem is > >> that the module isnt working correctly. > >> > >> If you try it on a http vhost, it simply returns the page via the > >> normal way (http). > >> And if you enable it on a https vhost, the vhost stops working (doesnt > >> serve anything). > >> > >> So I went to https://httpd.apache.org/dev/debugging.html , and saw the > >> instructions on how to debug Apache, and ran httpd2 on gdb with the -X > >> option. > >> > >> After a few requests, httpd2 segfaults, but only when using the > >> "mpm_prefork" module. With "mpm_event" or "mpm_worker" it doesnt > >> crash. > >> > >> # gdb --args httpd2 -X > >> (gdb) run > >> Starting program: /usr/local/sbin/httpd2 -X > >> AH00557: httpd2: apr_sockaddr_info_get() failed for web.my.domain > >> AH00558: httpd2: Could not reliably determine the server's fully > >> qualified domain name, using 127.0.0.1. Set the 'ServerName' directive > >> globally to suppress this message > >> > >> Program received signal SIGSEGV, Segmentation fault. > >> 0x000014a785962a1b in ap_mpm_pod_check () from /usr/local/sbin/httpd2 > >> (gdb) bt > >> #0 0x000014a785962a1b in ap_mpm_pod_check () from > /usr/local/sbin/httpd2 > >> #1 0x000014aa29a81f9e in child_main () > >> from /usr/local/lib/apache2/mod_mpm_prefork.so > >> #2 0x000014aa29a82321 in make_child () > >> from /usr/local/lib/apache2/mod_mpm_prefork.so > >> #3 0x000014aa29a833cf in prefork_run () > >> from /usr/local/lib/apache2/mod_mpm_prefork.so > >> #4 0x000014a785937d12 in ap_run_mpm () from /usr/local/sbin/httpd2 > >> #5 0x000014a7859318b3 in main () from /usr/local/sbin/httpd2 > >> > >> And if you run httpd2 -X and try to access an SSL vhost it also crashes. > >> > >> Program received signal SIGPIPE, Broken pipe. > >> [Switching to thread 1003084] > >> 0x00001ff81dfaf1aa in writev () at <stdin>:2 > >> 2 <stdin>: No such file or directory. > >> in <stdin> > >> Current language: auto; currently asm > >> (gdb) bt > >> #0 0x00001ff81dfaf1aa in writev () at <stdin>:2 > >> #1 0x00001ff7a7eec2ed in writev (fd=19, iov=0x1ff7789a7780, iovcnt=1) > >> at /usr/src/lib/librthread/rthread_cancel.c:621 > >> #2 0x00001ff75d837311 in apr_socket_sendv () from > >> /usr/local/lib/libapr-1.so.5.0 > >> #3 0x00001ff53a44f3b8 in writev_nonblocking () from > /usr/local/sbin/httpd2 > >> #4 0x00001ff53a44f6e3 in send_brigade_nonblocking () from > >> /usr/local/sbin/httpd2 > >> #5 0x00001ff53a44fbc9 in ap_core_output_filter () from > /usr/local/sbin/httpd2 > >> #6 0x00001ff7e916011c in bio_filter_out_pass () from > >> /usr/local/lib/apache2/mod_ssl.so > >> #7 0x00001ff7e9161955 in bio_filter_out_ctrl () from > >> /usr/local/lib/apache2/mod_ssl.so > >> #8 0x00001ff7e9171d42 in modssl_smart_shutdown () from > >> /usr/local/lib/apache2/mod_ssl.so > >> #9 0x00001ff7e916059c in ssl_filter_io_shutdown () from > >> /usr/local/lib/apache2/mod_ssl.so > >> #10 0x00001ff7e9161dcf in ssl_io_filter_output () from > >> /usr/local/lib/apache2/mod_ssl.so > >> #11 0x00001ff7e9162498 in ssl_io_filter_coalesce () from > >> /usr/local/lib/apache2/mod_ssl.so > >> #12 0x00001ff53a45f72a in ap_shutdown_conn () from > /usr/local/sbin/httpd2 > >> #13 0x00001ff53a45f798 in ap_start_lingering_close () from > >> /usr/local/sbin/httpd2 > >> #14 0x00001ff8185d03a4 in worker_thread () from > >> /usr/local/lib/apache2/mod_mpm_event.so > >> #15 0x00001ff7a7ee977e in _rthread_start (v=Variable "v" is not > available. > >> ) at /usr/src/lib/librthread/rthread.c:145 > >> #16 0x00001ff81df9952b in __tfork_thread () at > >> /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:75 > >> #17 0x0000000000000000 in ?? () > >> > >> I dont know if this is expected on OpenBSD or already known, if it is, > >> please ignore this message. > >> > >> This is making debugging Apache to figure out why http2 isnt working > impossible. > >> > >> Regards. > >> > > >