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
Segfaults in matrix_modn_sparse in Sage built with clang #24716
Comments
comment:1
Attachment: test.log Looking at the attachment: test.log, it seems that all errors are caused by a segfault in matrix_modn_sparse (the one timeout error is an artefact of me closing my laptop and bringing it to my office). So, in fact only matrix_modn_sparse needs to be fixed. |
This comment has been minimized.
This comment has been minimized.
comment:2
So, perhaps something is wrong in linbox when built with clang. |
comment:3
Just to be clear, which version of ubuntu and which version of clang? I have successfully doctested a sage build on Gentoo with clang-5.0.1 and older versions of sage with clang-4 and 3.9 but some stuff has changed since then. |
comment:4
Replying to @kiwifb:
|
comment:5
To be on the safe side, I am rebuilding Sage now, as yesterday I had interrupted the build process at some point and changed one environment variable. |
comment:6
Replying to @simon-king-jena:
Thanks for doing this. It could really be something with clang-3.8, we haven't really tested that version in some time. The ticket to enable clang had a long life (and it didn't quite make it to 500 comments). |
comment:7
Rebuilding Sage with the branch from #24696, with clang-3.8, and with
the error persists. So, something is going wrong. |
comment:8
Right, can you attach the build log of linbox and if you can generate it, its |
comment:9
Also helpful would be to start |
Attachment: linbox-1.5.2.log |
comment:10
Replying to @kiwifb:
Done.
How to generate it? |
comment:11
Replying to @rwst:
When I start
Quite odd, from my point of view. So, why does Sage even start if it cannot find Cython? Note, however, that I see the same ImportError when starting Then, after generating the segfault, I get:
|
comment:12
Well |
comment:13
Replying to @rwst:
|
comment:14
Replying to @rwst:
I unpacked the linbox upstream tarball, and then
So, is |
comment:15
Replying to @simon-king-jena:
Apparently, because my ldd -r |
comment:16
Replying to @kiwifb:
and
and (note that it is
|
comment:17
Ok |
comment:18
Replying to @kiwifb:
and
and
and by the way also
So, there is libstdc++ everywhere |
comment:19
Is there |
comment:20
|
comment:21
Replying to @kiwifb:
No.
shows nothing. Hm. |
comment:22
Replying to @simon-king-jena:
Is it perhaps the case that one needs additional flags? |
comment:23
I am wondering if |
comment:24
Replying to @simon-king-jena:
I should really have checked the so's. The additional flag I think would be |
comment:26
I just built mpir and gf2x then ntl with `LDFLAGS="$LDFLAGS -lc++ --stlib=ĺibc++" and libc++ is in libntl but libstdc++ too. libmpir.so does not have libstdc++, so where does it come from? |
comment:27
Replying to @rwst:
I have enough time to rebuild from scratch, and (as I did before) with #24696 merged with #24710. So, perhaps it was too early to close #24710 as invalid. |
comment:28
libmpir is pure C, try libmpirxx |
comment:29
Replying to @rwst:
See comment:14, ntl seems to hard-code the use of |
comment:30
Replying to @kiwifb:
Ah there it is, too, so mpir is it. |
Attachment: ntl-10.3.0.log |
comment:31
The log obtained with
is attached, and
So, I guess one needs to fix the ntl upstream tarball. |
comment:32
But I have zero problem with a clang defaulting to libc++, even so according to this -lstdc++ is passed at linking time. I have to rebuild things again and inspect the libraries. By the way according to the log you posted the linker never even looked for libc++.so. |
comment:33
Replying to @kiwifb:
But is it after that in the so? As said I have it in all so's and don't get crashes either. Remember also libc++ is used when compiling as well not only linking. |
comment:34
That's what it looks like here
no libstdc++ anywhere. |
comment:35
And as you can see, I don't have -lstdc++ added when I link nlt, but i have -lc++
I think libtool is figuring it out by itself. |
comment:36
Maybe we should not be so absolute that clang needs libc++ to work. In #24701 I reported the exact same crash but I did not use libc++ there. |
comment:37
Sage compiles here with clang-4 without options for libc++. The above tests pass without crash (full make ptestlong in the works). As you can see from #24701 on the same system with the same flags clang-3.8 produces a crashing Sage (this lead me to use libc++ from there on). So obviously, the next attempt Simon could do would be using clang-4. |
comment:38
Since that worked I propose to close this ticket. |
comment:39
Fine with me. On linux the minimum supported version of clang needed is 4 and that's the end of it. On OS X it appears we can go back to xcode 7. |
Reviewer: François Bissey |
comment:40
closing positively reviewed duplicates |
When building Sage on Ubuntu with clang (see #24701, #24705 etc), a bunch of doctests fails (see comments below). They have a common cause in matrix_modn_sparse.
I guess it should be fixed! And I hope "porting" is the correct component for it.
CC: @rwst @kiwifb @jdemeyer
Component: porting
Reviewer: François Bissey
Issue created by migration from https://trac.sagemath.org/ticket/24716
The text was updated successfully, but these errors were encountered: