develooper Front page | perl.perl5.porters | Postings from October 2012

[rt.cpan.org #80415] hash order dependency bugs in CGI tests and code

Thread Previous
From:
Yves via RT
Date:
October 26, 2012 01:40
Subject:
[rt.cpan.org #80415] hash order dependency bugs in CGI tests and code
Message ID:
rt-3.8.HEAD-21642-1351240819-508.80415-17-0@rt.cpan.org
<URL: https://rt.cpan.org/Ticket/Display.html?id=80415 >

I have been working on making it possible to add new hash algorithms to 
perl core and on making the hash seed random per process for security 
reasons. 

In my work on this I have encountered some hash order dependency bugs in 
the tests for CGI involving tags with more than one attribute. Making 
tag order optionally deterministic and then using the option in the 
tests solved the problem. The attached patch contains this fix. I left 
the new behavior undocumented as currently it exists only to make the 
tests happy.

There was a similar bug related to the positioning of the following 
code:

#### Method: endform
# This method is DEPRECATED
*endform = \&end_form; # deprecated!

This was being executed before any subs were generated. Changing hash 
order would somehow cause subs to be loaded in an order such that this 
would not do the right thing and would fall through to an auto generated 
"end_form" tag. I moved the declaration to be part of the code for 
"end_form" and the bug went away.

It would be really nice if the attached patch or moral equivalent could 
get applied to CGI sometime soon as I would like to merge my hash 
changes to core soon and this is a roadblock.

Thanks,
Yves

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About