On Wed, Nov 18, 2015 at 11:00 AM, Paul K <paulclin...@yahoo.com> wrote:

> Hi John,
>
> I ran my sample script through valgrind and it confirmed that the
> leaked memory is what's being used for strings in error messages. I'm
> including relevant parts of valgrind reports for different error
> conditions, but it turned out to be leaking more memory than I thought
> (1.6k per error message). Since the error is generated each time there
> is a check for a non-existing field it adds up quickly as there is no
> other way to check if a field is present on wxlua object or not.
>
> I think the final error message in wxlua_wxLuaBindClass__index is
> unnecessary; without it it would behave exactly as Lua method/field
> calls behave in all other places:
>
> > wx.wxTextCtrl().Absent()
> [string "wx.wxTextCtrl().Absent()"]:1: attempt to call field 'Absent'
> (a nil value)
> > wx.wxTextCtrl():Absent()
> [string "wx.wxTextCtrl():Absent()"]:1: attempt to call method 'Absent'
> (a nil value)
> > wx.wxTextCtrl().Absent
> nil
>
> Here is the simple patch I'm proposing:
>
> diff --git a/wxLua/modules/wxlua/wxlbind.cpp
> b/wxLua/modules/wxlua/wxlbind.cpp
> index 105f603..2523292 100644
> --- a/wxLua/modules/wxlua/wxlbind.cpp
> +++ b/wxLua/modules/wxlua/wxlbind.cpp
> @@ -227,12 +227,6 @@ int LUACALL wxlua_wxLuaBindClass__index(lua_State *L)
>          }
>      }
>
> -    if (!found)
> -    {
> -        wxlua_error(L, wxString::Format(_("wxLua: Unable to call an
> unknown method '%s' on a '%s' type."),
> -            lua2wx(name).c_str(), lua2wx(wxlClass ? wxlClass->name :
> "").c_str()).c_str());
> -    }
> -
>      return result;
>  }
>
> This doesn't fix the leak directly, but it eliminates one of the main
> cases that make the leak much more noticeable.
>
>
That's some nice detective work, I've run it through valgrind as well and
agree that that's where the leak is coming from. But, there really isn't a
lot we can do about it. Lua uses a 'C' style longjmp as the replacement for
a C++ 'throw' which does not call any C++ class destructors.

http://stackoverflow.com/questions/1376085/c-safe-to-use-longjmp-and-setjmp

I do notice (just now) in luaconf.h that if Lua is compiled with a C++
compiler it will use throw instead. This might be a solution for people who
compile the wxLua included Lua, but I don't think anything can be done with
an external default C compiled Lua. Nor is it obvious to me how to actually
control the LUAI_THROW, meaning if I build wxLua and #include Lua with a
C++ compiler, but the actual Lua lib was compiled with a C compiler, wxLua
will surely crash after the first Lua script code error. That makes things
very awkward. I suppose I can force the built-in Lua to be compiled as C++
and if someone specifies an exteral Lua lib in cmake, I'll use the C
compiler.

Your fix is about the best we can do, simply try to create as little new
memory as possible before the error. Actually, we might be able to do a
little better if we create a char* buffer on the stack and see if that gets
cleaned up by the longjmp.

The bottom line for you is to try to see if you can avoid the errors
altogether.

I will try a few things, but failing anything better will use your patch.

Thanks,
    John




> I'm including reports for two conditions: incorrect parameters
> (wx.wxTextCtrl().DiscardEdits()) and non-string as the key
> (wx.wxTextCtrl()[{}]). They follow different branches, but leak about
> the same amount of memory.
>
> Paul.
>
> require "wx"
> local ctrl = wx.wxTextCtrl()
> for _ = 1, 1000 do pcall(function() return ctrl.DiscardEdits() end) end
>
> ==2610== 48,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,788 of 3,796
> ==2610==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2610==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE85BE: wchar_t* std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*,
> std::allocator<wchar_t> const&, std::forward_iterator_tag) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE8736: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x4B5F018: wxString::wxString(char const*, wxMBConv
> const&) (in /home/paul/zbs/bin/linux/x86/libwx.so)
> ==2610==    by 0x4B605CA: lua2wx(char const*) (wxllua.h:41)
> ==2610==    by 0x4BB7969: wxlua_luaL_typename(lua_State*, int)
> (wxllua.cpp:939)
> ==2610==    by 0x4BB50D6: wxlua_argerror(lua_State*, int, wxString
> const&) (wxllua.cpp:169)
> ==2610==    by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x805813A: ??? (in /usr/bin/lua5.1)
> ==2610==
> ==2610== 56,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,789 of 3,796
> ==2610==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2610==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE85BE: wchar_t* std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*,
> std::allocator<wchar_t> const&, std::forward_iterator_tag) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE8736: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x4B5F018: wxString::wxString(char const*, wxMBConv
> const&) (in /home/paul/zbs/bin/linux/x86/libwx.so)
> ==2610==    by 0x4B605CA: lua2wx(char const*) (wxllua.h:41)
> ==2610==    by 0x4BB786F: wxluaT_typename(lua_State*, int) (wxllua.cpp:925)
> ==2610==    by 0x4BB7CE4: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x805813A: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2610==
> ==2610== 68,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,790 of 3,796
> ==2610==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2610==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE768F: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned int) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE77BD: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned
> int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x4E4F2B0: reserve (string.h:1332)
> ==2610==    by 0x4E4F2B0: Alloc (string.h:2195)
> ==2610==    by 0x4E4F2B0: operator+(wchar_t const*, wxString const&)
> (string.cpp:695)
> ==2610==    by 0x4BB7D03: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x805813A: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804BAFF: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804E8F1: ??? (in /usr/bin/lua5.1)
> ==2610==
> ==2610== 72,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,791 of 3,796
> ==2610==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2610==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE768F: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned int) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE77BD: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned
> int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x4E4F1D8: reserve (string.h:1332)
> ==2610==    by 0x4E4F1D8: Alloc (string.h:2195)
> ==2610==    by 0x4E4F1D8: operator+(wxString const&, wchar_t const*)
> (string.cpp:663)
> ==2610==    by 0x4BB7D22: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x805813A: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804BAFF: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804E8F1: ??? (in /usr/bin/lua5.1)
> ==2610==
> ==2610== 119,880 bytes in 999 blocks are definitely lost in loss
> record 3,792 of 3,796
> ==2610==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2610==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE768F: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned int) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE77BD: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned
> int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE7B0F: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t> >::append(wchar_t
> const*, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE7C25: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::operator+=(wchar_t const*) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x4B979A7: wxString::operator+=(wchar_t const*)
> (string.h:3237)
> ==2610==    by 0x4BADC68: wxlua_getLuaArgsMsg(lua_State*, int, int)
> (wxlbind.cpp:592)
> ==2610==    by 0x4BB52D3: wxlua_argerrormsg(lua_State*, wxString
> const&) (wxllua.cpp:180)
> ==2610==    by 0x4BB51B7: wxlua_argerror(lua_State*, int, wxString
> const&) (wxllua.cpp:174)
> ==2610==    by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==
> ==2610== 151,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,793 of 3,796
> ==2610==    at 0x402C619: malloc (vg_replace_malloc.c:299)
> ==2610==    by 0x402C79F: realloc (vg_replace_malloc.c:785)
> ==2610==    by 0x4E4EF97: Extend (string.h:3329)
> ==2610==    by 0x4E4EF97: wxString::AsChar(wxMBConv const&) const
> (string.cpp:545)
> ==2610==    by 0x4A61573: wxCStrData::AsChar() const (string.h:4038)
> ==2610==    by 0x4A61542: wxCStrData::operator char const*() const
> (string.h:166)
> ==2610==    by 0x4BB543B: wxlua_argerrormsg(lua_State*, wxString
> const&) (wxllua.cpp:202)
> ==2610==    by 0x4BB51B7: wxlua_argerror(lua_State*, int, wxString
> const&) (wxllua.cpp:174)
> ==2610==    by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x805813A: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2610==
> ==2610== 203,796 bytes in 999 blocks are definitely lost in loss
> record 3,794 of 3,796
> ==2610==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2610==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE768F: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned int) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE77BD: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned
> int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE7D86: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::append(std::basic_string<wchar_t, std::char_traits<wchar_t>,
> std::allocator<wchar_t> > const&) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x5DE7E12: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::operator+=(std::basic_string<wchar_t, std::char_traits<wchar_t>,
> std::allocator<wchar_t> > const&) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x4B908C1: wxString::operator+=(wxString const&)
> (string.h:3222)
> ==2610==    by 0x4BB5355: wxlua_argerrormsg(lua_State*, wxString
> const&) (wxllua.cpp:197)
> ==2610==    by 0x4BB51B7: wxlua_argerror(lua_State*, int, wxString
> const&) (wxllua.cpp:174)
> ==2610==    by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2610==
> ==2610== 292,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,795 of 3,796
> ==2610==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2610==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x4E4F028:
> _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.tcc:140)
> ==2610==    by 0x4E4F028:
> _S_construct_aux<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.h:1692)
> ==2610==    by 0x4E4F028:
> _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.h:1713)
> ==2610==    by 0x4E4F028:
> basic_string<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.tcc:231)
> ==2610==    by 0x4E4F028: wxString (string.h:2271)
> ==2610==    by 0x4E4F028: wxString::Shrink() (string.cpp:562)
> ==2610==    by 0x4E516CA: DoStringPrintfV(wxString&, wxString const&,
> char*) (string.cpp:2119)
> ==2610==    by 0x4E517FE: wxString::DoFormatWchar(wchar_t const*, ...)
> (string.cpp:1893)
> ==2610==    by 0x4BA0259: wxString wxString::Format<wxCStrData, int,
> wxCStrData>(wxFormatString const&, wxCStrData, int, wxCStrData)
> (string.h:2188)
> ==2610==    by 0x4BB516B: wxlua_argerror(lua_State*, int, wxString
> const&) (wxllua.cpp:172)
> ==2610==    by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x805813A: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2610==
> ==2610== 613,536 bytes in 996 blocks are definitely lost in loss
> record 3,796 of 3,796
> ==2610==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2610==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2610==    by 0x4E4F028:
> _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.tcc:140)
> ==2610==    by 0x4E4F028:
> _S_construct_aux<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.h:1692)
> ==2610==    by 0x4E4F028:
> _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.h:1713)
> ==2610==    by 0x4E4F028:
> basic_string<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.tcc:231)
> ==2610==    by 0x4E4F028: wxString (string.h:2271)
> ==2610==    by 0x4E4F028: wxString::Shrink() (string.cpp:562)
> ==2610==    by 0x4E516CA: DoStringPrintfV(wxString&, wxString const&,
> char*) (string.cpp:2119)
> ==2610==    by 0x4E51739: wxString::DoPrintfWchar(wchar_t const*, ...)
> (string.cpp:1944)
> ==2610==    by 0x4BBB1B6: int wxString::Printf<wxCStrData, wxCStrData,
> wxCStrData>(wxFormatString const&, wxCStrData, wxCStrData, wxCStrData)
> (string.h:2181)
> ==2610==    by 0x4BB53EC: wxlua_argerrormsg(lua_State*, wxString
> const&) (wxllua.cpp:201)
> ==2610==    by 0x4BB51B7: wxlua_argerror(lua_State*, int, wxString
> const&) (wxllua.cpp:174)
> ==2610==    by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int)
> (wxllua.cpp:1093)
> ==2610==    by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*)
> (wxcore_controls.cpp:8270)
> ==2610==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2610==    by 0x805813A: ??? (in /usr/bin/lua5.1)
> ==2610==
> ==2610== LEAK SUMMARY:
> ==2610==    definitely lost: 1,628,352 bytes in 9,061 blocks
> ==2610==    indirectly lost: 3,264 bytes in 75 blocks
> ==2610==      possibly lost: 247,502 bytes in 2,140 blocks
>
> require "wx"
> local ctrl = wx.wxTextCtrl()
> for _ = 1, 1000 do pcall(function() return ctrl[{}] end) end
>
> ==2635== 36,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,786 of 3,792
> ==2635==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2635==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x5DE85BE: wchar_t* std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*,
> std::allocator<wchar_t> const&, std::forward_iterator_tag) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x5DE8736: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x4B5F018: wxString::wxString(char const*, wxMBConv
> const&) (in /home/paul/zbs/bin/linux/x86/libwx.so)
> ==2635==    by 0x4B605CA: lua2wx(char const*) (wxllua.h:41)
> ==2635==    by 0x4BB7969: wxlua_luaL_typename(lua_State*, int)
> (wxllua.cpp:939)
> ==2635==    by 0x4BABB39: wxlua_wxLuaBindClass__index(lua_State*)
> (wxlbind.cpp:143)
> ==2635==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F567: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8056783: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8057A00: ??? (in /usr/bin/lua5.1)
> ==2635==
> ==2635== 56,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,787 of 3,792
> ==2635==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2635==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x5DE85BE: wchar_t* std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*,
> std::allocator<wchar_t> const&, std::forward_iterator_tag) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x5DE8736: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x4B5F018: wxString::wxString(char const*, wxMBConv
> const&) (in /home/paul/zbs/bin/linux/x86/libwx.so)
> ==2635==    by 0x4B605CA: lua2wx(char const*) (wxllua.h:41)
> ==2635==    by 0x4BABAFE: wxlua_wxLuaBindClass__index(lua_State*)
> (wxlbind.cpp:143)
> ==2635==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F567: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8056783: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8057A00: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2635==
> ==2635== 82,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,788 of 3,792
> ==2635==    at 0x402C619: malloc (vg_replace_malloc.c:299)
> ==2635==    by 0x402C79F: realloc (vg_replace_malloc.c:785)
> ==2635==    by 0x4E4EF97: Extend (string.h:3329)
> ==2635==    by 0x4E4EF97: wxString::AsChar(wxMBConv const&) const
> (string.cpp:545)
> ==2635==    by 0x4A61573: wxCStrData::AsChar() const (string.h:4038)
> ==2635==    by 0x4A61542: wxCStrData::operator char const*() const
> (string.h:166)
> ==2635==    by 0x4BABBFF: wxlua_wxLuaBindClass__index(lua_State*)
> (wxlbind.cpp:143)
> ==2635==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F567: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8056783: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8057A00: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804BAFF: ??? (in /usr/bin/lua5.1)
> ==2635==
> ==2635== 296,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,789 of 3,792
> ==2635==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2635==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x5DE85BE: wchar_t* std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*,
> std::allocator<wchar_t> const&, std::forward_iterator_tag) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x5DE8736: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x4A96C4C: wxString::wxString(char const*) (in
> /home/paul/zbs/bin/linux/x86/libwx.so)
> ==2635==    by 0x4BABB7D: wxlua_wxLuaBindClass__index(lua_State*)
> (wxlbind.cpp:142)
> ==2635==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F567: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8056783: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8057A00: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804BAFF: ??? (in /usr/bin/lua5.1)
> ==2635==
> ==2635== 340,000 bytes in 1,000 blocks are definitely lost in loss
> record 3,790 of 3,792
> ==2635==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2635==    by 0x5DE6386: std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t>
> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t>
> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
> ==2635==    by 0x4E4F028:
> _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.tcc:140)
> ==2635==    by 0x4E4F028:
> _S_construct_aux<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.h:1692)
> ==2635==    by 0x4E4F028:
> _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.h:1713)
> ==2635==    by 0x4E4F028:
> basic_string<__gnu_cxx::__normal_iterator<const wchar_t*,
> std::basic_string<wchar_t> > > (basic_string.tcc:231)
> ==2635==    by 0x4E4F028: wxString (string.h:2271)
> ==2635==    by 0x4E4F028: wxString::Shrink() (string.cpp:562)
> ==2635==    by 0x4E516CA: DoStringPrintfV(wxString&, wxString const&,
> char*) (string.cpp:2119)
> ==2635==    by 0x4E517FE: wxString::DoFormatWchar(wchar_t const*, ...)
> (string.cpp:1893)
> ==2635==    by 0x4B91292: wxString wxString::Format<wxCStrData,
> wxCStrData>(wxFormatString const&, wxCStrData, wxCStrData)
> (string.h:2188)
> ==2635==    by 0x4BABBD3: wxlua_wxLuaBindClass__index(lua_State*)
> (wxlbind.cpp:143)
> ==2635==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F567: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8056783: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8057A00: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F5B7: ??? (in /usr/bin/lua5.1)
> ==2635==
> ==2635== 424,000 bytes in 1,000 blocks are indirectly lost in loss
> record 3,791 of 3,792
> ==2635==    at 0x402C619: malloc (vg_replace_malloc.c:299)
> ==2635==    by 0x402C79F: realloc (vg_replace_malloc.c:785)
> ==2635==    by 0x4E52C07: wxCharTypeBuffer<wchar_t>::extend(unsigned
> int) (buffer.h:324)
> ==2635==    by 0x4E52CF4:
> wxFormatConverterBase<wchar_t>::CopyAllBefore() (strvararg.cpp:378)
> ==2635==    by 0x4E52D4F:
> wxFormatConverterBase<wchar_t>::InsertFmtChar(wchar_t)
> (strvararg.cpp:349)
> ==2635==    by 0x4E52F3C:
> wxFormatConverterBase<wchar_t>::Convert(wchar_t const*)
> (strvararg.cpp:270)
> ==2635==    by 0x4E52291: wxFormatString::AsWChar() (strvararg.cpp:643)
> ==2635==    by 0x4A3D4EE: wxFormatString::operator wchar_t const*()
> const (strvararg.h:220)
> ==2635==    by 0x4B91279: wxString wxString::Format<wxCStrData,
> wxCStrData>(wxFormatString const&, wxCStrData, wxCStrData)
> (string.h:2188)
> ==2635==    by 0x4BABBD3: wxlua_wxLuaBindClass__index(lua_State*)
> (wxlbind.cpp:143)
> ==2635==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F567: ??? (in /usr/bin/lua5.1)
> ==2635==
> ==2635== 436,000 (12,000 direct, 424,000 indirect) bytes in 1,000
> blocks are definitely lost in loss record 3,792 of 3,792
> ==2635==    at 0x402C10B: operator new(unsigned int)
> (vg_replace_malloc.c:327)
> ==2635==    by 0x4E52C38: wxCharTypeBuffer<wchar_t>::extend(unsigned
> int) (buffer.h:334)
> ==2635==    by 0x4E52CF4:
> wxFormatConverterBase<wchar_t>::CopyAllBefore() (strvararg.cpp:378)
> ==2635==    by 0x4E52D4F:
> wxFormatConverterBase<wchar_t>::InsertFmtChar(wchar_t)
> (strvararg.cpp:349)
> ==2635==    by 0x4E52F3C:
> wxFormatConverterBase<wchar_t>::Convert(wchar_t const*)
> (strvararg.cpp:270)
> ==2635==    by 0x4E52291: wxFormatString::AsWChar() (strvararg.cpp:643)
> ==2635==    by 0x4A3D4EE: wxFormatString::operator wchar_t const*()
> const (strvararg.h:220)
> ==2635==    by 0x4B91279: wxString wxString::Format<wxCStrData,
> wxCStrData>(wxFormatString const&, wxCStrData, wxCStrData)
> (string.h:2188)
> ==2635==    by 0x4BABBD3: wxlua_wxLuaBindClass__index(lua_State*)
> (wxlbind.cpp:143)
> ==2635==    by 0x804F1CD: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x804F567: ??? (in /usr/bin/lua5.1)
> ==2635==    by 0x8056783: ??? (in /usr/bin/lua5.1)
> ==2635==
> ==2635== LEAK SUMMARY:
> ==2635==    definitely lost: 826,140 bytes in 6,067 blocks
> ==2635==    indirectly lost: 427,264 bytes in 1,075 blocks
> ==2635==      possibly lost: 243,262 bytes in 2,080 blocks
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> wxlua-users mailing list
> wxlua-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
>
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to