Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textfile / text define : reading attempt of non-existing file makes plugin crash #239

Closed
jyg opened this issue Feb 5, 2021 · 12 comments
Closed
Projects

Comments

@jyg
Copy link

jyg commented Feb 5, 2021

  1. when sending a message [read ...( to [textfile] or [text define ...], plugin crashes if the specified file doesn't exist.

  2. tested on linux 18.04-5 LTS with latest reaper 64 and camomille vst3 v1.0.8 beta
    (using PdStalFx plugin to load the patch)

  3. Open the attached patch.
    test_textfile.pd.zip

if you click on the second row of bngs, you load the existing test_textfile.pd into [textfile] and [text define] objects
if you click on the first row, you are trying to load an unexisting file and the plugin crashes
image

@pierreguillot pierreguillot added this to To do in v1.0.8 via automation Feb 5, 2021
@pierreguillot
Copy link
Owner

I can reproduce the bug on Linux (not MacOS and I didn't test on Windows yet). The problem also occurs using Ardour.

@jyg
Copy link
Author

jyg commented Feb 8, 2021

Here is an abstraction to insert before [textfile] / [text define] inlet in order to prevent crash.
image
#239-workaround.pd.zip

@pierreguillot
Copy link
Owner

It seems that this call of error() generates a crash. The only way I managed to fix the problem is to remove this line. I couldn't find the exact cause of the crash so far, I tried to remove all the content of the error() function so the function doesn't do anything but it still crashes. It seems that the address of the function is not valid...

@pierreguillot
Copy link
Owner

Perhaps it gets confused with this function?

@jyg
Copy link
Author

jyg commented Feb 9, 2021

It seems that this call of error() generates a crash.

Yes, and indeed soundfiler_read uses pd_error() instead of error() and doesn't crash.

Perhaps it gets confused with this function?

You mean it should be linked instead with
EXTERN void error(const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2); as defined in m_pd.h ?

@pierreguillot
Copy link
Owner

You mean it should be linked instead with
EXTERN void error(const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2); as defined in m_pd.h ?

Yes, this is my assumption. But for an obscure reason, it links with another function named error()...

@jyg
Copy link
Author

jyg commented Feb 9, 2021

It shoud be related to Juce framework ?
Another potential crasher : g_clone.c that contains an error() call.
Put [clone print 4] in a patch and it generates the error clone: can't clone 'print' because it's not an abstraction . This crashes the plugin.

@pierreguillot
Copy link
Owner

It shoud be related to Juce framework ?

I don't think but I'm not sure. I sent a mail on the pd-dev list to get some help from libpd and linux gurus

Another potential crasher : g_clone.c that contains an error() call.

In fact, all the uses of the error() function cause a crash. And the function is used many times... :(

@pierreguillot
Copy link
Owner

I did a dirty hack but can you confirm that the bug is fixed with these binaries?

@jyg
Copy link
Author

jyg commented Feb 17, 2021

yes it works ! Thanks

@pierreguillot
Copy link
Owner

pierreguillot commented Feb 21, 2021

@jyg I found a good fix. Can you test the Linux artifacts of this commit? Thank you!

@pierreguillot pierreguillot moved this from To do to In progress in v1.0.8 Feb 21, 2021
@jyg
Copy link
Author

jyg commented Feb 22, 2021

I tested camomile.so and camomileFx.so . It works perfectly, doesn't crash anymore. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
v1.0.8
  
Done
Development

No branches or pull requests

2 participants