Opened 8 years ago

Closed 8 years ago

#15072 closed defect (fixed)

sage --version hangs on MacOS

Reported by: aschilling Owned by:
Priority: blocker Milestone: sage-5.12
Component: scripts Keywords:
Cc: Merged in: sage-5.12.beta4
Authors: Volker Braun Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by vbraun)

sage --version hangs in sage-5.12.beta1 on MacOS. It still works with sage-5.11.

The sage script uses

sed -n -e 's/.*\(Sage Version.*Date: [0-9-]*\).*/\1/p' ./sage-banner

which hangs. This is probably caused by #14733.

This causes the sage-combinat script to fail.

Apply trac_15072_OSX_sed_workaround.patch to the SAGE_ROOT repo.

Attachments (1)

trac_15072_OSX_sed_workaround.patch (703 bytes) - added by vbraun 8 years ago.
Updated patch

Download all attachments as: .zip

Change History (15)

comment:1 Changed 8 years ago by aschilling

  • Description modified (diff)

comment:2 Changed 8 years ago by aschilling

  • Description modified (diff)

comment:3 Changed 8 years ago by vbraun

See also https://groups.google.com/d/msg/sage-release/TbSd9Lm5EHE/YjcphaIJ_nwJ

Though it did work on the buildbot, so there must be something specific to the OSX machines where it fails.

comment:4 Changed 8 years ago by vbraun

On bsd.math:

cloud:~ vbraun$ cat sage-banner 
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 5.12.beta2, Release Date: 2013-08-20                  │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
cloud:~ vbraun$ sed -n -e 's/.*\(Sage Version.*Date: [0-9-]*\).*/\1/p' ./sage-banner
Sage Version 5.12.beta2, Release Date: 2013-08-20
cloud:~ vbraun$ echo $LANG

cloud:~ vbraun$ LANG=C sed -n -e 's/.*\(Sage Version.*Date: [0-9-]*\).*/\1/p' ./sage-banner
Sage Version 5.12.beta2, Release Date: 2013-08-20
cloud:~ vbraun$ LANG=fr sed -n -e 's/.*\(Sage Version.*Date: [0-9-]*\).*/\1/p' ./sage-banner
Sage Version 5.12.beta2, Release Date: 2013-08-20
cloud:~ vbraun$ LANG=en_US sed -n -e 's/.*\(Sage Version.*Date: [0-9-]*\).*/\1/p' ./sage-banner
^C

The last one hangs, sed on OSX has apparently some serious braindamage.

Last edited 8 years ago by vbraun (previous) (diff)

comment:5 Changed 8 years ago by jdemeyer

  • Component changed from PLEASE CHANGE to porting

comment:6 follow-up: Changed 8 years ago by jdemeyer

Proposal: run

export LC_ALL=C

before running that sed command.

comment:7 follow-up: Changed 8 years ago by vbraun

  • Component changed from porting to PLEASE CHANGE

More discussion here, apparently there are a number of issues with sed on OSX 10.8: https://github.com/mxcl/homebrew/pull/13787

Just LC_CTYPE=C is enough, so I'll patch it with that.

comment:8 Changed 8 years ago by vbraun

  • Authors set to Volker Braun
  • Component changed from PLEASE CHANGE to scripts
  • Description modified (diff)
  • Status changed from new to needs_review

comment:9 in reply to: ↑ 6 Changed 8 years ago by aschilling

Replying to jdemeyer:

Proposal: run

export LC_ALL=C

before running that sed command.

That seems to work!

comment:10 in reply to: ↑ 7 Changed 8 years ago by jdemeyer

  • Status changed from needs_review to needs_work

Replying to vbraun:

Just LC_CTYPE=C is enough, so I'll patch it with that.

I would use LC_ALL since that overrides LC_CTYPE (in case both are set). The following still hangs:

LC_CTYPE=C LC_ALL=en_US sed -n -e 's/.*\(Sage Version.*Date: [0-9-]*\).*/\1/p' ./sage-banner

comment:11 Changed 8 years ago by jdemeyer

Also, in the comment OSX 10.8 is inaccurate, as it occurs also with OSX 10.6

Changed 8 years ago by vbraun

Updated patch

comment:12 follow-up: Changed 8 years ago by vbraun

  • Status changed from needs_work to needs_review

I hope OSX doesn't set LC_ALL by default, that would be even more WTF. I would put it into the category of settings that ought to break things since you explicitly asked for it to be broken.

In any case, I switched to overriding LC_ALL and don't refer to 10.8 any more.

comment:13 in reply to: ↑ 12 Changed 8 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to positive_review

Replying to vbraun:

I hope OSX doesn't set LC_ALL by default

I was thinking that a user might have set it.

comment:14 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.12.beta4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.