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

example crashes o n windows (vs22) in debug builds #55

Open
dbadb opened this issue Jul 4, 2024 · 3 comments
Open

example crashes o n windows (vs22) in debug builds #55

dbadb opened this issue Jul 4, 2024 · 3 comments

Comments

@dbadb
Copy link

dbadb commented Jul 4, 2024

dspOpsExample.cpp crashes on windows (vs22) in debug builds because of its built-in boundary checking.

The issue seems to be related to default constructed delay lines that never get setMaxDelay called. This occurs, for example, in the FDN<4> instantiation. I believe the same is true for FeedbackDelayFunction.

While we're at it

  • this line doesn't compile since mCoeffs isn't a member, but _coeffs is

lp1.mCoeffs = Lopass::coeffs(0.25, 1.0);

  • more obscurely, the example doesn't compile with the win32 + clang compiler. I haven't dug into the details for that.
@dbadb
Copy link
Author

dbadb commented Jul 4, 2024

I made a few tiny changes you can inspect here:

https://github.com/cannerycoders/madronalib

happy to issue a pull request if you like.

@madronalabs
Copy link
Owner

Hi and thanks for the note. Zooming out, what I should really do is see what code is useful in examples and move it to tests. I have not compiled them for a while and this is the kind of thing that is bound to happen if they are not tested.

About the buffer bounds checking, I'm not going to merge these changes, the reason being stated in the code: "// for efficiency, no bounds checking is done." The idea here is that by using the API there is no way to get the object into a state where a read or write out of bounds is possible. I'll look at the FDN initialization and elsewhere and and see what's happening there.

@dbadb
Copy link
Author

dbadb commented Jul 6, 2024

no problem. At the bottom, the only real issue may be an API issue wherein templated construction of objects like FDN may need to trigger invocation of analogs of setMaxDelay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants