ericlyon / pd-lyonpotpourri

Pd version of LyonPotpourri 3.0.
Other
19 stars 5 forks source link

issues caught by Purr Data CI #1

Closed jonwwilkes closed 3 years ago

jonwwilkes commented 4 years ago

Hi Eric,

Here are all the issues caught by the Purr Data CI which now covers all dsp_add and perfroutines:

ericlyon commented 4 years ago

Thanks, Jon.

I'll propagate these back to the active github distros.

Eric

On Thu, Sep 26, 2019 at 9:41 AM jonwwilkes notifications@github.com wrote:

Hi Eric,

Here are all the issues caught by the Purr Data CI which now covers all dsp_add and perfroutines:

  • inside all your dsp_add calls explicitly cast sp[0]->s_n-- which is of type int-- to (t_int). Otherwise you hit undefined behavior because varargs does not automatically promote int. (Note: you can still cast to int inside the perfroutine when dereferencing the pointer.)
  • in bashfestnew set x->wavename to &s if there were no args provided. Otherwise it will crash when dsp is turned on.
  • same crasher for buffet_new
  • in rotapan_new check if rchans is less than 1 and if so set it to 1. Otherwise you hit a divide-by-zero exception in your dsp routine with % binop
  • inside magfreq_analysis~ it looks like the power_of_two routine lets zero pass and consequently causes a segfault

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ericlyon/lyonpotpourri3.0/issues/1?email_source=notifications&email_token=AATHYOMWOA7QWGXWYVDN7XLQLS3XNA5CNFSM4I22FNN2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HN4P6FQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AATHYOPPN5MYS4WWPFYH5KLQLS3XNANCNFSM4I22FNNQ .

ericlyon commented 3 years ago

I think these are all now fixed. The poorly named function power_of_two() is a test that returns 1 if the input is a power of 2, and zero otherwise. This should not cause crashes.

Eric