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
OSX 64 bit libsingular -- sage/libsingular segfaults on first creation of a ring #5862
Comments
Attachment: trac_5862.patch.gz |
This comment has been minimized.
This comment has been minimized.
comment:1
The problem is that siInit doesn't get called on 64 bit OSX (William and I verified by adding a printf() statement). After this patch it gets called, but the allocation still fails, so we need to dig a little deeper. As is the patch is not applicable since we open the mangled name, but siInit should be declared Cheers, Michael |
comment:2
Ok, the problem is when the first ring is instantiated. I tried to verify that omMalloc passes its make check target, but I struck out for now:
I guess I need to dig into the documentation to track this down. Someone with oMalloc experience would certainly help here :) Cheers, Michael |
comment:3
Did you ping Hannes on this? Why did you remove |
comment:4
Replying to @malb:
I did just run
I think the removal of Cheers, Michael |
comment:5
Hi, I digged around in the Mac OS X documentation, especially: http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryUsageGuidelines.html#//apple_ref/doc/uid/TP40001928-SW10 In the section about "Opening Dynamic Libraries" there is also something said about closing dynamic libraries. Especially, the dynamic loader might or might not after "dlclose()" remove the library from the applications address space. That would be an explanation for seeing segfaults, I guess. Now in line 168 of "multi_polynomial_libsingular.pyx", there is a call to "dlclose()", and this call most probably is done before any ring is instantiated. I remember to have seen a file where on Sage shutdown many memory deallocations and such are performed, probably that call to "dlclose()" is done better there (I don't remember what that place was). See also trac #5522 about issues with whether libsingular was loaded or not. Cheers, gsw |
comment:6
Replying to @sagetrac-mabshoff:
I cannot confirm this, siInit does get called, I just added a |
comment:7
Here's what I believe is the cause of the problem: When oMalloc creates a new bucket it assigns the global It is defined in Linker fun ahead! |
comment:8
|
Attachment: libsingular_osx64.patch.gz removes linking in static libraries |
comment:9
The attached patch http://sage.math.washington.edu/home/malb/spkgs/singular-3-0-4-4-20090511.spkg we get:
I also tested it on sage.math, doctests still running. |
comment:10
Hi,
(The file as-is should be the correct one, so just has to be checked in. There is an editor-artifact file of the same name followed by a tilde in the spkg.) The changes themselves look pretty reasonable and OK to me, but I can't test this on a OS X 64-bit system. I could test only whether they don't break anything on OS X 10.4 32-bit, and I have not done this yet. However, "1579.9 seconds" looks awesome --- on my MacIntel box with 2 GHz Core2Duo and Mac OS X 10.4, "make -j2 test" needs over 6000 seconds. |
comment:11
I fixed the spkg (same place). I think I ran |
comment:12
Positive review on spkg and patch. Everything looks kosher inside the spkg. Of the doctest failures gen.pyx is a real issue, the other two have been fixed by the first two patches at #5929. W00t - thanks malb :) Cheers, Michael |
comment:13
Merged the singular.spkg as well as libsingular_osx64.patch in Sage 4.0.alpha0. Cheers, Michael |
comment:14
:) |
Sage 3.4.1 or similar segault on startup once the first mv polynomial ring via libSingular is created. This is bad ;)
Cheers,
Michael
Component: commutative algebra
Issue created by migration from https://trac.sagemath.org/ticket/5862
The text was updated successfully, but these errors were encountered: