Skip to content

[0.20.2] On armhf, test_novelty_true_common_tests() leads to a segfault #13052

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

Closed
olebole opened this issue Jan 27, 2019 · 11 comments
Closed

[0.20.2] On armhf, test_novelty_true_common_tests() leads to a segfault #13052

olebole opened this issue Jan 27, 2019 · 11 comments

Comments

@olebole
Copy link

olebole commented Jan 27, 2019

Splitting #13036: On armhf, test_novelty_true_common_tests() probably leads to a segfault. I will try to get a backtrace.
Commenting this out leads to the next segfault:

sklearn/tests/test_common.py::test_non_meta_estimators[BaggingRegressor-BaggingRegressor-check_regressors_train(readonly_memmap=True)] Bus error
E: pybuild pybuild:338: test: plugin distutils failed with: exit code=135: cd /<<BUILDDIR>>/scikit-learn-0.20.2+dfsg/.pybuild/cpython2_2.7/build; python2.7 -m pytest -m "not network" -v

and the next is

sklearn/utils/tests/test_estimator_checks.py::test_check_estimator_transformer_no_mixin PASSED [ 97%]
sklearn/utils/tests/test_estimator_checks.py::test_check_estimator_clones Bus error
E: pybuild pybuild:338: test: plugin distutils failed with: exit code=135: cd /<<BUILDDIR>>/scikit-learn-0.20.2+dfsg/.pybuild/cpython2_2.7/build; python2.7 -m pytest -m "not network" -v
dh_auto_test: pybuild --test -i python{version} -p 2.7 returned exit code 13

...

sklearn/utils/tests/test_estimator_checks.py::test_check_estimator_pairwise Bus error
E: pybuild pybuild:338: test: plugin distutils failed with: exit code=135: cd /<<BUILDDIR>>/scikit-learn-0.20.2+dfsg/.pybuild/cpython2_2.7/build; python2.7 -m pytest -m "not network" -v
dh_auto_test: pybuild --test -i python{version} -p 2.7 returned exit code 13

This list is reproducible; all other tests pass.

@rth rth added the Bug label Jan 27, 2019
@rth rth added this to the 0.20.3 milestone Jan 27, 2019
@olebole
Copy link
Author

olebole commented Jan 29, 2019

Stacktrace for the test_non_meta_estimators (Program received signal SIGBUS, Bus error) is (on Python 2.7)

(gdb) bt
#0  __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init (__pyx_v_self=0xb0db2e90, __pyx_v_y=0xb6fee88a, __pyx_v_y_stride=1, __pyx_v_sample_weight=0x20d3df8, 
    __pyx_v_weighted_n_samples=<optimized out>, __pyx_v_samples=0x2102a38, __pyx_v_start=0, __pyx_v_end=128) at sklearn/tree/_criterion.c:6785
#1  0xb351b18c in __pyx_f_7sklearn_4tree_9_splitter_8Splitter_node_reset (__pyx_v_self=0xb2a0ac90, __pyx_v_start=<optimized out>, __pyx_v_end=<optimized out>, 
    __pyx_v_weighted_n_node_samples=0xbeff9c90) at sklearn/tree/_splitter.c:4075
#2  0xb34ead38 in __pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build (__pyx_v_self=<optimized out>, __pyx_v_tree=0xb0ab6ad8, __pyx_v_X=0xb220f098, 
    __pyx_v_y=0xb220f200, __pyx_skip_dispatch=1, __pyx_optional_args=0xbeff9d7c) at sklearn/tree/_tree.c:5387
#3  0xb34e4b6a in __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build (__pyx_v_X_idx_sorted=<optimized out>, __pyx_v_sample_weight=<optimized out>, 
    __pyx_v_y=<optimized out>, __pyx_v_X=<optimized out>, __pyx_v_tree=<optimized out>, __pyx_v_self=0xb0aa4780) at sklearn/tree/_tree.c:6034
#4  __pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build (__pyx_v_self=0xb0aa4780, __pyx_args=<optimized out>, __pyx_kwds=<optimized out>)
    at sklearn/tree/_tree.c:6005
#5  0x0046f19c in PyEval_EvalFrameEx ()
#6  0x0046d178 in PyEval_EvalCodeEx ()
#7  0x004733a0 in PyEval_EvalFrameEx ()
#8  0x0046d178 in PyEval_EvalCodeEx ()
#9  0x004733a0 in PyEval_EvalFrameEx ()
#10 0x0046d178 in PyEval_EvalCodeEx ()

Some variables (from a different session, so the pointer values do not match the stacktrace above):

(gdb) p *__pyx_v_self
$13 = {__pyx_base = {ob_refcnt = 2, 
    ob_type = 0xb34f87c4 <__pyx_type_7sklearn_4tree_10_criterion_MSE>, 
    __pyx_vtab = 0xb34f8cd0 <__pyx_vtable_7sklearn_4tree_10_criterion_MSE>, 
    y = 0xb6f9288a, y_stride = 1, sample_weight = 0x2c9f090, samples = 0x2c92aa0, 
    start = 0, pos = 0, end = 128, n_outputs = 1, n_samples = 200, 
    n_node_samples = 128, weighted_n_samples = 200, weighted_n_node_samples = 0, 
    weighted_n_left = 0, weighted_n_right = 0, sum_total = 0x2c38c88, 
    sum_left = 0x2535ed0, sum_right = 0x2c54488}, sq_sum_total = 0}
(gdb) p *__pyx_v_y
Cannot access memory at address 0xb6f9288a
(gdb) p *__pyx_v_sample_weight 
$17 = 1

Interestingly, __pyx_v_y is unaccessible here -- this is the first argument of the call in

self.criterion.init(self.y,
self.y_stride,
self.sample_weight,
self.weighted_n_samples,
self.samples,
start,
end)

@amueller
Copy link
Member

Is this python2.7? Is this reproducible under 3.6 or 3.7?

@olebole
Copy link
Author

olebole commented Jan 29, 2019

That is 2.7. I will check tomorrow (or so) how it behaves under 3.7.

@jnothman
Copy link
Member

My cythonised version of _criterion.pyx doesn't have code on line 6785. Could you provide the pyx context @olebole?

@olebole
Copy link
Author

olebole commented Jan 30, 2019

The sigbus also happens under Python-3.7. I attach the built files _criterion.c, _splitter.c, and _tree.c.

@jnothman
Copy link
Member

jnothman commented Jan 30, 2019 via email

@olebole
Copy link
Author

olebole commented Jan 30, 2019

That is the second one (test_non_meta_estimators[BaggingRegressor-BaggingRegressor-check_...]), sorry. I unfortunately didn't read my own issue title, but just the first example.

@jnothman
Copy link
Member

Right. I only see now that you edited the description.

test_check_estimator_pairwise doesn't have any trees either, but could be related to the LOF issue?

@olebole
Copy link
Author

olebole commented Jan 31, 2019

If that was a question to me, then I didn't understant what you want ;-)

@jnothman jnothman modified the milestones: 0.20.3, 0.21.1 Apr 6, 2019
@rth rth modified the milestones: 0.21.1, 0.21.2 May 18, 2019
@jnothman jnothman modified the milestones: 0.21.2, 0.21.3 May 25, 2019
@jnothman jnothman modified the milestones: 0.21.3, 0.23 Oct 31, 2019
@adrinjalali
Copy link
Member

clearing from the milestone.

@adrinjalali adrinjalali modified the milestones: 0.23, 0.24 Apr 20, 2020
@adrinjalali
Copy link
Member

Closing this, happy to reopen if we can reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants