Re: Bug in CellRenderText?

On Wednesday, July 30, 2003, at 09:15  AM, Ross McFarland wrote:

Matthias Bläsing said:
NULL pointer made it into gperl_new_boxed at ./ line 209.

verified that this is true and that it's not his fault. there's a croak around
line 295 of GBoxed.xs.

this is the type system messing with us again.

basically, both gperl_new_boxed and gperl_new_object object very strongly to having NULL passed into them in order to catch places where we need to allow NULL explicitly with the _ornull variants. in general it is NOT correct to allow NULL/undef for various object types, hence this strict checking.

of course, in the real world things are not so nice. get_property and set_property do not offer metadata about whether NULL is a valid value.

so, we will indeed have to turn off the croaks on these functions in the stable code... but the warnings need to stay behind an ifdef so we can spot stuff in development. however, don't put them behind NOISY --- use something like STRICT_NULL. NOISY turns on *tons* of debugging prints that will swamp out the one or two messages about NULL pointers getting into the wrapper functions. at one point, i even wrote a log analyzer that parses the output of the NOISY messages and checks for memory leaks, out-of-order destruction, etc.

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