Sage 5.0 crashing, is unusable

302 views
Skip to first unread message

Jim Clark

unread,
May 16, 2012, 7:11:05 PM5/16/12
to sage-s...@googlegroups.com
Hello sage team.

I have just downloaded and installed Sage 5.0 on my system:

Mac OS X 10.6.8

I downloaded sage-5.0-OSX-64bit-10.6-x86_64-Darwin.dmg.

It keeps crashing and is unusable.

Here is a simple session:

----------------------------------------------------------------------
| Sage Version 5.0, Release Date: 2012-05-14 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: # Feather parameters
sage: L_lv = 1300 # length of leading vane in microns
sage: L_tv = 2300 # length of trailing vane
sage: L_tot = L_lv + L_tv
sage: shaft_cenx = L_lv # center of shaft
sage: shaft_ceny = 0
sage: R_shaft = 185 # radius of shaft
sage: dx = 10 # nominal spacing between grid points
sage: T_v1 = 10 # thickness of vane at edge
sage: T_v2 = 20 # thickness near center
sage: L_planar_lv = int(L_lv * .75) # length of planar segment of vane

------------------------------------------------------------------------
Unhandled SIGILL: An illegal instruction occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
------------------------------------------------------------------------
/Applications/sage/spkg/bin/sage: line 312: 1513 Illegal instruction sage-ipython "$@" -i
logout


I'm going to reinstall sage 4.8; I can't get any work done with 5.0.

Jim Clark

Jim Clark

unread,
May 16, 2012, 7:31:37 PM5/16/12
to sage-s...@googlegroups.com
Actually, this behavior is so severe, I can't imagine it escaped the attention of testers.

I'm going to download sage 5.0 again, suspecting that my downloaded file is defective.

Please stand by...

Jim

William Stein

unread,
May 16, 2012, 7:43:20 PM5/16/12
to sage-s...@googlegroups.com
On Wed, May 16, 2012 at 4:31 PM, Jim Clark <jimfort...@earthlink.net> wrote:
> Actually, this behavior is so severe, I can't imagine it escaped the attention of testers.
>
> I'm going to download sage 5.0 again, suspecting that my downloaded file is defective.
>
> Please stand by...
>
> Jim
> On May 16, 2012, at 4:11 PM, Jim Clark wrote:
>
>> Hello sage team.
>>
>> I have just downloaded and installed Sage 5.0 on my system:
>>
>> Mac OS X 10.6.8
>>
>> I downloaded sage-5.0-OSX-64bit-10.6-x86_64-Darwin.dmg.

Do you have a 6-4bit computer and OS install? The error message means
that there is some sort of architecture mismatch between the binary
and your computer.
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org



--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Jim Clark

unread,
May 16, 2012, 8:14:39 PM5/16/12
to sage-s...@googlegroups.com
On May 16, 2012, at 4:43 PM, William Stein wrote:

>>> I downloaded sage-5.0-OSX-64bit-10.6-x86_64-Darwin.dmg.
>
> Do you have a 6-4bit computer and OS install? The error message means
> that there is some sort of architecture mismatch between the binary
> and your computer.
>
>
Yes, it's a 64-bit computer.

I've been running from sage-4.8-OSX-64bit-10.6-x86_64-Darwin.dmg for months.

Jim

Volker Braun

unread,
May 16, 2012, 8:28:11 PM5/16/12
to sage-s...@googlegroups.com
Which CPU do you have? e.g. the output of the "system_profiler" command.

Jim Clark

unread,
May 16, 2012, 8:30:28 PM5/16/12
to sage-s...@googlegroups.com
Update: I downloaded and installed sage 5.0 again.

The sequence of commands below induces the same SIGILL crash.

I find it hard to blame a defective download.

Are there any other tests I can perform to get to the bottom of this?

Jim
On May 16, 2012, at 4:11 PM, Jim Clark wrote:

Jim Clark

unread,
May 16, 2012, 8:31:31 PM5/16/12
to sage-s...@googlegroups.com
Hardware Overview:

  Model Name: iMac
  Model Identifier: iMac9,1
  Processor Name: Intel Core 2 Duo
  Processor Speed: 2.66 GHz
  Number Of Processors: 1
  Total Number Of Cores: 2
  L2 Cache: 6 MB
  Memory: 2 GB
  Bus Speed: 1.07 GHz
  Boot ROM Version: IM91.008D.B08
  SMC Version (system): 1.36f3
  Serial Number (system): W8905GVT0TF
  Hardware UUID: 9D23EB65-097B-5851-8E10-79F393005D7A

Justin C. Walker

unread,
May 16, 2012, 8:36:22 PM5/16/12
to sage-s...@googlegroups.com

On May 16, 2012, at 16:11 , Jim Clark wrote:

> Hello sage team.
>
> I have just downloaded and installed Sage 5.0 on my system:
>
> Mac OS X 10.6.8
>
> I downloaded sage-5.0-OSX-64bit-10.6-x86_64-Darwin.dmg.
>
> It keeps crashing and is unusable.

FWIW, I built from source (same OS, different hardware: both Dual 6-core Xeon and 4-core Core i7 processors), and your snippet runs w/o problems for me.

I'll try downloading the .dmg and see what happens with that.

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds
--------
If you're not confused,
You're not paying attention
--------



Jim Clark

unread,
May 16, 2012, 8:39:20 PM5/16/12
to sage-s...@googlegroups.com
On May 16, 2012, at 4:11 PM, Jim Clark wrote:

> I have just downloaded and installed Sage 5.0 on my system:
>
> Mac OS X 10.6.8
>
> I downloaded sage-5.0-OSX-64bit-10.6-x86_64-Darwin.dmg.
>
> It keeps crashing and is unusable.

Here's where I first experienced the problem.

In a long piece of code running in the notebook, the following line works:

pts.show(axes_labels = (r"$x (\mu)$", r"$y (\mu)$"), figsize = (8, 2))

I changed the 2 in the figsize parameter to 1.5:

pts.show(axes_labels = (r"$x (\mu)$", r"$y (\mu)$"), figsize = (8, 1.5))

and instead of a plot, I get


------------------------------------------------------------------------
Unhandled SIGILL: An illegal instruction occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
————————————————————————————————————

and in the Terminal window from which I invoked notebook() is the messge:

2012-05-16 17:33:43-0700 [HTTPChannel,3,127.0.0.1]
2012-05-16 17:36:28-0700 [HTTPChannel,3,127.0.0.1] got EOF subprocess must have crashed...
2012-05-16 17:36:28-0700 [HTTPChannel,3,127.0.0.1]

The notebook keeps running and I seem to be able to exit from the notebook and from sage normally.

Is there a log file somewhere that provides more data?

Jim

Volker Braun

unread,
May 16, 2012, 9:30:19 PM5/16/12
to sage-s...@googlegroups.com
Its a Penryn Core 2 Duo, should support everything up to SSE4.1.

Can you run "sage -gdb", cause the crash, and then type "bt" into gdb? This will print more detailed information about where it crashes.

D. S. McNeil

unread,
May 16, 2012, 9:38:09 PM5/16/12
to sage-s...@googlegroups.com
I can reproduce this on my 10.6.8 macbook:

sage: int(2)
2
sage: int(2.75)

Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
0x0000000101723ed9 in case1 ()
(gdb) bt
#0 0x0000000101723ed9 in case1 ()
#1 0x0000000103e8bba4 in parsed_string_to_mpfr ()
#2 0x0000000103e8c7fb in mpfr_strtofr ()
Previous frame inner to this frame (gdb could not unwind past this frame)

Since this is the computer I actually use, I keep things in /usr/local
and /opt/local (including copies of gmp), so I tried moving those in
case it was picking up something it shouldn't, but no luck.


Doug

Jim Clark

unread,
May 16, 2012, 10:30:14 PM5/16/12
to sage-s...@googlegroups.com
On May 16, 2012, at 6:30 PM, Volker Braun wrote:

Its a Penryn Core 2 Duo, should support everything up to SSE4.1.

Can you run "sage -gdb", cause the crash, and then type "bt" into gdb? This will print more detailed information about where it crashes.


Here's the transcript:

sage: L_lv = 1300    # length of leading vane in microns
sage:  L_planar_lv = int(L_lv * .75)    # length of planar segment of vane

Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
0x00000001016e3ed9 in case1 ()
(gdb) bt
#0  0x00000001016e3ed9 in case1 ()
#1  0x0000000103e3cba4 in parsed_string_to_mpfr ()
#2  0x0000000103e3d7fb in mpfr_strtofr ()
Previous frame inner to this frame (gdb could not unwind past this frame)
(gdb) 



As D.S. McNeil pointed out, the problem seems to be with int() with a non-integer argument.

I got my provocation of the error down to the two statements shown in the transcript.

Thank you, and good luck!
Jim

Jason Grout

unread,
May 16, 2012, 10:35:46 PM5/16/12
to sage-s...@googlegroups.com
For what it's worth, this works fine on my compiled-from-scratch sage
5.0, macbook pro, 10.6.8:

sage: int(2)
2
sage: int(2.75)
2

Doug, are you using the binary or did you compile your Sage?

Thanks,

Jason

D. S. McNeil

unread,
May 16, 2012, 10:44:10 PM5/16/12
to sage-s...@googlegroups.com
> Doug, are you using the binary or did you compile your Sage?

Deliberately the binary; I've never had problems with a Sage I've
successfully compiled myself. [Haven't compiled 5.0 myself yet on
the Mac, though I did at work today on ubuntu 12.04 and it went fine.
Will probably try overnight.]

This feels sort of like a 32-bit/64-bit issue, and I'm getting some
unexpected results in some directions. Trying to remind myself about
some of the Mac quirks.

FWIW even "sage: 2.3" trips the error for me, so I think pretty much
every mpfr library call will cause troubles.


Doug

D. S. McNeil

unread,
May 16, 2012, 11:11:46 PM5/16/12
to sage-s...@googlegroups.com
I was able to find a case which crashed but doesn't have to crash
Sage. Doesn't tell us much new, but here it is anyway:


sage: 12345678912345678912345678912345678901234567890.
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)

/Users/mcneil/Desktop/<ipython console> in <module>()

/Applications/Sage-5.0-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/Prompts.pyc
in __call__(self, arg)
550
551 # and now call a possibly user-defined print mechanism
--> 552 manipulated_val = self.display(arg)
553
554 # user display hooks can change the variable to be stored in

/Applications/Sage-5.0-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/Prompts.pyc
in _display(self, arg)
576 return IPython.generics.result_display(arg)
577 except TryNext:
--> 578 return self.shell.hooks.result_display(arg)
579
580 # Assign the default display method:

/Applications/Sage-5.0-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/hooks.pyc
in __call__(self, *args, **kw)
139 #print "prio",prio,"cmd",cmd #dbg
140 try:
--> 141 ret = cmd(*args, **kw)
142 return ret
143 except ipapi.TryNext, exc:

/Applications/Sage-5.0-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc
in result_display(ip_self, obj)
150 # IPython's default result_display() uses the
IPython.genutils.Term.cout stream.
151 # See also local/lib/python2.6/site-packages/IPython/hooks.py.
--> 152 print_obj(IPython.genutils.Term.cout, obj)
153
154 def displayhook(obj):

/Applications/Sage-5.0-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc
in print_obj(out_stream, obj)
142 if _check_tall_list_and_print(out_stream, obj):
143 return
--> 144 print >>out_stream, `obj`
145
146 def result_display(ip_self, obj):

/Applications/Sage-5.0-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/rings/real_mpfr.so
in sage.rings.real_mpfr.RealNumber.__repr__
(sage/rings/real_mpfr.c:9440)()

/Applications/Sage-5.0-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/rings/real_mpfr.so
in sage.rings.real_mpfr.RealNumber.str
(sage/rings/real_mpfr.c:11259)()

RuntimeError: Illegal instruction

or under gdb:


sage: 12345678912345678912345678912345678901234567890.

Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
0x0000000101723ec7 in case3 ()
(gdb) bt
#0 0x0000000101723ec7 in case3 ()
#1 0x0000000103e6554f in mpfr_get_str ()
#2 0x0000000103dfac65 in __pyx_pf_4sage_5rings_9real_mpfr_10RealNumber_13str ()


Doug

Volker Braun

unread,
May 17, 2012, 12:08:55 AM5/17/12
to sage-s...@googlegroups.com
This is now http://trac.sagemath.org/sage_trac/ticket/12954

If somebody has the spkg/logs/mpfr-3.1.0.p1.log from within the dmg, please attach it to the ticket. My connection here is too slow to download it.

kcrisman

unread,
May 17, 2012, 9:03:04 AM5/17/12
to sage-s...@googlegroups.com


On Thursday, May 17, 2012 12:08:55 AM UTC-4, Volker Braun wrote:
This is now http://trac.sagemath.org/sage_trac/ticket/12954

If somebody has the spkg/logs/mpfr-3.1.0.p1.log from within the dmg, please attach it to the ticket. My connection here is too slow to download it.

Volker, I'm in the dmg now and there is no spkg/logs directory.

$ pwd
/Volumes/sage-5.0-OSX-64bit-10.6-x86_64-Darwin/sage/spkg
$ ls -a
. build pipestatus
.. gen_html root-spkg-install
README.txt install standard
base installed
bin optional
 
Maybe sage -bdist removes logs?  I have that directory in my built-from-scratch 5.0.

David Kirkby

unread,
May 17, 2012, 9:05:59 AM5/17/12
to sage-s...@googlegroups.com
On 17 May 2012 01:30, Jim Clark <jimfort...@earthlink.net> wrote:
> Update: I downloaded and installed sage 5.0 again.
>
> The sequence of commands below induces the same SIGILL crash.
>
> I find it hard to blame a defective download.

Why not just look at the md5 checksum? That would have saved you
downloading it a second time, and you would be 99.9999999 (not sure
how many 9s) percent sure the file is not corrupted.

Dave

Jim Clark

unread,
May 17, 2012, 10:30:03 AM5/17/12
to sage-s...@googlegroups.com
On May 17, 2012, at 6:05 AM, David Kirkby wrote:

>> Update: I downloaded and installed sage 5.0 again.
>>
>> The sequence of commands below induces the same SIGILL crash.
>>
>> I find it hard to blame a defective download.
>
> Why not just look at the md5 checksum? That would have saved you
> downloading it a second time, and you would be 99.9999999 (not sure
> how many 9s) percent sure the file is not corrupted.

Why? Because I don't know how to apply the checksum to test the downloaded file.

Jim

Keshav Kini

unread,
May 17, 2012, 11:08:44 AM5/17/12
to sage-s...@googlegroups.com
For future reference, run `md5sum <filename>` in a terminal to check the
MD5 sum of a file.

-Keshav

----
Join us in #sagemath on irc.freenode.net !

Jim Clark

unread,
May 17, 2012, 11:21:27 AM5/17/12
to sage-s...@googlegroups.com
On May 17, 2012, at 8:08 AM, Keshav Kini wrote:

>>> Why not just look at the md5 checksum? That would have saved you
>>> downloading it a second time, and you would be 99.9999999 (not sure
>>> how many 9s) percent sure the file is not corrupted.
>>
>> Why? Because I don't know how to apply the checksum to test the downloaded file.
>
> For future reference, run `md5sum <filename>` in a terminal to check the
> MD5 sum of a file.

Thank you Keshav. This is helpful. I will file this away in my list of helpful things to know.
Jim

D. S. McNeil

unread,
May 17, 2012, 11:52:23 AM5/17/12
to sage-s...@googlegroups.com
> For future reference, run `md5sum <filename>` in a terminal to check the
> MD5 sum of a file.

I'm pretty sure it's md5, not md5sum, on OS X (at least in 10.6).


Doug

Keshav Kini

unread,
May 17, 2012, 11:54:27 AM5/17/12
to sage-s...@googlegroups.com
I see. I'm on Linux - here it's md5sum. I didn't realize it might be
different on OS X.

Dima Pasechnik

unread,
May 17, 2012, 6:13:37 PM5/17/12
to sage-s...@googlegroups.com
OSX 10.6.*-era hardware is weird. Some of it is 32-bit only, some of it can run both kernels (when you boot you need to press a combination of keys on the keyboard), some of it is 64-bit.
All of them "can" run 64-bit applications, but I guess this "can" must be taken with a pinch of salt...
I hate to think what kind of problems might arise if the less capable hardware is forced to run something
compiled only for more capable one.

Dima Pasechnik

unread,
May 18, 2012, 1:52:50 PM5/18/12
to sage-s...@googlegroups.com


By the way, I tried the binary sage-5.0-OSX-64bit-10.6-x86_64-Darwin.dmg

on my Mac Air running OSX 10.6.8, and it crashes on

sage: int(2.75)

as already reported. Here is the machine data:

Model Name: MacBook Air

Model Identifier: MacBookAir3,2

Processor Name: Intel Core 2 Duo

Processor Speed: 1.86 GHz

Number of Processors: 1

Total Number of Cores: 2

L2 Cache: 6 MB

Memory: 4 GB

Bus Speed: 1.07 GHz

Boot ROM Version: MBA31.0061.B01

Niles Johnson

unread,
May 18, 2012, 1:59:02 PM5/18/12
to sage-s...@googlegroups.com
I have the same problems.

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro5,3
      Processor Name: Intel Core 2 Duo
      Processor Speed: 2.66 GHz
      Number Of Processors: 1
      Total Number Of Cores: 2
      L2 Cache: 3 MB
      Memory: 4 GB
      Bus Speed: 1.07 GHz
      Boot ROM Version: MBP53.00AC.B03
      SMC Version (system): 1.48f2

Niles Johnson

unread,
May 18, 2012, 2:01:26 PM5/18/12
to sage-s...@googlegroups.com
As with others here, my problems are with 

sage-5.0-OSX-64bit-10.6-x86_64-Darwin.dmg 

kcrisman

unread,
May 18, 2012, 2:12:57 PM5/18/12
to sage-s...@googlegroups.com

How hard would it be for someone to bdist an app and non-app dmg of Sage 5.0 for Intel Core Duo and then just make sure the download page makes this clear?  This would be a good stopgap solution.  Presumably others might download it and then just decide not to bother getting it once it causes problems.


Jeroen Demeyer

unread,
May 18, 2012, 4:36:06 PM5/18/12
to sage-s...@googlegroups.com
I have a fix at #12954 which needs review.

Dima Pasechnik

unread,
May 18, 2012, 6:24:16 PM5/18/12
to sage-s...@googlegroups.com
installing the spkg on the ticket into the culprit binary release appears to cure the problem.
 

Dima Pasechnik

unread,
May 19, 2012, 9:16:29 AM5/19/12
to sage-s...@googlegroups.com
here is a fix:
in SAGE_ROOT (the directiry where Sage startup script, called sage, is), run
this will install a patched MPIR  spkg.
Then run
./sage -b
to rebuild parts of Sage which depend upon MPIR (it takes a while, perhaps 15 minutes or so).

After this, Sage works as it should. The problem appears to be due to Core2 processors 
(e.g. in some Macbooks Air) being unable to run certain instructions that they are expected to run, and so
an executable built on a "better" processor is unaware of this.
 

On Thursday, 17 May 2012 01:11:05 UTC+2, Jim wrote:
Hello sage team.

I have just downloaded and installed Sage 5.0 on my system:

Mac OS X 10.6.8

I downloaded sage-5.0-OSX-64bit-10.6-x86_64-Darwin.dmg.

It keeps crashing and is unusable.

Here is a simple session:

----------------------------------------------------------------------
| Sage Version 5.0, Release Date: 2012-05-14                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: # Feather parameters
sage: L_lv = 1300    # length of leading vane in microns
sage: L_tv = 2300    # length of trailing vane
sage: L_tot = L_lv + L_tv
sage: shaft_cenx = L_lv  # center of shaft
sage: shaft_ceny = 0
sage: R_shaft = 185  # radius of shaft
sage: dx = 10        # nominal spacing between grid points
sage: T_v1 = 10      # thickness of vane at edge
sage: T_v2 = 20      # thickness near center
sage: L_planar_lv = int(L_lv * .75)    # length of planar segment of vane

------------------------------------------------------------------------
Unhandled SIGILL: An illegal instruction occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.

Jim Clark

unread,
May 19, 2012, 1:53:10 PM5/19/12
to sage-s...@googlegroups.com
As original creator of this thread, I followed the process described below.
I confirm that the original problem I reported has been resolved;
sage 5.0 is now usable for my projects.

Thank you Dima and all of the other team members who contributed to this solution!
Jim Clark

kcrisman

unread,
May 19, 2012, 10:34:02 PM5/19/12
to sage-s...@googlegroups.com

here is a fix:
in SAGE_ROOT (the directiry where Sage startup script, called sage, is), run
this will install a patched MPIR  spkg.

I get an interesting warning when doing this on a similar machine.

Successfully installed mpir-2.4.0.p4
cat: /Users/.../sage/VERSION.txt: No such file or directory
Deleting temporary build directory
/Users/.../sage/spkg/build/mpir-2.4.0.p4
Making Python scripts relocatable...
Finished installing mpir-2.4.0.p4.spkg

And indeed, my Sage binary has no VERSION.txt in the SAGE_ROOT directory.

Jim Clark

unread,
May 20, 2012, 12:50:48 AM5/20/12
to sage-s...@googlegroups.com
On May 19, 2012, at 7:34 PM, kcrisman wrote:


here is a fix:
in SAGE_ROOT (the directiry where Sage startup script, called sage, is), run
this will install a patched MPIR  spkg.

I get an interesting warning when doing this on a similar machine.

Successfully installed mpir-2.4.0.p4
cat: /Users/.../sage/VERSION.txt: No such file or directory
Deleting temporary build directory
/Users/.../sage/spkg/build/mpir-2.4.0.p4
Making Python scripts relocatable...
Finished installing mpir-2.4.0.p4.spkg

And indeed, my Sage binary has no VERSION.txt in the SAGE_ROOT directory.
 

I had not noticed the warning when I rebuilt mpir,
but my SAGE_ROOT directory also lacks VERSION.txt 

But when I start sage, it reports:

./sage
----------------------------------------------------------------------
| Sage Version 5.0, Release Date: 2012-05-14                         |

so sage seems to know which version it is. What is the role of VERSION.txt ?

Jim

Reply all
Reply to author
Forward
0 new messages