# automated checking of zend_parse_parameters()

- Thread: https://externals.io/message/25541
- Original archive: https://news-web.php.net/php.internals/25541
- Started by Nuno Lopes on 2006-09-06T16:59:02+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #25541 — Nuno Lopes — 2006-09-06T16:59:02+00:00

URL: https://externals.io/message/25541#25541

Hello,

I've made a somewhat simple script that is capable of running a few 
diagnostic tests on zend_parse_parameters() usage. This tests include 
reports from possible segfaults to possible optimizations.

The script still needs a lot of tweaking, but is already capable of spotting 
some real bugs (but the number of false positives is a little high).
The line number reporting isn't working very well, too, but even so I would 
recomend extensions' authors to take a look at the reports.


Output for PHP 5.2, 6.0 and PECL:
http://mega.ist.utl.pt/~ncpl/php5.2_zend_parse_parameters_diagnostics.txt
http://mega.ist.utl.pt/~ncpl/php6_zend_parse_parameters_diagnostics.txt
http://mega.ist.utl.pt/~ncpl/pecl_zend_parse_parameters_diagnostics.txt


The source of the script is also available at:
http://mega.ist.utl.pt/~ncpl/check_parameters.php
(not recomended for non regex fans :P)


Any comments, feedback, flames, etc.. are welcome :)

Nuno

---

## #25543 — Andrei Zmievski — 2006-09-06T17:06:54+00:00

URL: https://externals.io/message/25541#25543 · In reply to: #25541

Excellent. Can you check that into CVS? Maybe in scripts/ ?

-Andrei



> Hello,
>
> I've made a somewhat simple script that is capable of running a few  
> diagnostic tests on zend_parse_parameters() usage. This tests include  
> reports from possible segfaults to possible optimizations.
>
> The script still needs a lot of tweaking, but is already capable of  
> spotting some real bugs (but the number of false positives is a little  
> high).
> The line number reporting isn't working very well, too, but even so I  
> would recomend extensions' authors to take a look at the reports.
>
>
> Output for PHP 5.2, 6.0 and PECL:
> http://mega.ist.utl.pt/~ncpl/ 
> php5.2_zend_parse_parameters_diagnostics.txt
> http://mega.ist.utl.pt/~ncpl/php6_zend_parse_parameters_diagnostics.txt
> http://mega.ist.utl.pt/~ncpl/pecl_zend_parse_parameters_diagnostics.txt
>
>
> The source of the script is also available at:
> http://mega.ist.utl.pt/~ncpl/check_parameters.php
> (not recomended for non regex fans :P)
>
>
> Any comments, feedback, flames, etc.. are welcome :)
>
> Nuno
> -- 
> PECL development discussion Mailing List (http://pecl.php.net/)

---

## #25544 — Nuno Lopes — 2006-09-06T17:11:12+00:00

URL: https://externals.io/message/25541#25544 · In reply to: #25543

I was thinking in integrating it in http://gcov.php.net, as soon as the new 
website is ready and on-line, but I can put this text-only version in that 
dir (or maybe in scripts/dev).

Nuno


----- Original Message ----- 
> Excellent. Can you check that into CVS? Maybe in scripts/ ?
>
> -Andrei
>
> 
>
> > […]

---

## #25545 — Pedram Nimreezi — 2006-09-06T17:11:48+00:00

URL: https://externals.io/message/25541#25545 · In reply to: #25541

thats seksi nice work ;-)


> Hello,
>
> I've made a somewhat simple script that is capable of running a few
> diagnostic tests on zend_parse_parameters() usage. This tests include
> reports from possible segfaults to possible optimizations.
>
> The script still needs a lot of tweaking, but is already capable of spotting
> some real bugs (but the number of false positives is a little high).
> The line number reporting isn't working very well, too, but even so I would
> recomend extensions' authors to take a look at the reports.
>
>
> Output for PHP 5.2, 6.0 and PECL:
> http://mega.ist.utl.pt/~ncpl/php5.2_zend_parse_parameters_diagnostics.txt
> http://mega.ist.utl.pt/~ncpl/php6_zend_parse_parameters_diagnostics.txt
> http://mega.ist.utl.pt/~ncpl/pecl_zend_parse_parameters_diagnostics.txt
>
>
> The source of the script is also available at:
> http://mega.ist.utl.pt/~ncpl/check_parameters.php
> (not recomended for non regex fans :P)
>
>
> Any comments, feedback, flames, etc.. are welcome :)
>
> Nuno
>
> --
> PECL development discussion Mailing List (http://pecl.php.net/)
> 
>
>


-- 
~
Pedram Nimreezi -- President/Senior Engineer
Major Computing, Inc
--

Not by age, but by knowledge is wisdom acquired.

---

## #25579 — phpxcache — 2006-09-08T01:15:33+00:00

URL: https://externals.io/message/25541#25579 · In reply to: #25541

geat job. it's much faster than valgrind. and can find 64bit/be etc problems.
it's something a must have like gcc printf format attribute.

u may have already notice: the line number is wrong sometimes.

---

## #25581 — Nuno Lopes — 2006-09-08T16:43:40+00:00

URL: https://externals.io/message/25541#25581 · In reply to: #25579

> geat job. it's much faster than valgrind. and can find 64bit/be etc 
> problems.
> it's something a must have like gcc printf format attribute.

thanks :) its job is really find bugs proactively, like the usual 64-bits 
(int vs long) bugs.
Ideally it should be performed by a real C parser, but that's way too much 
work :)

> u may have already notice: the line number is wrong sometimes.

I've fixed this problem (although I haven't updated the on-line files yet). 
I've commited the last version of the script to both php 5.2 and 6 branches.

Nuno
