-
Notifications
You must be signed in to change notification settings - Fork 109
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
Resample segmentation fault for rate::AbstractFloat #262
Comments
The DSP.jl/src/Filters/stream_filt.jl Line 635 in 42634c0
Removing it, I get julia> X = resample(y,rate)
ERROR: BoundsError: attempt to access 1920000-element Array{Float64,1} at index [1920001]
Stacktrace:
[1] setindex! at ./array.jl:767 [inlined]
[2] filt!(::Array{Float64,1}, ::FIRFilter{DSP.Filters.FIRArbitrary{Float64}}, ::Array{Float64,1}) at DSP/src/Filters/stream_filt.jl:635
[3] filt(::FIRFilter{DSP.Filters.FIRArbitrary{Float64}}, ::Array{Float64,1}) at DSP/src/Filters/stream_filt.jl:648
[4] resample(::Array{Float64,1}, ::Float64, ::Array{Float64,1}) at DSP/src/Filters/stream_filt.jl:703
[5] resample(::Array{Float64,1}, ::Float64) at DSP/src/Filters/stream_filt.jl:708
[6] top-level scope at none:0 There's two issues here:
|
Thanks for the quick reply and for tracking down the issue to DSP.jl/src/Filters/stream_filt.jl Line 365 in 42634c0
Looks like this has been an issue before since tests were disabled and I do get different results for DSP.jl/src/Filters/stream_filt.jl Line 699 in 42634c0
|
A number of exported functions in stream_filt.jl have @inbounds access to buffers without verifying their lengths. This can cause segfaults, as seen in issue JuliaDSP#262.
* Check buffer lengths in stream filtering functions before access A number of exported functions in stream_filt.jl have @inbounds access to buffers without verifying their lengths. This can cause segfaults, as seen in issue #262. * Fix buffer length checking I can't figure out the buffer length requirement for one function, and removed the `@inbounds` macro until I can. * Update src/Filters/stream_filt.jl Co-Authored-By: galenlynch <[email protected]> * Update src/Filters/stream_filt.jl Co-Authored-By: galenlynch <[email protected]> * Fix estimation of buffer length required
Thanks for addressing the segfault. Will get back if I find the culprit... |
Closing in favour of #317 |
Hello,
I'm getting a segmentation fault for resample when
rate
is a certain float value (example coming from an actual script wheres
andy
are audio signals):by using Rational type, I don't see a segmentation fault:
I tried to look in
resample_filter
DSP.jl/src/Filters/design.jl
Line 606 in 270e6f2
but cannot reproduce manually.
Will be happy to help out if this is not an issue on my side.
Thanks!
Error:
and versioninfo:
and Pkg.status:
The text was updated successfully, but these errors were encountered: