#9386: sage-native-execute leaves traces of sage
-------------------------------------+-------------------------------------
Reporter: nbruin | Owner: tbd
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: packages: | Resolution:
standard | Merged in:
Keywords: | Reviewers:
Authors: Thierry Monteil | Work issues:
Report Upstream: N/A | Commit:
Branch: | 920c897ec3c439d772f7dfef1a420fb9aec0baea
u/tmonteil/sage_native_execute_leaves_traces_of_sage| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by nbruin):
This goes a long way towards reconstructing the starting environment. The
main thing I am worried about is that a lot of variables are "restored" by
unsetting them, regardless of whether they had a previous value.That could
break things.
That makes me wonder whether we should do something like the following at
the start of sage:
{{{
SAGE_OLD_ENV=`env | base64`
}}}
and restore it by something like
{{{
{echo $SAGE_OLD_ENV | base64 > /tmp/temp_sage_env} ; . /tmp/temp_sage_env
}}}
This doesn't actually work, but I hope you get the idea. If we go this
route we should probably make a python script "store_environment", and
make `sage-native-execute` a python script that restores the environment.
I'm not sure if there are some unexpected security concerns involved.
In fact, we should probably do this all on C-level with tiny programs,
where we can use first the `extern char **environ` pointer to get the
whole (pristine) environment, and later reconstruct it and use `execle` or
similar to start the new process in the appropriately restored
environment. The difficult part is finding an appropriate place to store
the presage environment ...
I'd be fine with a more piecemeal solution as proposed here, because at
least it will significantly improve the situation.
--
Ticket URL: <http://trac.sagemath.org/ticket/9386#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.