On 2012-06-21 22:22, oh...@cox.net wrote:

[root@apachemodule bin]# gdb httpd
GNU gdb Red Hat Linux (6.3.0.0-1.162.el4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library 
"/lib64/tls/libthread_db.so.1".

(gdb) b header_post_config
Function "header_post_config" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (header_post_config) pending.
(gdb) run -X
Starting program: /apps/httpd2222/bin/httpd -X
[Thread debugging using libthread_db enabled]
[New Thread 182897612000 (LWP 8741)]
Breakpoint 2 at 0x2a97a69060: file mod_headers.c, line 1026.
Pending breakpoint "header_post_config" resolved
mod_headers-jl V0.09 - start calling OAM API
In register_hooks
In create_headers_dir_config
In create_headers_dir_config
In header_cmd
In header_inout_cmd
In parse_format_tag
In parse_misc_string
In create_headers_dir_config
In header_cmd
In header_inout_cmd
In parse_format_tag
In parse_misc_string
[Switching to Thread 182897612000 (LWP 8741)]

Breakpoint 2, header_post_config (pconf=0x573138, plog=0x5a52c8, 
ptemp=0x5a72d8, s=0x59d3a8) at mod_headers.c:1026
1026        printf("In header_post_config\n");
(gdb) s
1025    {
(gdb) s
1026        printf("In header_post_config\n");
(gdb) n
In header_post_config
1027        header_ssl_lookup = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup);
(gdb) n
1029    }
(gdb) n
0x00000000004360c7 in ap_run_post_config (pconf=0x573138, plog=0x5a52c8, 
ptemp=0x5a72d8, s=0x59d3a8) at config.c:91
91      AP_IMPLEMENT_HOOK_RUN_ALL(int, post_config,
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x0000003518d6c1e1 in BN_num_bits () from /lib64/libcrypto.so.4
(gdb)


I have no idea what the above means :(....  But it looks like something blew up 
in libcrypto?

Jim


Navigate the help of gdb (help, help data, help running).

Check the "bt" (backtrace), "up", and "down" commands. From your segfault point in libcrypto you can go "up" the stack until you reach in one of your functions.

When you reached your code after several "ups", do a "print" of the variables (especially pointers that you suspect they are null but shouldn't be null) that could have triggered the error.

S

Reply via email to