cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

sage subshell is broken in Prefix #535

Closed strogdon closed 5 years ago

strogdon commented 5 years ago

I was tinkering with valgrind in Prefix and discovered that sage -sh is broken.

$ sage -sh
sage-run received unknown option: -sh
usage: sage [options]
Try 'sage -h' for more information.

An strace of sage -sh on Gentoo reveals that sage-run is never called there.

kiwifb commented 5 years ago

Sorry I eliminated that option. Do you need it?

strogdon commented 5 years ago

I see. Probably eliminated since 8.6. That's what was installed on the Gentoo. I don't need it. That was the easiest for me to check SAGE env variables for valgrind. I'm still poking around with the MemoryError. I'll close this now that I know.

kiwifb commented 5 years ago

I eliminated most of the sage variables :) if there are issues with the valgrind setup and sage variables that's a real issue that needs to be addressed.

strogdon commented 5 years ago

I'll let you decide. There may be a work around here. Running

sage -t --long --valgrind ~/usr/lib/python2.7/site-packages/sage/combinat/tableau.py

returns in ~/.sage/valgrind/sage-memcheck.24001

==24001== Memcheck, a memory error detector
==24001== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==24001== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==24001== Command: python /storage/strogdon/gentoo-rap/usr/bin/sage-runtests --serial --long --timeout=172800 --memlimit=3300 --stats_path=/storage/strogdon/gentoo-rap/.sage/timings2.json --optional=dochtml,memlimit,optional,sage /storage/strogdon/gentoo-rap/usr/lib/python2.7/site-packages/sage/combinat/tableau.py
==24001== Parent PID: 23995
==24001==
==24001== FATAL: can't open suppressions file "/storage/strogdon/gentoo-rap/usr/lib/valgrind/sage.supp"

These .supp files are located under ~/usr/share/sage/ext/valgrind/. I may be doing something incorrectly.

strogdon commented 5 years ago

Perhaps I'm not doing the correct thing. On vanilla

./sage -t --long --valgrind src/sage/combinat/tableau.py

returns in ~/.sage/valgrind/sage-memcheck.28269

==28269== Memcheck, a memory error detector
==28269== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==28269== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==28269== Command: python /64bitdev/storage/sage-git_develop/sage/local/bin/sage-runtests --serial --long --timeout=172800 --memlimit=3300 --stats_path=/home/volj/27/strogdon/.sage/timings2.json --optional=dochtml,memlimit,mpir,python2,sage src/sage/combinat/tableau.py
==28269== Parent PID: 28231
==28269==
==28269== FATAL: can't open suppressions file "/64bitdev/storage/sage-git_develop/sage/local/lib/valgrind/sage.supp"

and the *.supp files still cannot be found. So this approach does not run src/bin/sage-valgrind. sage --valgrind does work on vanilla but not in Prefix.

kiwifb commented 5 years ago

I will look into that but I have a feeling you are doing nothing wrong. Things are broken upstream I'd say.

kiwifb commented 5 years ago

Ok sage-valgrind has some SAGE_EXTCODE in it which needs fixing in sage 8.7.beta in s-o-g. But the failure of vanilla may indicate something weirder happening.

kiwifb commented 5 years ago

I pushed a fix for sage-valgrind (and sage-callgrind). It is basically just editing sage-valgrind to replace SAGE_EXTCODE with the right prefix location. You could do it manually rather than a full rebuild.

strogdon commented 5 years ago

The sage-ipython will also have to be located

$ sage --valgrind
Python suppressions not found (not installed?), skipping
Using default flags: --leak-resolution=high --leak-check=full --num-callers=25  --suppressions=/storage/strogdon/gentoo-rap/usr/share/sage/ext/valgrind/pyalloc.supp --suppressions=/storage/strogdon/gentoo-rap/usr/share/sage/ext/valgrind/sage.supp --suppressions=/storage/strogdon/gentoo-rap/usr/share/sage/ext/valgrind/sage-additional.supp
==28684== Memcheck, a memory error detector
==28684== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==28684== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==28684== Command: python sage-ipython -i
==28684== 
/storage/strogdon/gentoo-rap/usr/lib/python-exec/python2.7/python: can't open file 'sage-ipython': [Errno 2] No such file or directory
kiwifb commented 5 years ago

Right. I'll have to inspect other files for this kind of executions.

kiwifb commented 5 years ago

I have reworked things a bit. I hope it is all better behaved now.

strogdon commented 5 years ago

sage --valgrind does now work correctly.

kiwifb commented 5 years ago

Cool.