Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

BUG: fix segfault in fftpack on OS X >=10.7 when compiling with llvm-gcc... #330

Merged
merged 1 commit into from

2 participants

@rgommers
Owner

....

See ticket 1737. Thanks to Alex Leach for help in debugging this issue.

Tested by Alex to confirm it fixes the segfault, works fine on Ubuntu 12.04 too. Ticket shouldn't be closed yet.

@rgommers rgommers BUG: fix segfault in fftpack on OS X >=10.7 when compiling with llvm-…
…gcc.

See #1737.  Thanks to Alex Leach for help in debugging this issue.
61fbbb6
@rgommers
Owner

Hmm, tabs vs. spaces issue. What do I do here, convert all tabs to 4 spaces?

@rgommers
Owner

In Trac ticket 1496 the same issue was encountered. Added a note there that this PR should fix it.

@pv
Owner
pv commented

Seems like working around compiler bugs. But anyway, the new code is cleaner, so merging would be OK.

@rgommers
Owner

OK, thanks for having a look. Merging.

@rgommers rgommers merged commit bb436fa into scipy:master
@ClemensFMN ClemensFMN referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 3, 2012
  1. @rgommers

    BUG: fix segfault in fftpack on OS X >=10.7 when compiling with llvm-…

    rgommers authored
    …gcc.
    
    See #1737.  Thanks to Alex Leach for help in debugging this issue.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 4 deletions.
  1. +6 −4 scipy/fftpack/src/zfft.c
View
10 scipy/fftpack/src/zfft.c
@@ -57,8 +57,9 @@ void zfft(complex_double * inout, int n, int direction, int howmany,
if (normalize) {
ptr = inout;
for (i = n * howmany - 1; i >= 0; --i) {
- *((double *) (ptr)) /= n;
- *((double *) (ptr++) + 1) /= n;
+ ptr->r /= n;
+ ptr->i /= n;
+ ptr++;
}
}
}
@@ -92,8 +93,9 @@ void cfft(complex_float * inout, int n, int direction, int howmany,
if (normalize) {
ptr = inout;
for (i = n * howmany - 1; i >= 0; --i) {
- *((float *) (ptr)) /= n;
- *((float *) (ptr++) + 1) /= n;
+ ptr->r /= n;
+ ptr->i /= n;
+ ptr++;
}
}
}
Something went wrong with that request. Please try again.