{"issue":{"title":"Fix plug-in loader leak","milestone":null,"user":{"id":100574,"login":"thomas-moulard","url":"https://api.github.com/users/thomas-moulard","avatar_url":"https://secure.gravatar.com/avatar/e877416f9691734f15e95c29bddde918?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"e877416f9691734f15e95c29bddde918"},"created_at":"2010-12-29T00:35:58Z","labels":[],"state":"open","updated_at":"2011-12-19T11:46:29Z","id":496029,"html_url":"https://github.com/jrl-umi3218/dynamic-graph/issues/11","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"closed_at":null,"body":"Plug-in loader does not free the memory correctly. Fix that.\r\n\r\nThis problem is revealed by running the \"interpreter\" test (for now in topic/tests):\r\n<pre>\r\n==32373== \r\n==32373== HEAP SUMMARY:\r\n==32373==     in use at exit: 197 bytes in 3 blocks\r\n==32373==   total heap usage: 999 allocs, 996 frees, 107,988 bytes allocated\r\n==32373== \r\n==32373== Searching for pointers to 3 not-freed blocks\r\n==32373== Checked 168,572 bytes\r\n==32373== \r\n==32373== 20 bytes in 1 blocks are still reachable in loss record 1 of 3\r\n==32373==    at 0x402425F: calloc (vg_replace_malloc.c:467)\r\n==32373==    by 0x420C105: _dlerror_run (dlerror.c:142)\r\n==32373==    by 0x420BB40: dlopen@@GLIBC_2.1 (dlopen.c:88)\r\n==32373==    by 0x4094253: dynamicgraph::PluginLoader::loadPlugins() (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4083F6F: dynamicgraph::Interpreter::cmdLoadPlugin(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4090211: boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>::operator()(dynamicgraph::Interpreter*, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x408EAE7: void boost::_bi::list4<boost::_bi::value<dynamicgraph::Interpreter*>, boost::arg<1>, boost::arg<2>, boost::arg<3> >::operator()<boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>, boost::_bi::list3<std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&> >(boost::_bi::type<void>, boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>&, boost::_bi::list3<std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>&, int) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x408CC28: void boost::_bi::bind_t<void, boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>, boost::_bi::list4<boost::_bi::value<dynamicgraph::Interpreter*>, boost::arg<1>, boost::arg<2>, boost::arg<3> > >::operator()<std::string const, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >, std::ostream>(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4089F07: boost::detail::function::void_function_obj_invoker3<boost::_bi::bind_t<void, boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>, boost::_bi::list4<boost::_bi::value<dynamicgraph::Interpreter*>, boost::arg<1>, boost::arg<2>, boost::arg<3> > >, void, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>::invoke(boost::detail::function::function_buffer&, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4087939: boost::function3<void, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>::operator()(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4085262: dynamicgraph::Interpreter::cmd(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x8053ECA: cmd_loadPlugin::test_method() (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/tests/interpreter)\r\n==32373== \r\n==32373== 73 bytes in 1 blocks are still reachable in loss record 2 of 3\r\n==32373==    at 0x4025016: realloc (vg_replace_malloc.c:525)\r\n==32373==    by 0x43C4181: vasprintf (vasprintf.c:86)\r\n==32373==    by 0x43AB21A: asprintf (asprintf.c:37)\r\n==32373==    by 0x420C335: dlerror (dlerror.c:100)\r\n==32373==    by 0x40942F3: dynamicgraph::PluginLoader::loadPlugins() (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4083F6F: dynamicgraph::Interpreter::cmdLoadPlugin(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4090211: boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>::operator()(dynamicgraph::Interpreter*, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x408EAE7: void boost::_bi::list4<boost::_bi::value<dynamicgraph::Interpreter*>, boost::arg<1>, boost::arg<2>, boost::arg<3> >::operator()<boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>, boost::_bi::list3<std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&> >(boost::_bi::type<void>, boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>&, boost::_bi::list3<std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>&, int) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x408CC28: void boost::_bi::bind_t<void, boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>, boost::_bi::list4<boost::_bi::value<dynamicgraph::Interpreter*>, boost::arg<1>, boost::arg<2>, boost::arg<3> > >::operator()<std::string const, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >, std::ostream>(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4089F07: boost::detail::function::void_function_obj_invoker3<boost::_bi::bind_t<void, boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>, boost::_bi::list4<boost::_bi::value<dynamicgraph::Interpreter*>, boost::arg<1>, boost::arg<2>, boost::arg<3> > >, void, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>::invoke(boost::detail::function::function_buffer&, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4087939: boost::function3<void, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>::operator()(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4085262: dynamicgraph::Interpreter::cmd(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373== \r\n==32373== 104 bytes in 1 blocks are still reachable in loss record 3 of 3\r\n==32373==    at 0x4024F20: malloc (vg_replace_malloc.c:236)\r\n==32373==    by 0x401193F: add_to_global (dl-open.c:107)\r\n==32373==    by 0x4011E2C: dl_open_worker (dl-open.c:468)\r\n==32373==    by 0x400D7E5: _dl_catch_error (dl-error.c:178)\r\n==32373==    by 0x40115E5: _dl_open (dl-open.c:554)\r\n==32373==    by 0x420BC0A: dlopen_doit (dlopen.c:67)\r\n==32373==    by 0x400D7E5: _dl_catch_error (dl-error.c:178)\r\n==32373==    by 0x420C09B: _dlerror_run (dlerror.c:164)\r\n==32373==    by 0x420BB40: dlopen@@GLIBC_2.1 (dlopen.c:88)\r\n==32373==    by 0x4094253: dynamicgraph::PluginLoader::loadPlugins() (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4083F6F: dynamicgraph::Interpreter::cmdLoadPlugin(std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373==    by 0x4090211: boost::_mfi::mf3<void, dynamicgraph::Interpreter, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&>::operator()(dynamicgraph::Interpreter*, std::string const&, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)\r\n==32373== \r\n==32373== LEAK SUMMARY:\r\n==32373==    definitely lost: 0 bytes in 0 blocks\r\n==32373==    indirectly lost: 0 bytes in 0 blocks\r\n==32373==      possibly lost: 0 bytes in 0 blocks\r\n==32373==    still reachable: 197 bytes in 3 blocks\r\n==32373==         suppressed: 0 bytes in 0 blocks\r\n==32373== \r\n==32373== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 45 from 11)\r\n--32373-- \r\n--32373-- used_suppression:     45 dl-hack3-cond-1\r\n==32373== \r\n==32373== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 45 from 11)\r\n</pre>\r\n","number":11,"url":"https://api.github.com/repos/jrl-umi3218/dynamic-graph/issues/11","comments":1,"assignee":null},"comment":{"user":{"id":100574,"login":"thomas-moulard","url":"https://api.github.com/users/thomas-moulard","avatar_url":"https://secure.gravatar.com/avatar/e877416f9691734f15e95c29bddde918?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"e877416f9691734f15e95c29bddde918"},"created_at":"2011-12-19T11:46:29Z","updated_at":"2011-12-19T11:46:29Z","id":3202217,"body":"This feature has been replaced by the use or Python import statement.\r\nWONTFIX / closing","url":"https://api.github.com/repos/jrl-umi3218/dynamic-graph/issues/comments/3202217"},"action":"created"}