houseabsolute / Params-Validate

Validate method/function parameters
https://metacpan.org/release/Params-Validate/
Other
7 stars 14 forks source link

Strange XS return value #22

Open autarch opened 3 years ago

autarch commented 3 years ago

Migrated from rt.cpan.org #106709 (status was 'stalled')

Requestors:

Attachments:

From david.imbs@open-groupe.com on 2015-08-28 14:29:29 :

Hello ,

I work with Params ::Validate quite a lot, and got recently a strange behavior with one callback checking.

Somewhere on my program, I call validate with a callback check who can call thousands line of code, and use a lot of library.

In 99% of case, all work fine. But there is a very much particular (I can reproduce) which lead validate returning undef without failing. In that case, the callback do return 1.

Plus, when I call Data::Dumper on $_[1] inside that callback, it is recalled just after it ends infinitely.

So I wonder, do validate is a safely reentrant method ? Or is that something else I do wrong ?

I’m sorry I can’t put some code here, for some obvious reason. Here is some information about the system :

Perl version 5.16.3

Some module used :

Note : that using the PP implementation works fine.

David IMBS

Réalisteur

Tél : 02.99.12.54.06 - 02.99.12.71.71

Fax : 02.99.12.71.72

12 L Rue du Patis Tatelin – 35700 RENNES

mailto:david.imbs@open-groupe.com david.imbs@open-groupe.com

Description : cid:image002.gif@01CFCB5E.584F7380

autarch commented 3 years ago

From drolsky@cpan.org (@autarch) on 2015-08-28 15:03:21 :

On Fri Aug 28 10:29:29 2015, david.imbs@open-groupe.com wrote:

Hello ,

I work with Params ::Validate quite a lot, and got recently a strange behavior with one callback checking.

Somewhere on my program, I call validate with a callback check who can call thousands line of code, and use a lot of library.

In 99% of case, all work fine. But there is a very much particular (I can reproduce) which lead validate returning undef without failing. In that case, the callback do return 1.

Plus, when I call Data::Dumper on $_[1] inside that callback, it is recalled just after it ends infinitely.

So I wonder, do validate is a safely reentrant method ? Or is that something else I do wrong ?

I just a wrote a simple test for re-entrancy and it worked. That said, you may be exposing a more complex corner case that doesn't.

I don't know that I can fix this without a reproduction recipe.