[PD-dev] Problem with the error function

Pierre Guillot guillotpierre6 at gmail.com
Tue Feb 9 09:18:15 CET 2021


Hello,

There is a crash on Linux version of Camomile when an attempt to read a
file that doesn't exist with the [textfile] or [text define] objects (
https://github.com/pierreguillot/Camomile/issues/239).

After some investigation, it seems that the call of the error() function
from the binbuf_read_via_canvas() function generates the crash (
https://github.com/pure-data/pure-data/blob/eeef4ba9130d3182146927c37fa57d61bbff0f0b/src/m_binbuf.c#L878)
- if I remove this line, the problem is fixed.

I tried to find the problem with this error() function and I realised that
this Pd error() function might not be used in fact (because if I remove all
the content of this error() function and so it doesn't do anything, the
program still crashes). I can even remove the definition of the function (
https://github.com/pure-data/pure-data/blob/eeef4ba9130d3182146927c37fa57d61bbff0f0b/src/s_print.c#L199-L212),
the plugin still compiles!

So I think that there is confusion and another function is used instead of
the Pd one from s_print.c. t could be this function (
https://man7.org/linux/man-pages/man3/error.3.html) from error.h but I
can't find where this header could be included.

First of all, is my assumption (the confusion between two functions with
the same name) plausible? If so, do you think it could be the one from
error.h? And can I fix this?

If you want to test, I suggest you use the dev/cmake-support branch of
Camomile that is pretty easy and straightforward to compile and the VST3
plugin. Thank you for your assistance!

All the best,
Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20210209/60d65595/attachment.html>


More information about the Pd-dev mailing list