Public bug reported:

libfftw3-dev:
  Installed: (none)
  Candidate: 3.3.8-2ubuntu8
  Version table:
     3.3.8-2ubuntu8 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

program to reproduce bug on Ubuntu 20.04 or 22.04 follows below

expected: success (no assert) because the input was preserved
observed: assert because the input was not preserved


```test_fftw_preserve.cc 
#include <fftw3.h>
#include <vector>
#include <complex>
#include "assert.h"

int main()
{
    typedef std::complex<float> cpx;
    int nfft = 125;
    fftwf_plan plan = fftwf_plan_many_dft(1,&nfft,1,
            NULL, NULL,1,nfft,
            NULL, NULL,1,nfft,
            FFTW_FORWARD,
            FFTW_ESTIMATE|FFTW_PRESERVE_INPUT|FFTW_UNALIGNED);

    std::vector<cpx> in(nfft,cpx(1,2));
    std::vector<cpx> in_copied(in);
    std::vector<cpx> out(nfft);
    fftwf_execute_dft(plan, 
reinterpret_cast<fftwf_complex*>(in.data()),reinterpret_cast<fftwf_complex*>(out.data()));

    assert(in == in_copied);

    fftwf_destroy_plan(plan);
    return 0;
}
```

To run:
```
$ g++ test_fftw_preserve.cc -lfftw3f && ./a.out
a.out: test_fftw_preserve.cc:21: int main(): Assertion `in == in_copied' failed.
Aborted (core dumped)
```

** Affects: fftw3 (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "reproduction example"
   
https://bugs.launchpad.net/bugs/1978640/+attachment/5597250/+files/test_fftw_preserve.cc

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to fftw3 in Ubuntu.
https://bugs.launchpad.net/bugs/1978640

Title:
  FFTW_PRESERVE_INPUT does not always preserve input

Status in fftw3 package in Ubuntu:
  New

Bug description:
  libfftw3-dev:
    Installed: (none)
    Candidate: 3.3.8-2ubuntu8
    Version table:
       3.3.8-2ubuntu8 500
          500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

  program to reproduce bug on Ubuntu 20.04 or 22.04 follows below

  expected: success (no assert) because the input was preserved
  observed: assert because the input was not preserved

  
  ```test_fftw_preserve.cc 
  #include <fftw3.h>
  #include <vector>
  #include <complex>
  #include "assert.h"

  int main()
  {
      typedef std::complex<float> cpx;
      int nfft = 125;
      fftwf_plan plan = fftwf_plan_many_dft(1,&nfft,1,
              NULL, NULL,1,nfft,
              NULL, NULL,1,nfft,
              FFTW_FORWARD,
              FFTW_ESTIMATE|FFTW_PRESERVE_INPUT|FFTW_UNALIGNED);

      std::vector<cpx> in(nfft,cpx(1,2));
      std::vector<cpx> in_copied(in);
      std::vector<cpx> out(nfft);
      fftwf_execute_dft(plan, 
reinterpret_cast<fftwf_complex*>(in.data()),reinterpret_cast<fftwf_complex*>(out.data()));

      assert(in == in_copied);

      fftwf_destroy_plan(plan);
      return 0;
  }
  ```

  To run:
  ```
  $ g++ test_fftw_preserve.cc -lfftw3f && ./a.out
  a.out: test_fftw_preserve.cc:21: int main(): Assertion `in == in_copied' 
failed.
  Aborted (core dumped)
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fftw3/+bug/1978640/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to