[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

apache is segfaulting under some circumstances



Hello,
I notified, that my apache (1.3.33-8) segfaults since some days.
when I try to generate a PNG image from php4-rrdtool extension.

Backtrace shows nothing interesting:

(gdb) run -X
Starting program: /usr/sbin/apache -X
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 1988)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 1988)]
0xb7ce7453 in strlen () from /usr/lib/debug/libc.so.6
(gdb) bt
#0  0xb7ce7453 in strlen () from /usr/lib/debug/libc.so.6
#1  0xb77c267b in parsetime () from /usr/lib/librrd.so.2
#2  0xb77d087a in rrd_graph_options () from /usr/lib/librrd.so.2
#3  0xb77d0f6a in rrd_graph () from /usr/lib/librrd.so.2
#4  0xb799166b in zif_rrd_graph () from /usr/lib/php4/20050606/rrdtool.so
#5  0xb735da32 in execute () from /usr/lib/apache/1.3/libphp4.so
#6  0xb73444d5 in zend_execute_scripts () from /usr/lib/apache/1.3/libphp4.so
#7  0xb731573d in php_execute_script () from /usr/lib/apache/1.3/libphp4.so
#8  0xb73629ae in apache_php_module_main () from /usr/lib/apache/1.3/libphp4.so
#9  0xb73634c5 in apache_php_module_main () from /usr/lib/apache/1.3/libphp4.so
#10 0xb73637d1 in apache_php_module_main () from /usr/lib/apache/1.3/libphp4.so
#11 0x080549ae in ap_invoke_handler ()
#12 0x0806611b in ap_update_mtime ()
#13 0x08066869 in ap_process_request ()
#14 0x0805e6ca in ap_update_child_status ()
#15 0x0805eacd in ap_update_child_status ()
#16 0x0805ebbe in ap_update_child_status ()
#17 0x0805fa8a in ap_update_child_status ()
#18 0x08060893 in main ()

strlen segfaults because it receives a NULL as a parameter, but the problem
lies somewhere else.

Frame #2, rrd_graph_options() from librrd. This procedure parses given
arguments. It uses getopt_long to parse data. Quote from
src/rrd_graph.c::rrd_graph_options():

    static struct option long_options[] =
      {
        {"start",      required_argument, 0,  's'},
	...
      };

    /* some other code */

    opt = getopt_long(argc, argv,
        "s:e:x:y:v:w:h:iu:l:rb:oc:n:m:t:f:a:I:zgjFYAMEX:L:S:T:NR:B:",
	long_options, &option_index);

I've added code to add to syslog:
 a) whole argv;
 b) opt and (if NULL) optarg.

First, I run rrdtool graph from CLI with a set of parameters:

LC_CTYPE=pl_PL rrdtool graph plik.png --start -2d --x-grid HOUR:1:HOUR:6:HOUR:3:0:%H:%M --vertical-label B/s -h 200 -w 650 --color 'GRID#E0E0E0' --color 'MGRID#A03000' --title 'Obciążenie łącza' DEF:inb=/home/arturcz/rrd/blabluga-eth0.rrd:in:AVERAGE DEF:outb=/home/arturcz/rrd/blabluga-eth0.rrd:out:AVERAGE 'AREA:inb#40E040:Średni ruch przychodzący (5 minut)' 'LINE1:outb#007000:Średni ruch wychodzący (5 minut)'

Then I run a function from php4-rrdtool extension. All parameters (as
shown in syslog) are identical. But this time getopt_long reckognises
--start as -s, but sets optarg to NULL for this option. This error happens
only when I pass the arguments to librrd from php4/apache. Everything works
good for php4/apache2. That's why I suspect apache as a source of the problem.

Have you any insights about nature of this bug?

Regards
	Artur
-- 
windows jest jak Odie - głupi jak but, cały czas się uśmiecha, a linux jak
Garfield - może i by coś zrobił, ale trzeba go najpierw do tego zmusić.
							/yacoob/



Reply to: