question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`scipy.signal.{medfilt,medfilt2d}` hit "Windows fatal exception: access violation" with SciPy 1.7.0 on Windows

See original GitHub issue

Since yesterday with the new SciPy 1.7.0 release, CuPy’s Windows CI is experiencing the following fatal error (cupy/cupy#5364) and the CI was interrupted.

Reproducing code example:

The failing tests can be found here: https://github.com/cupy/cupy/blob/4469fae998df33c72ff40ef954cb08b8f0004b18/tests/cupyx_tests/scipy_tests/signal_tests/test_signaltools.py#L250-L281

The failure is reproducible only on Windows and not seen on Linux.

Error message:

01:07:54.763807 STDERR 1188] | Windows fatal exception: access violation |  
01:07:54.763807 STDERR 1188] |   |  
01:07:54.763807 STDERR 1188] | Current thread 0x0000121c (most recent call first): |  
01:07:54.763807 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\scipy\signal\signaltools.py", line 1538 in medfilt |  
01:07:54.763807 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\scipy\signal\signaltools.py", line 1851 in medfilt2d |  
01:07:54.763807 STDERR 1188] | File "C:\Windows\TEMP\flexci\run-00151477\work\src\tests\cupyx_tests\scipy_tests\signal_tests\test_signaltools.py", line 281 in test_medfilt2d |  
01:07:54.763807 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\cupy\testing\_helper.py", line 47 in _call_func |  
01:07:54.763807 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\cupy\testing\_helper.py", line 90 in _call_func_numpy |  
01:07:54.763807 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\cupy\testing\_helper.py", line 101 in _call_func_numpy_cupy |  
01:07:54.763807 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\cupy\testing\_helper.py", line 265 in test_func |  
01:07:54.763807 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\cupy\testing\_helper.py", line 825 in test_func |  
01:07:54.764804 STDERR 1188] | File "C:\Development\Python\Python37\lib\unittest\case.py", line 615 in run |  
01:07:54.764804 STDERR 1188] | File "C:\Development\Python\Python37\lib\unittest\case.py", line 663 in __call__ |  
01:07:54.764804 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\unittest.py", line 321 in runtest |  
01:07:54.764804 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\runner.py", line 162 in pytest_runtest_call |  
01:07:54.765777 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall |  
01:07:54.765777 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\manager.py", line 87 in <lambda> |  
01:07:54.765777 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\manager.py", line 93 in _hookexec |  
01:07:54.765777 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\hooks.py", line 286 in __call__ |  
01:07:54.765777 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\runner.py", line 255 in <lambda> |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\runner.py", line 311 in from_call |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\runner.py", line 255 in call_runtest_hook |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\runner.py", line 215 in call_and_report |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\runner.py", line 126 in runtestprotocol |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\runner.py", line 109 in pytest_runtest_protocol |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\manager.py", line 87 in <lambda> |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\manager.py", line 93 in _hookexec |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\hooks.py", line 286 in __call__ |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\main.py", line 348 in pytest_runtestloop |  
01:07:54.769663 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\manager.py", line 87 in <lambda> |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\manager.py", line 93 in _hookexec |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\hooks.py", line 286 in __call__ |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\main.py", line 323 in _main |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\main.py", line 269 in wrap_session |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\main.py", line 316 in pytest_cmdline_main |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\manager.py", line 87 in <lambda> |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\manager.py", line 93 in _hookexec |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pluggy\hooks.py", line 286 in __call__ |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\config\__init__.py", line 163 in main |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\_pytest\config\__init__.py", line 185 in console_main |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\site-packages\pytest\__main__.py", line 5 in <module> |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\runpy.py", line 85 in _run_code |  
01:07:54.781377 STDERR 1188] | File "C:\Development\Python\Python37\lib\runpy.py", line 193 in _run_module_as_main | 12s
01:08:06.784203 STDOUT 1188] | Last 10 lines from the test output: |  
01:08:06.812846 STDOUT 1188] | ........................................................................ [ 75%] |  
01:08:06.814324 STDOUT 1188] | ........................................................................ [ 75%] |  
01:08:06.814324 STDOUT 1188] | ........................................................................ [ 75%] |  
01:08:06.814604 STDOUT 1188] | ........................................................................ [ 75%] |  
01:08:06.814604 STDOUT 1188] | ........................................................................ [ 75%] |  
01:08:06.814604 STDOUT 1188] | ........................................................................ [ 76%] |  
01:08:06.814604 STDOUT 1188] | ........................................................................ [ 76%] |  
01:08:06.814604 STDOUT 1188] | ........................................................................ [ 76%] |  
01:08:06.814604 STDOUT 1188] | ........................................................................ [ 76%] |  
01:08:06.814604 STDOUT 1188] | ............FFFF....FFFF

Scipy/Numpy/Python version information:

Python: 3.7.2 NumPy: 1.20.3 SciPy: 1.7.0

cc: @kmaehashi @emcastillo

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
kmaehashicommented, Jun 30, 2021

I’ve made a minimum reproducer.

import numpy, scipy.signal
arr = numpy.arange(50, dtype=numpy.float16).reshape((5, 10))
scipy.signal.medfilt2d(arr, 3)

In SciPy 1.6.3 the error was correctly raised when float16 is given.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Development\Python\Python37\lib\site-packages\scipy\signal\signaltools.py", line 1839, in medfilt2d
    return sigtools._medfilt2d(image, kernel_size)
ValueError: 2D median filter only supports uint8, float32, and float64.

However, the above code causes a hard crash in SciPy 1.7.0. Reproducible Python 3.7.2 / 3.9.0 on Windows, both using PyPI wheel.

2reactions
rgommerscommented, Jul 2, 2021

We don’t build Windows nightlies; the fix for this should land in 1.7.1 in some weeks. Timing TBD, we hope to also resolve the macOS arm64 issues and provide wheels.

Given that this issue only happens for code that was raising an exception before, I think it shouldn’t affect too many users, so that timing is okay. Please let us know in case that assessment is incomplete and we should release a fix sooner @leofang @kmaehashi.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install Scipy through pip - Stack Overflow
After opening up an issue with the SciPy team, we found that you need to upgrade pip with: pip install --upgrade pip. And...
Read more >
SciPy 1.7.0 Release Notes — SciPy v1.9.3 Manual
SciPy 1.7.0 is the culmination of 6 months of hard work. It contains many new features, numerous bug-fixes, improved test coverage and better...
Read more >
[Python/ADALM2000] ain.getSamples crashes the program ...
[Python/ADALM2000] ain.getSamples crashes the program with "Windows fatal exception: access violation" within try/except when ctx.
Read more >
SciPy - PyPI
It includes modules for statistics, optimization, integration, linear algebra, Fourier transforms, signal and image processing, ODE solvers, and more. Website: ...
Read more >
RobotPy Sim -- Windows fatal exception: access violation
We are running our code in 2020 sim and receiving fatal exception error. The sim dies when it runs a command group and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found