sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.35k stars 460 forks source link

Failure in "R --version" test in sage/misc/interpreter.py #14042

Closed jdemeyer closed 11 years ago

jdemeyer commented 11 years ago

This happens on some OS X installations:

sage -t  --long -force_lib devel/sage/sage/misc/interpreter.py
dyld: Library not loaded: /Users/buildbot/sage-5.2/local/lib/libreadline.6.2.dylib
  Referenced from: /Users/buildbot/build/sage/bsd-1/bsd_upgrade_5.2/build/sage-5.7.beta2/local/lib/R//lib/libR.dylib
  Reason: image not found
sh: line 1: 13937 Trace/BPT trap          R --version
**********************************************************************
File "/Users/buildbot/build/sage/bsd-1/bsd_upgrade_5.2/build/sage-5.7.beta2/devel/sage-main/sage/misc/interpreter.py", line 189:
    sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) == 0
Expected:
    True
Got:
    False
**********************************************************************

The problem is that split() doesn't do what was intented:

sage: cmd="R --version"
sage: cmd.split(' |\n\t;&',1)
['R --version']

Component: misc

Author: John Palmieri

Reviewer: Jeroen Demeyer

Merged: sage-5.7.beta3

Issue created by migration from https://trac.sagemath.org/ticket/14042

kcrisman commented 11 years ago
comment:1

Is this a specific version of OS X that causes the problem? I haven't seen this on 10.7 or 10.4.

$ ./sage -t --long -force_lib devel/sage/sage/misc/interpreter.py
sage -t --long -force_lib "devel/sage/sage/misc/interpreter.py"
     [25.6 s]

----------------------------------------------------------------------
All tests passed!
Total time for all tests: 25.7 seconds
jdemeyer commented 11 years ago
comment:2

It's on OS X 10.6. I haven't determined the actual circumstances under which it occurs, but there is clearly a bug in the use of the split() method.

jdemeyer commented 11 years ago
comment:3

Replying to @kcrisman:

Is this a specific version of OS X that causes the problem?

Perhaps relocating the Sage tree causes the failure.

kcrisman commented 11 years ago
comment:4

You're right about that bad use of split. This doesn't happen on my 10.4 or 10.7.

This is pretty new code, in a 5.7 beta - maybe the people at that patch would know more?

jhpalmieri commented 11 years ago
comment:5

I think that this is a combination of a bad use of split and Sage not relocating correctly. On my OS X 10.8.2 box, I see

sage -t  "devel/sage/sage/misc/interpreter.py"              
dyld: Library not loaded: /Users/palmieri/Desktop/Sage_stuff/sage_builds/clean/sage-5.7.beta1/local/lib/libgomp.1.dylib
  Referenced from: /Users/palmieri/Desktop/Sage_stuff/sage_builds/sage-5.7.beta1/local/lib/R//bin/exec/R
  Reason: image not found

But notice that the referenced library is supposed to be in sage_builds/clean/... while Sage has actually been moved to sage_builds/....

So: the use of split should be fixed here. The rest of this is perhaps covered by #9668.

jhpalmieri commented 11 years ago
comment:6

Attachment: trac_14042.patch.gz

I think this patch should do it.

jdemeyer commented 11 years ago
comment:7

Replying to @jhpalmieri:

The rest of this is perhaps covered by #9668.

I doubt it, that seems to be a different issue.

jdemeyer commented 11 years ago

Author: John Palmieri

jdemeyer commented 11 years ago

Reviewer: Jeroen Demeyer

jdemeyer commented 11 years ago

Merged: sage-5.7.beta3