[PD-dev] libraries that crash in a double-precision runtime

IOhannes m zmölnig zmoelnig at iem.at
Mon Mar 2 11:51:44 CET 2020


On 3/2/20 10:43 AM, IOhannes m zmölnig wrote:
> On 3/1/20 10:51 PM, IOhannes m zmölnig wrote:
>> On 2/26/20 2:28 PM, IOhannes m zmoelnig wrote:
>>> class_new() *might* return a NULL-pointer (and it will, if the precision
>>> doesn't match), so you have to check for that before you access any
>>> class members.
>>>
>>
> 
> TL;DR there was a bug in Pd that created a few false positives in my
> original list.

since all flext externals are crashing, i thought i had a look at those
specifically.
it turns out, that flext has it's own use for NULL-classes, as it
internally uses them to create a persistent (and invisible) "flext
buffer helper" object.

with mismatched float-sizes, this results in calling `pd_new(NULL)` -
something that never happens in the ordinary flow, where pd_new() only
gets called in the newmethod of an objectclass. Pd itself doesn't call
the newmethod of objectclasses with mismatched float-size, so this is
usually not a problem.

however, it's easy enough to fix. pd_new() already does a NULL-ptr
check, but only prints an error and happily proceeds to access it's
members, leading to the inevitable crash.
doing an early exit in this case, reduces the list of crashing externals
to the following eleven (11) packages:
- creb
- cyclone
- hcs
- moonlib
- nilwind
- ossia
- pddp
- pdlua
- pof
- unauthorized
- Gem (crash fixed upstream, but no release yet)
- py (this is a false-positive, as it also crashes if the float-sizes do
match)
- context (the crash is triggered by the embedded cyclone)

even though, we can fix pd_new() to accept NULL-classes, flext should
probably handle this explicitly and not attempt to create the "flext
buffer helper" object if the class-pointer is invalid.

gfadsmr
IOhannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20200302/bbd3e726/attachment-0001.sig>


More information about the Pd-dev mailing list