reassing 344481 apache,php4,rrdtool,libc6
submitter 344481 !
tags -confirmed,help
thanks

Hello,
After some upgrades apache and php4 in Sep 2005 some users (and I) have noticed 
that apache is crashing when the function from php4-rrdtool extension
is called. This function is rrd_graph. More investigation and I can tell
that this is not php4-rrdtool's fault.

Backtrace from apache -X says:
#0  0xb7d3c413 in strlen () from /usr/lib/debug/libc.so.6
#1  0xb79f767b in parsetime () from /usr/lib/librrd.so.2
#2  0xb7a058ea in rrd_graph_options () from /usr/lib/librrd.so.2
#3  0xb7a05fda in rrd_graph () from /usr/lib/librrd.so.2
#4  0xb7c9b64b in zif_rrd_graph () from /usr/lib/php4/20050606/rrdtool.so
#5  0xb77fae82 in execute () from /usr/lib/apache/1.3/libphp4.so
#6  0xb77e17f5 in zend_execute_scripts () from
#/usr/lib/apache/1.3/libphp4.so
#7  0xb77b289d in php_execute_script () from /usr/lib/apache/1.3/libphp4.so
[the rest is not interesting for us]

What happens inside during the runtime?
Let's focus on frame #2.
The rrd_graph_options() gets a string with parameters. The begin if this
string is (at least in my case, but this is common value in rrdtools):
--start -2d
The rrd_graph_options calls getopt_long to split parameters into tokens.
You can see the code in rrdtool's sources, file rrd_graph.c, line 2965.
getopt_long reckognises the --start parameter correctly and, according to
struct option returns opt as s. But, for some strange reasons, it sets
optarg for NULL.
Later (line 3010 in the same file) parsetime is called. The optarg variable
is passed as a parameter and inside parsetime strlen on this pointer
is called. As you remember this pointer has a NULL value and strlen
simply segfaults.

I did some tests and I noticed that the problem appears only under
apache 1.3 with php4 run as a module.

I checked also a combinations:
 - apache 1.3 and php4-cgi - OK
 - apache 2 and php4 as module - OK
 - rrdtool graph call from CLI - OK

The real problem is: why geopt_long sets optarg to NULL? Why this error
occurs only with apache 1.3 and php4 as a module?

Any hints about nature of this bug and about future actions which I should
take welcomed.

Excuse me for putting four packages in this bug. I am really in doubt
where the True Reason (tm) of the bug exists.
If you deem severity of this bug to strong, feel free to adjust it.
Although I believe it _is_ a RC bug because it makes an application
crashing.

Best regards
        Artur
-- 
pieniądze jednak to nie wszystko choć na nich twardo stoi świat
liczy się ktoś, kto jest wciąż blisko nawet gdy forsy brak
                                                    /Golec uOrkiestra/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to