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

TST, BUG (?): windows failure for integrate/tests/test__quad_vec.py::test_quad_vec_pool #14985

Closed
tylerjereddy opened this issue Nov 5, 2021 · 8 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.integrate

Comments

@tylerjereddy
Copy link
Contributor

tylerjereddy commented Nov 5, 2021

This failure/permissions error is showing up in the wheels repo for a subset of Windows matrix entries, including backports for 1.7.2 and for master.

I'll put the traceback below, and links to sample PRs:
MacPython/scipy-wheels#135
MacPython/scipy-wheels#138

Can we put a skip marker on this test for Windows temporarily, at least on the maintenance branch, or is this looking real?

================================== FAILURES ===================================
_____________________________ test_quad_vec_pool ______________________________
[gw0] win32 -- Python 3.7.5 C:\Python37-x64\python.exe
C:\Python37-x64\lib\site-packages\scipy\integrate\tests\test__quad_vec.py:98: in test_quad_vec_pool
    res, err = quad_vec(f, -np.inf, np.inf, norm='max', epsabs=1e-4, workers=4)
        Pool       = <function Pool at 0x000002479C210A68>
        f          = <function _lorenzian at 0x0000024787C0FDC8>
C:\Python37-x64\lib\site-packages\scipy\integrate\_quad_vec.py:252: in quad_vec
    res = quad_vec(f2, -1, 1, **kwargs)
        a          = -inf
        b          = inf
        cache_size = 100000000.0
        epsabs     = 0.0001
        epsrel     = 1e-08
        f          = <function _lorenzian at 0x0000024787C0FDC8>
        f2         = <scipy.integrate._quad_vec.DoubleInfiniteFunc object at 0x0000024799FFCA48>
        full_output = False
        kwargs     = {'cache_size': 100000000.0, 'epsabs': 0.0001, 'epsrel': 1e-08, 'full_output': False, ...}
        limit      = 10000
        norm       = 'max'
        points     = None
        quadrature = None
        sgn        = 1
        workers    = 4
C:\Python37-x64\lib\site-packages\scipy\integrate\_quad_vec.py:391: in quad_vec
    break
        CONVERGED  = 0
        NOT_A_NUMBER = 3
        NOT_CONVERGED = 1
        ROUNDING_ERROR = 2
        _quadrature = <function _quadrature_gk15 at 0x0000024787BDB678>
        a          = -1.0
        b          = 0.0
        cache_count = 4166666.0
        cache_size = 100000000.0
        derr       = -0.0001958558976507645
        dint       = -5.188183216375819e-11
        dneval     = 30
        dround_err = 1.7439342490043163e-14
        epsabs     = 0.0001
        epsrel     = 1e-08
        err        = 1.2888960825934786e-10
        err_sum    = 0.00039171231086582484
        f          = <scipy.integrate._quad_vec.DoubleInfiniteFunc object at 0x0000024799FFCA48>
        full_output = False
        global_error = 5.155584007941142e-10
        global_integral = 3.141592653589793
        ier        = 0
        ig         = 0.7853981633974483
        initial_intervals = [(-1.0, 0.0), (0.0, 1.0)]
        interval   = (-0.000195856155429981, -1.0, 0.0)
        interval_cache = LRUDict([((0.0, 0.5), 0.7853981633974485), ((0.5, 1.0), 0.7853981633974483), ((-1.0, -0.5), 0.7853981633974484), ((-0.5, 0.0), 0.7853981633974483)])
        intervals  = [(-1.2888960825934792e-10, -1.0, -0.5), (-1.2888960825934786e-10, -0.5, 0.0), (-1.2888960825934792e-10, 0.5, 1.0), (-1.2888957602994802e-10, 0.0, 0.5)]
        j          = 2
        kwargs     = {'cache_size': 100000000.0, 'epsabs': 0.0001, 'epsrel': 1e-08, 'full_output': False, ...}
        limit      = 10000
        mapwrapper = <scipy._lib._util.MapWrapper object at 0x000002479C20C9C8>
        min_intervals = 2
        neg_old_err = -0.000195856155429981
        neval      = 90
        norm       = 'max'
        norm_func  = <built-in function abs>
        norm_funcs = {None: <function _max_norm at 0x0000024787B5C0D8>, 'max': <function _max_norm at 0x0000024787B5C0D8>, '2': <function norm at 0x00000247FE803E58>}
        old_int    = 1.5707963268467784
        p          = 0.0
        parallel_count = 128
        points     = (0,)
        prev       = 0.0
        quadrature = 'gk15'
        rnd        = 1.743934249061916e-14
        rounding_error = 6.975736996132465e-14
        status_msg = {0: 'Target precision reached.', 1: 'Target precision not reached.', 2: 'Target precision could not be reached due to rounding error.', 3: 'Non-finite values encountered.'}
        subint     = ((-1.0, -0.5, 0.7853981633974484, 1.2888960825934792e-10), (-0.5, 0.0, 0.7853981633974483, 1.2888960825934786e-10))
        to_process = [((0.00019585615543584383, 0.0, 1.0, 1.5707963268467782), <scipy.integrate._quad_vec.DoubleInfiniteFunc object at 0x00...nfiniteFunc object at 0x0000024799FFCA48>, <built-in function abs>, <function _quadrature_gk15 at 0x0000024787BDB678>)]
        tol        = 0.0001
        workers    = 4
        x          = (-0.5, 0.0, 0.7853981633974483, 1.2888960825934786e-10)
        x1         = -0.5
        x2         = 0.0
C:\Python37-x64\lib\site-packages\scipy\_lib\_util.py:466: in __exit__
    self.pool.terminate()
        exc_type   = None
        exc_value  = None
        self       = <scipy._lib._util.MapWrapper object at 0x000002479C20C9C8>
        traceback  = None
C:\Python37-x64\lib\multiprocessing\pool.py:548: in terminate
    self._terminate()
        self       = <multiprocessing.pool.Pool object at 0x000002479C20CBC8>
C:\Python37-x64\lib\multiprocessing\util.py:201: in __call__
    res = self._callback(*self._args, **self._kwargs)
        _finalizer_registry = {(None, 9): <Finalize object, callback=CloseHandle, args=(2044,)>, (None, 10): <Finalize object, callback=CloseHandle,...Finalize object, callback=CloseHandle, args=(2020,)>, (None, 12): <Finalize object, callback=CloseHandle, args=(508,)>}
        getpid     = <built-in function getpid>
        self       = <Finalize object, callback=_terminate_pool, args=(<_queue.SimpleQueue object at 0x000002479C1FB638>, <multiprocessing....emon 2636)>, <Thread(Thread-108, stopped daemon 3004)>, <Thread(Thread-109, stopped daemon 3664)>, {}), exitprority=15>
        sub_debug  = <function sub_debug at 0x00000247FF7A5DC8>
        wr         = None
C:\Python37-x64\lib\multiprocessing\pool.py:601: in _terminate_pool
    p.terminate()
        cache      = {}
        cls        = <class 'multiprocessing.pool.Pool'>
        inqueue    = <multiprocessing.queues.SimpleQueue object at 0x000002479C20CB08>
        outqueue   = <multiprocessing.queues.SimpleQueue object at 0x000002479C2053C8>
        p          = <SpawnProcess(SpawnPoolWorker-8, stopped daemon)>
        pool       = [<SpawnProcess(SpawnPoolWorker-7, stopped[SIGTERM] daemon)>, <SpawnProcess(SpawnPoolWorker-8, stopped daemon)>, <SpawnProcess(SpawnPoolWorker-9, stopped daemon)>, <SpawnProcess(SpawnPoolWorker-10, stopped daemon)>]
        result_handler = <Thread(Thread-109, stopped daemon 3664)>
        task_handler = <Thread(Thread-108, stopped daemon 3004)>
        taskqueue  = <_queue.SimpleQueue object at 0x000002479C1FB638>
        worker_handler = <Thread(Thread-107, stopped daemon 2636)>
C:\Python37-x64\lib\multiprocessing\process.py:124: in terminate
    self._popen.terminate()
        self       = <SpawnProcess(SpawnPoolWorker-8, stopped daemon)>
C:\Python37-x64\lib\multiprocessing\popen_spawn_win32.py:119: in terminate
    _winapi.TerminateProcess(int(self._handle), TERMINATE)
E   PermissionError: [WinError 5] Access is denied
        self       = <multiprocessing.popen_spawn_win32.Popen object at 0x000002479C205748>
@rgommers
Copy link
Member

rgommers commented Nov 5, 2021

Looks familiar, duplicate of gh-14797 and occurred before in gh-11835. I'll have a closer look.

@rgommers
Copy link
Member

rgommers commented Nov 5, 2021

Can we put a skip marker on this test for Windows temporarily, at least on the maintenance branch, or is this looking real?

Yes, please do - something is wrong here, but it shouldn't be blocking for adding the Python 3.10 support.

@rgommers rgommers added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Nov 5, 2021
@rgommers
Copy link
Member

rgommers commented Nov 5, 2021

It's only happening on Python 3.8 builds on Appveyor. Reading the discussion on gh-11835, the solution was import multiprocessing within runtests.py (long story, has to do with a Python 3.8 bug, plus how multiprocessing gets initialized, plus whether it runs in a subprocess).

This seems to be something similar, because this is the only Windows build where we use yet another script to kick off the test suite: https://github.com/MacPython/scipy-wheels/blob/master/run_scipy_tests.py. I bet that if we used pytest, python -c "import scipy; scipy.test()" or runtests.py`, this would not be failing.

@rgommers
Copy link
Member

rgommers commented Nov 5, 2021

@tylerjereddy you could try to add import multiprocessing to run_scipy_tests.py and see if that fixes it. If not, then I'd say just skip it and only worry about it again if it's reported for a more normal way of running the tests.

tylerjereddy added a commit to tylerjereddy/scipy-wheels that referenced this issue Nov 5, 2021
* try importing multiprocessing in `run_scipy_tests.py` to
address this:
scipy/scipy#14985
@tylerjereddy
Copy link
Contributor Author

@rgommers thanks, I've tried that first--the import has been pushed into the wheels backport: MacPython/scipy-wheels#135

@mdhaber
Copy link
Contributor

mdhaber commented Jan 20, 2023

@tylerjereddy was this resolved? I just noticed that the linked issues were closed.

@tylerjereddy
Copy link
Contributor Author

@mdhaber I think I'm going to close this, given:

  • seems to be focused on Python 3.7/3.8, and 3.8 support is getting dropped in NumPy soon-ish anyway I think
  • largely related to the old wheels repo/Appveyor stuff, and a weird way of running the tests that I don't think we care about much now that we use modern cibiuldwheel and we have a different build system in place, etc.

Anyone should feel free to reopen if there's a concrete reproducer outside of that weird/older machinery.

@tylerjereddy
Copy link
Contributor Author

I should mention, this particular test does already have another more recent open issue; #17098

That looks like a separate matter on Linux though with segfault though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.integrate
Projects
None yet
Development

No branches or pull requests

3 participants