Ticket #912 (closed defect: fixed)

Opened 17 months ago

Last modified 17 months ago

scipy.signal.iirdesign segfaults in scipy 0.6.0

Reported by: abergeron Owned by: somebody
Priority: normal Milestone: 0.7.1
Component: scipy.signal Version: 0.7.0
Keywords: Cc:

Description

I tried using the iirdesign function to create a lowpass filter like this:

scipy.signal.iirdesign(wp=0.2, ws=0.5, gstop=-3, gpass=1, output='ba')

and got a segfault. Mucking around with the parameters did not help. As trying to get 'zpk' output.

After this in gdb:

run -c "import scipy.signal; scipy.signal.iirdesign(ws=0.2, wp=0.5, gstop=-3, gpass=1, output='ba')"

I get this as a backtrace:

Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0xbf7ffff8 0x0121cf44 in cephes_ellpj () (gdb) bt #0 0x0121cf44 in cephes_ellpj () #1 0x0120a950 in PyUFunc_dd_dddd () #2 0x00603150 in PyUFunc_GenericFunction () #3 0x006042dc in ufunc_generic_call () #4 0x00007f34 in PyObject?_Call () #5 0x000afd08 in PyEval?_EvalFrameEx () #6 0x000b1d90 in PyEval?_EvalCodeEx () #7 0x000320b8 in function_call () #8 0x00007f34 in PyObject?_Call () #9 0x000b0350 in PyEval?_EvalFrameEx () #10 0x000b1d90 in PyEval?_EvalCodeEx () #11 0x000afc88 in PyEval?_EvalFrameEx () #12 0x000b1d90 in PyEval?_EvalCodeEx () #13 0x000afc88 in PyEval?_EvalFrameEx () #14 0x000afbec in PyEval?_EvalFrameEx () #15 0x000b1d90 in PyEval?_EvalCodeEx () #16 0x000afc88 in PyEval?_EvalFrameEx () #17 0x000b1d90 in PyEval?_EvalCodeEx () #18 0x000afc88 in PyEval?_EvalFrameEx () #19 0x000b1d90 in PyEval?_EvalCodeEx () #20 0x000b1f30 in PyEval?_EvalCode () #21 0x000d8398 in PyRun?_StringFlags () #22 0x000d8454 in PyRun?_SimpleStringFlags () #23 0x000e38b8 in Py_Main () #24 0x00001a10 in _start () #25 0x00001720 in start ()

I tried this on Mac OS X 10.5.6 on a G5 PPC (0.6.0 compiled as part of Sage and 0.7.0 stand-alone), and on a linux machine running Fedora Core 8 x86 machine (0.6.0 stand-alone install), and got the same segfault.

Change History

in reply to: ↑ description   Changed 17 months ago by abergeron

Okay, the backtrace should look like this:

> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0xbf7ffff8
> 0x0121cf44 in cephes_ellpj ()
> (gdb) bt
> #0  0x0121cf44 in cephes_ellpj ()
> #1  0x0120a950 in PyUFunc_dd_dddd ()
> #2  0x00603150 in PyUFunc_GenericFunction ()
> #3  0x006042dc in ufunc_generic_call ()
> #4  0x00007f34 in PyObject_Call ()
> #5  0x000afd08 in PyEval_EvalFrameEx ()
> #6  0x000b1d90 in PyEval_EvalCodeEx ()
> #7  0x000320b8 in function_call ()
> #8  0x00007f34 in PyObject_Call ()
> #9  0x000b0350 in PyEval_EvalFrameEx ()
> #10 0x000b1d90 in PyEval_EvalCodeEx ()
> #11 0x000afc88 in PyEval_EvalFrameEx ()
> #12 0x000b1d90 in PyEval_EvalCodeEx ()
> #13 0x000afc88 in PyEval_EvalFrameEx ()
> #14 0x000afbec in PyEval_EvalFrameEx ()
> #15 0x000b1d90 in PyEval_EvalCodeEx ()
> #16 0x000afc88 in PyEval_EvalFrameEx ()
> #17 0x000b1d90 in PyEval_EvalCodeEx ()
> #18 0x000afc88 in PyEval_EvalFrameEx ()
> #19 0x000b1d90 in PyEval_EvalCodeEx ()
> #20 0x000b1f30 in PyEval_EvalCode ()
> #21 0x000d8398 in PyRun_StringFlags ()
> #22 0x000d8454 in PyRun_SimpleStringFlags ()
> #23 0x000e38b8 in Py_Main ()
> #24 0x00001a10 in _start ()
> #25 0x00001720 in start ()

And I should note that I found out that the gstop parameter should not be negative. Nevertheless, I would have expected an error, not a segfault for being stupid.

  Changed 17 months ago by cdavid

Don't worry, a segfault is usually a bug, even if you used wrong arguments.

The problem should be detected in ellipord, which is the funciton which determines the filter order necessary to respect the given constraints (it returns a 0 order filter in your case...). The segfault is related to another problem, namely ellipj behavior when its second argument is nan. This is another ticket, #927.

  Changed 17 months ago by cdavid

  • status changed from new to closed
  • resolution set to fixed

I close this one, as the segfault is fixed. I opened #928 for the buggy behavior of ellipord, though.

Note: See TracTickets for help on using tickets.