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

Add RB_GC_GUARD to numo_pocketfft_fft to fix crash #4

Merged

Commits on Jan 5, 2021

  1. Add RB_GC_GUARD to numo_pocketfft_fft to fix crash

    In yoshoku#3 I describe a crash I have been experiencing with numo-pocketfft.  When running RSpec tests in the mb-sound project, my FFT tests crash frequently, and occasionally return incorrect results.  These errors only happen at the `-O3` optimization level.  It appears this is due to Ruby's GC freeing either `x_val` or `z_val` before the function has finished, and other data being written in its place.
    
    This fix uses the RB_GC_GUARD macro to make sure that gcc preserves the `x_val` and `z_val` `VALUE`s in stack or registers so that the GC knows they are still in use.
    
    ## Testing
    
    To test the fix I ran `rspec` in a loop in the `fft` branch of the `mb-sound` project, as well as the reproducing script in yoshoku#3.  Before this change, tests would crash frequently.  After this change, tests ran without issue for many iterations.
    mike-bourgeous committed Jan 5, 2021
    Configuration menu
    Copy the full SHA
    c19b54c View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2021

  1. Configuration menu
    Copy the full SHA
    87c2c08 View commit details
    Browse the repository at this point in the history