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

setGlobalFloatArray can lead to a crash #433

Closed
eitomurakami opened this issue Mar 1, 2024 · 3 comments
Closed

setGlobalFloatArray can lead to a crash #433

eitomurakami opened this issue Mar 1, 2024 · 3 comments

Comments

@eitomurakami
Copy link
Contributor

Calling setGlobalFloatArray with a large array (1000+ elements) every audio block (~10 ms) can crash ChucK.
Observed in RayTone (Chunity) and Pandora (C++).

@gewang
Copy link
Member

gewang commented Mar 16, 2024

added internal / audio-thread-call friendly global array setters in ffa7f1c

t_CKBOOL set_global_int_array( const std::string & name, t_CKINT arrayValues[], t_CKUINT numValues );
t_CKBOOL set_global_int_array_value( const std::string & name, t_CKUINT index, t_CKINT value );
t_CKBOOL set_global_float_array( const std::string & name, t_CKFLOAT arrayValues[], t_CKUINT numValues );
t_CKBOOL set_global_float_array_value( const std::string & name, t_CKUINT index, t_CKFLOAT value );

@gewang
Copy link
Member

gewang commented Mar 16, 2024

also, added check for globals array access for valid global variable names in ae90d57 (previously accessing an invalid name, or accessing it before the variable is created in the VM leads to a crash)

@gewang
Copy link
Member

gewang commented Mar 17, 2024

both issues (in RayTone and Pandora respectively) appear to be resolved with the above commits

@gewang gewang closed this as completed Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants