Boost logo

Boost Users :

Subject: [Boost-users] [Python] exec_file double delete
From: Albert Yiamakis (vkicefire_at_[hidden])
Date: 2016-04-03 07:45:42


Hello,

Working with Boost 1.58, I am using Boost.Python to interpret python
code. eval() and exec() are working as expected, however exec_file
results on a double delete upon finishing reading the script. This can be
observed in the following minimal:

#include <boost/python.hpp>

int main()
{
    Py_Initialize();
    boost::python::exec_file("foo.py");
}

where foo.py contains a single line:

print "hello"

hello is printed on the screen - i.e. the script is completed before the
crash.
Valgrind also finds a number of invalid reads in the exec_file line
before an invalid free/delete.

Is there something I'm missing in exec_file usage, or do you think there
might be a mismatch of dependencies? (using boost and python both from my
package manager). Thank you,

Albert


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net