You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, if LinearSVR segfaults with read-only memmaps it's strange that it does so only in this configuration but not in CI on master which should use a fairly similar version of dependencies. I'm almost using exactly those versions and it doesn't segfault..
Hmm, if LinearSVR segfaults with read-only memmaps it's strange that it does so only in this configuration but not in CI on master which should use a fairly similar version of dependencies. I'm almost using exactly those versions and it doesn't segfault..
Is it not a race condition on the same data or something like that which happen on faster computer.
This cannot happen when running a single test actually.
This seems like a duplicate of #10667. As noted in #10667 (comment), I managed to get rid of this problem by installing gcc_linux-64, gxx_linux-64 with conda.
@rth had the same issue and using the gcc/g++ from conda fixed it for him too.
Something I forgot to mention is that the problem was seen in master in #10667 well before #10663 was merged so I reckon #10663 is only highlighting an existing problem rather than being the culprit.
The hotfix in #11133 would solve the issue since it will trigger a copy of y in the read-only case.
We try with @ogrisel to force y to be const but it did not solve the issue.
We try with @ogrisel to force y to be const but it did not solve the issue.
More specifically we tried to edit the liblinear.cpp source code to use const double * y instead of double * in the problemstruct but we could not make it work and that would imply rewriting a significant part of liblinear.
+1 for making a writable copy of y as done in the hotfix.
@lesteve yeah obviously #10663 didn't create the problem, only highlights it. I didn't realize you observed the bug in #10667.
It's pretty strange (why would it write to y?!), but if you already spend some time investigating it I'm happy to call the hotfix a fix and close. @ogrisel can you maybe explain what casting a memory map to a float pointer means and why it might segfault? Though your idea of a fix sounds reasonable, it probably is not worth the effort.
Activity
amueller commentedon May 24, 2018
reproduces this. How can I find out which test that is? @rth @qinhanmin2014 ?
amueller commentedon May 24, 2018
Git bisect says #11063 is guilty
amueller commentedon May 24, 2018
svm/src/liblinear/linear.cpp
2386├> model_->n_iter[0] =train_one(prob, param, &model_->w[0], 0, 0);
amueller commentedon May 24, 2018
It's
LinearSVR-LinearSVR-check_regressors_train(readonly_memmap=True)amueller commentedon May 24, 2018
lol git bisect is stupid on this... never mind...
amueller commentedon May 24, 2018
actual bisecting blames 9ea723f and
@lesteve, which makes more sense....
amueller commentedon May 24, 2018
it's actually
ybeing a memmap that's causing the problem....rth commentedon May 24, 2018
Hmm, if
LinearSVRsegfaults with read-only memmaps it's strange that it does so only in this configuration but not in CI on master which should use a fairly similar version of dependencies. I'm almost using exactly those versions and it doesn't segfault..amueller commentedon May 24, 2018
@glemaitre had the same issue.
amueller commentedon May 24, 2018
what cython and numpy are you using?
glemaitre commentedon May 24, 2018
Is it not a race condition on the same data or something like that which happen on faster computer.This cannot happen when running a single test actually.
amueller commentedon May 24, 2018
Actually, I don't entirely understand what happens with the memmap once it's converted to a C pointer. Can someone explain?
glemaitre commentedon May 24, 2018
FYI: I have the same version than @amueller
amueller commentedon May 24, 2018
Also fails on
on my machine, which should be the same as travis?
glemaitre commentedon May 24, 2018
so yes. It is still really obscure to me what is happening.
ogrisel commentedon May 25, 2018
I do not reproduce the segfault (current master, cython 0.28.2).
ogrisel commentedon May 25, 2018
I cannot reproduce either with cython 0.26.1. We probably have to make a minimal reproduction case in a standalone python script and valgrind it.
lesteve commentedon May 25, 2018
This seems like a duplicate of #10667. As noted in
#10667 (comment), I managed to get rid of this problem by installing gcc_linux-64, gxx_linux-64 with conda.
@rth had the same issue and using the gcc/g++ from conda fixed it for him too.
ogrisel commentedon May 25, 2018
I am using gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 (and cannot reproduce).
glemaitre commentedon May 25, 2018
The GDB back trace for the segfault while running the test with pytest:
I cannot reproduce the segfault when I am outside of pytest for instance the script of @albertcthomas : #10667 (comment)
rth commentedon May 25, 2018
Yes, I have forgotten about it. Installing gcc from conda did fix it for me, but it's certainly not ideal...
lesteve commentedon May 25, 2018
Something I forgot to mention is that the problem was seen in master in #10667 well before #10663 was merged so I reckon #10663 is only highlighting an existing problem rather than being the culprit.
glemaitre commentedon May 25, 2018
The hotfix in #11133 would solve the issue since it will trigger a copy of
yin the read-only case.We try with @ogrisel to force y to be const but it did not solve the issue.
ogrisel commentedon May 25, 2018
More specifically we tried to edit the
liblinear.cppsource code to useconst double * yinstead ofdouble *in theproblemstructbut we could not make it work and that would imply rewriting a significant part of liblinear.+1 for making a writable copy of
yas done in the hotfix.amueller commentedon May 26, 2018
@lesteve yeah obviously #10663 didn't create the problem, only highlights it. I didn't realize you observed the bug in #10667.
It's pretty strange (why would it write to y?!), but if you already spend some time investigating it I'm happy to call the hotfix a fix and close.
@ogrisel can you maybe explain what casting a memory map to a float pointer means and why it might segfault? Though your idea of a fix sounds reasonable, it probably is not worth the effort.
lesteve commentedon May 28, 2018
As @amueller, I have to say I would be very happy to hear more about the root cause of the problem ...
amueller commentedon Jun 28, 2018
Closing this, I don't think it's worth spending time on investigating.