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

Flaky test with exception: access violation writing on Windows #3398

Closed
StrikerRUS opened this issue Sep 14, 2020 · 6 comments · Fixed by #3419
Closed

Flaky test with exception: access violation writing on Windows #3398

StrikerRUS opened this issue Sep 14, 2020 · 6 comments · Fixed by #3419
Labels

Comments

@StrikerRUS
Copy link
Collaborator

In test_plot_split_value_histogram sometimes WindowsError: exception: access violation writing occurs

def test_plot_split_value_histogram(self):

For the moment of creating this issue I saw it two times: in #3380 and #3397.

================================== FAILURES ===================================
__________________ TestBasic.test_plot_split_value_histogram __________________

self = <test_plotting.TestBasic testMethod=test_plot_split_value_histogram>

    @unittest.skipIf(not MATPLOTLIB_INSTALLED, 'matplotlib is not installed')
    def test_plot_split_value_histogram(self):
>       gbm0 = lgb.train(self.params, self.train_data, num_boost_round=10)

..\tests\python_package_test\test_plotting.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda\envs\test-env\lib\site-packages\lightgbm\engine.py:231: in train
    booster = Booster(params=params, train_set=train_set)
C:\Miniconda\envs\test-env\lib\site-packages\lightgbm\basic.py:2010: in __init__
    self.__get_eval_info()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <lightgbm.basic.Booster object at 0x000000000A248B88>

    def __get_eval_info(self):
        """Get inner evaluation count and names."""
        if self.__need_reload_eval_info:
            self.__need_reload_eval_info = False
            out_num_eval = ctypes.c_int(0)
            # Get num of inner evals
            _safe_call(_LIB.LGBM_BoosterGetEvalCounts(
                self.handle,
                ctypes.byref(out_num_eval)))
            self.__num_inner_eval = out_num_eval.value
            if self.__num_inner_eval > 0:
                # Get name of evals
                tmp_out_len = ctypes.c_int(0)
                reserved_string_buffer_size = 255
                required_string_buffer_size = ctypes.c_size_t(0)
                string_buffers = [
                    ctypes.create_string_buffer(reserved_string_buffer_size) for i in range_(self.__num_inner_eval)
                ]
                ptr_string_buffers = (ctypes.c_char_p * self.__num_inner_eval)(*map(ctypes.addressof, string_buffers))
                _safe_call(_LIB.LGBM_BoosterGetEvalNames(
                    self.handle,
                    self.__num_inner_eval,
                    ctypes.byref(tmp_out_len),
                    reserved_string_buffer_size,
                    ctypes.byref(required_string_buffer_size),
>                   ptr_string_buffers))
E               WindowsError: exception: access violation writing 0x00007FF9085F04DE

C:\Miniconda\envs\test-env\lib\site-packages\lightgbm\basic.py:3182: WindowsError

Both times it was in the following Windows job

LightGBM/.vsts-ci.yml

Lines 119 to 121 in 164818b

sdist:
TASK: sdist
PYTHON_VERSION: 2.7

@StrikerRUS StrikerRUS added the bug label Sep 14, 2020
@jameslamb
Copy link
Collaborator

is this different from #1818 ?

@StrikerRUS
Copy link
Collaborator Author

StrikerRUS commented Sep 14, 2020

@jameslamb Yes, this test started to fail only some days ago and it is VS while that one is MinGW.

@jameslamb
Copy link
Collaborator

oh ok got it

@guolinke
Copy link
Collaborator

maybe there are some memory leakages. @shiyu1994 can you take a look when you have time?

@StrikerRUS
Copy link
Collaborator Author

I guess these recent PRs may contain a bug: #2850, #3022.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants