-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Pari segfault on Sage startup in Cygwin #11551
Comments
Attachment: Parisegfault.PNG.gz Screenshot of the problem |
comment:1
I've attached a screenshot of the traceback - the best I can do in Cygwin with my limited experience. |
comment:2
Can you please attach your Please do not report errors on non-released Sage versions (like sage-4.7.1.alpha4 in your case). Those versions can (and probably will) change slightly, which makes it harder to reproduce errors. |
comment:3
Replying to @kcrisman:
hmm, you should be able to just copy the thing with your mouse and paste... perhaps, running in an better terminal window, such as mintty : http://code.google.com/p/mintty/ |
comment:4
Replying to @jdemeyer:
I'll try - depends on whether my wifi will work. I'm not on that computer currently.
Well, building on Cygwin is not exactly straightforward, and (at least for me) extremely time-consuming, so I wanted to make sure I had as bleeding-edge of code as possible to catch potential problems. I find it unlikely that patches or spkgs will currently be backed out just because they break Cygwin, though if that is not true, that would make this job much easier and I would be very grateful. Luckily, Mike Hansen already had this error (almost assuredly the same one) in 4.7.alpha3 - see this sage-devel thread. So I think that is the place to look. He thought it was the new error handling or the Pari upgrade, but the message sounds more like Pari itself </uninformed opinion>). I'd love to try a better terminal - William also had suggested one at Sage Days 31 - but I've only been really using Cygwin for maybe a week, and so I wouldn't even know how to ask Cygwin to use a different shell. Cut-and-paste does not work, as far as I've been able to tell. |
comment:5
Replying to @kcrisman:
Okay, that's a 1.5 MB file, so I am just posting a link. http://sage.math.washington.edu/home/kcrisman/real_mpfr.c This would be so great if it was possible to track down without too much trouble. |
comment:6
As another (possibly unrelated) data point, #6743 has two patches which change the behavior of sage/rings/complex_double.pyx to get Sage to start (well, a year or two ago). |
comment:7
I put in print statements at every conceivable place. Here is as far as it gets:
Since
so Also attaching screenshot of the traceback. |
Screenshot of last bits of backtrace from sage -gdb |
comment:8
Attachment: Screen shot 2011-06-29 at 9.19.14 PM.png A little further "print"-ing revealed that that cgetr is the problem. By the way, What does
mean? Does this mean that the Pari float will always have the same precision no matter what? |
comment:9
I'm going to try a few other things and then stop for now. But hopefully this helps. |
comment:10
Trying even Another data point: |
comment:11
I have now confirmed this with the released 4.7.1.alpha3 on both XP and Win7. It is very reproducible, always the same place. |
comment:12
Another update: commenting out everything about initializing the Pynac I doesn't help, because there is another place in initialization this is used:
which also causes the identical problem. And |
comment:13
Some things to try:
|
comment:14
I tried 2. first. Not very exciting.
I couldn't get anything out of it that I hadn't seen before. Again, knowing how to test whether libpari is working at all would be really helpful. The files in local/lib/ certainly exist, at any rate, and they are the ones created when I ./sage -f'ed it just now. |
comment:15
I can't get 1. to install on Cygwin. Seems like a linking order error or something, see #11130. |
comment:16
Replying to @kcrisman:
First "result" (i.e., I don't know yet why Debugging this bottom-up, according to your nice screen shot the segfault originates from: static void
err_init(void)
{
/* make sure pari_err msg starts at the beginning of line */
if (!pari_last_was_newline()) pari_putc('\n');
pariOut->flush(); /***** THIS SEGFAULTS *****/
pariErr->flush();
pariOut = pariErr;
term_color(c_ERR);
} So obviously PARI error number 14 is " For the moment, it's up to someone else to donate his/her 2 ct or more... ;-) |
comment:17
I have no idea why if bot:
return # pari already initialized. There are a few things that might be relevant here:
|
comment:18
Replying to @nexttime:
Thanks, Leif - that seems very reasonable. Unfortunately I sort of destroyed my installations trying to do #11130 and I'm not sure how to fix that. I didn't know what the I'll try this when I get a chance. |
comment:19
It's not far enough along to try these, but here's something naive.
So it looks like the GEN gets defined before the PariInstance - is that a problem for some reason? Again, this is totally naive, and probably wrong since this works everywhere else. |
comment:20
Replying to @kcrisman:
I don't know how you managed that ;-) but you should be able to just reinstall the "old" PARI (2.4.3.alpha.p7) at least (assuming you also have a Sage branch without #11130's patches applied, though these only change doctests IIRC). If you think something may get mixed up with a previous installation, you can also $ rm -rf $SAGE_ROOT/local/include/pari/
$ rm $SAGE_ROOT/local/lib/libpari*
$ rm $SAGE_ROOT/local/bin/{libpari,gp}* before reinstalling the PARI package.
No idea what the
No. The weird trailer just explicitly uses the one and only global " |
comment:21
Replying to @jdemeyer:
We compile PARI with |
Segfault with #11130 applied |
comment:22
Attachment: Pari-2.5.0Segfault.png Latest screenshot shows that the upgrade of Pari in #11130 causes a slightly different segfault backtrace, but still along the same lines of what Leif is suggesting and nearly the same as before.
is line 86 in level1.h, unless there are patches in Sage, and with the same two-line offset the |
comment:23
Okay, inserting appropriate print statements gives
which can be interpreted as
So apparently |
comment:42
You are correct, I didn't look closely enough. Should have had a check digit :)
So now we just need that import hook thing Robert Bradshaw talked about to find out where this could have changed in between. |
comment:43
Well, this doesn't happen in any of the other files where In fact, |
comment:44
Well, some random pointer might corrupt PARI's stack variables as well. But dumping the values of these variables whenever some module gets imported should help narrowing the place where this or similar happens. |
comment:45
Just before the Then we have zeros, also in the other things while importing CDF. But the next time the deep copy in gen.pyx is called, avma is back to normal, down to 588 (later up to 592 when a So it seems that it might indeed be happening one of those places where Random? But why is it so reliable then, and on different computers/versions of Windows? (Unless the importing of randstate did it, but I don't think that's what you meant, and I don't think this has The real problem is that I can't dump values of these variables while the pyx files are being imported, because editing the pyx file Really needing that import hook thingie. |
comment:46
This has reappeared in the discussion to #12104. Leif has a patch to get Cython files to say where they have problems importing somewhere, hopefully will be of use. |
comment:47
Replying to @kcrisman:
these global variables in Windows DDLs... IMHO they need a special treatment: search for "global" here: perhaps this is a source of all this blues. |
This comment has been minimized.
This comment has been minimized.
comment:49
Still a problem. But:
This is on XP, after commenting out the inits in sage/symbolic/pynac.pyx and sage/all.py. So we just need to track down the problem. |
comment:50
@jpflori - any ideas on this one? |
comment:51
I remember doing something with the symbolic i some time ago, potentially while updating pynac. |
comment:52
This was here #12950 comment:11 but seems unrelated at first sight. |
comment:53
No, this is quite different, I think. You might as well read the long list of updates here first - it was quite an education even doing all this, though I was ultimately woefully unsuccessful. |
comment:54
This is not showing on on Cygwin on XP with the current status of building, nor apparently on Windows 7 (JP, can you confirm this). Maybe we should close this, though it's frustrating not to know what the problem was. |
comment:55
No, I did not got that error on my Windows 7 install. |
comment:56
I doubt it. Since neither of us is seeing this currently, I'll mark it to close, though if it ever happens again at least this info is here for posterity! |
Reviewer: Karl-Dieter Crisman, Jean-Pierre Flori |
comment:58
The bug in #11116 only happens on one arch, and potentially with only a few versions of Sage. |
comment:59
It's true. At the same time, it wasn't just me - Mike Hansen had this traceback well over a year ago. It is possible it was only ever on XP, who knows. |
comment:60
Replying to @kcrisman:
AFAIR, I saw this on my 32-bit Win7, too. IMHO, it's a Cygwin improvement that is to credit. By the way, I have strange problems with my new 64-bit Win7, Sage install does not get past bzip2. Or is bzip2 supposed to come from Cygwin natively? Perhaps the toolchain is broken? I use the latest Cygwin. Does it still need a manual fix in that libtool or autoconf or what was that? |
comment:61
Replying to @dimpase:
Did not encounter that problem, but I had the Cygwin bzip2 package installed before building Sage.
I don't know... the problem was that updating from the gcc4 default package (4.3.stg) to the 4.5.stg "forgot" to update some pathes in configuration files in the postinst script. |
comment:63
I've encountered exactly this issue trying to import sage, which I finally got to build after a number of other fixes (not all of which I've posted patches for yet). Since this ticket has already been closed and is quite long, should I open a new one? Or just reopen this one? It appears to be the exact same issue--I'm getting a segfault at the line
in real_mpfr.pyx. |
comment:64
I suggest to open a new ticket. |
In both Windows XP and Window 7 it is now possible (again) to build Sage on Cygwin. However, Sage has a segmentation fault in Pari upon startup.
This happens in initalizing the Pynac i (
init_pynac_I
in sage/symbolic/pynac.pyx), but the final thing is that the mpfr number 1.00000000000 causes the segfault upon running the._pari_()
method. Suggestions as to why that would be - and a potential fix - are welcome.CC: @dimpase @mwhansen @jdemeyer @jpflori
Component: porting: Cygwin
Keywords: pari
Reviewer: Karl-Dieter Crisman, Jean-Pierre Flori
Issue created by migration from https://trac.sagemath.org/ticket/11551
The text was updated successfully, but these errors were encountered: