can you make a real bug report on github please so I can chase this?
1 Like
Here you go:
opened 01:06PM - 07 Feb 25 UTC
bug
### Please tell us what you were doing! You can include code and files by drag a… nd dropping them into the text area.
It seems that `fluid.bufstats~` can insta-crash when it is getting messages from mixed threads, specifically receiving weights in it's right-most inlet in the high-priority thread, while the object is in `@blocking 1` and then also receiving buffers upstream from the high-priority thread.
So I think the steps are:
1. have `fluid.bufstats~ @blocking 1`
2. send weights buffer to right inlet from high-priority thread
3. send buffer into left inlet from high-priority thread
Sometimes this gives an `Invalid weights` error message (as mentioned below) but other times it will just crash, presumably when read/writing from unsafe memory.
This is happening in the patch outlined in this thread:
https://discourse.flucoma.org/t/creating-a-filter-from-spectral-moments-fluid-spectralshape/
Specifically this version of the patch:
https://discourse.flucoma.org/uploads/short-url/nkoDHX3alGOt8e2sudrKHQsmq3J.zip
The offending abstraction is `dk.spectralshapeframe` which has three instances of `fluid.stats~` in it, and only one of which was having it's `@blocking` mode updated automatically (I missed the connection when building the patch).
If you run the patch for any amount of time you will see the error messages, and eventually a crash.
Here's a crash report:
[bufstats crash.zip](https://github.com/user-attachments/files/18706952/bufstats.crash.zip)
### What was the expected result?
Complaining about threading, which it did do as well:
> fluid.bufstats~: Invalid weights
But sometimes it would not complain and instead crash.
### What was the actual result?
An insta-crash.
### What operating system were you using?
Mac
### Operating system version
macOS 15.2
### FluCoMa Version
1.0.8+sha.0a9327e.core.sha.7dfcc220
I think it’s this:
have fluid.bufstats~ @blocking 1
send weights buffer to right inlet from high-priority thread
send buffer into left inlet from high-priority thread
edit:
If you downloaded the updated abstraction two posts up, re-download it as it was still thread unsafe (I missed a @blocking
change cable in the previous edit).