#147 vba-m gtk losing its config in ubuntu

Unverified
open
None
5
2014-07-06
2014-04-02
Sergio Benjamim
No

Hi!

I'm doing some tests in svn1229, and I realized that vbam-gtk is losing its configuration sometimes. Normally, it happens when:

  • Load a ROM and...
  • Closes the vba-m window

Then when i open it again, i can see that it lost its configuration (I put scale=2x to see it easier). But you have to do this steps several times to happens. In Ubuntu 13.10 this happens very often if I don't use this workaround to disable global menu:

Exec=env UBUNTU_MENUPROXY=0 gvbam %f
(in file /usr/share/applications/gvbam.desktop)

I noticed this problem in Linux Mint 16 Mate too.

I realized that vbam saves its config every time it is closed, even if i don't make any modification in the emulator. Is it the expected behavior?

Where can I start looking, about this? (well, i don't know if i can help more than report this issue...)

Discussion

  • If you open a game, this will change the content of the 'Recent' menu and will of course be saved to file.

    But its definitely not right that the configuration is lost.

     
    • humm, well, but the file ~/.config/gvbam/config does not saves any 'Recent'. I don't know where this recent files are saving (btw, there is a problem with this 'recent' menu, if i open more than 10 ROM's it will not change the list anymore, so i don't know if 'recent' menu and the config file are related).

       
  • I opened gvbam in terminal, and I got a "Segmentation fault (core dumped)" right now, after closes it.

    Opened again, closed, and gvbam continues in the system, i had to kill it in monitor system.

     
  • I'm doing more tests, both in 32 and 64 bits version of ubuntu there is segmentation fault when I closes when run games.

    Tested in gba and gbc games, both have segmentation fault.

    But only in 64 bits i had config loss.

    Maybe we have 2 issues?

     
    Last edit: Sergio Benjamim 2014-04-11
  • Hi,

    I've not been able to reproduce this issue with Ubuntu 13.10 64bits. Can you please provide a backtrace of the crash? To get an useful backtrace please use a non-stripped build.

     
  • Starting program: /home/sergio/Projects/lp/fixes-test/./gvbam
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7fffe81b3700 (LWP 13316)]
    [New Thread 0x7fffe79b2700 (LWP 13317)]
    [New Thread 0x7fffe71b1700 (LWP 13318)]
    [New Thread 0x7fffe69b0700 (LWP 13319)]
    [Thread 0x7fffe69b0700 (LWP 13319) exited]
    [New Thread 0x7fffe69b0700 (LWP 13320)]
    [New Thread 0x7fffe5b32700 (LWP 13321)]
    [New Thread 0x7fffe5114700 (LWP 13322)]
    [New Thread 0x7fffe4913700 (LWP 13323)]
    [New Thread 0x7fffd1040700 (LWP 13324)]
    [Thread 0x7fffe4913700 (LWP 13323) exited]
    [Thread 0x7fffe5114700 (LWP 13322) exited]
    [Thread 0x7fffe69b0700 (LWP 13320) exited]

    Program received signal SIGSEGV, Segmentation fault.
    malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>) at malloc.c:4094
    4094 malloc.c: No such file or directory.
    (gdb) bt

    0 malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>) at malloc.c:4094

    1 0x00007ffff48ed0e1 in _int_malloc (av=0x7ffff4c2d740 <main_arena>, bytes=2048)

    at malloc.c:3379
    

    2 0x00007ffff48ef4d0 in GI_libc_malloc (bytes=2048) at malloc.c:2859

    3 0x00007ffff58b9e6f in g_realloc () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    4 0x00007ffff58d3254 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    5 0x00007ffff58d32a2 in g_string_sized_new () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    6 0x00007ffff58aa5e3 in g_io_channel_write_chars ()

    from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    7 0x00007ffff6589ceb in Glib::IOChannel::write(char const*, long, unsigned long&) ()

    from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1

    8 0x00007ffff6589d3d in Glib::IOChannel::write(Glib::ustring const&) ()

    from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1

    9 0x00000000004583f7 in VBA::Config::File::vSave(std::string const&) ()

    10 0x000000000048b401 in VBA::Window::vSaveConfig(std::string const&) ()

    11 0x00000000004871f4 in VBA::Window::~Window() ()

    12 0x000000000048751a in VBA::Window::~Window() ()

    13 0x000000000045ac27 in main ()

     
  • (gdb) bt full

    0 malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>) at malloc.c:4094

        fb = <optimized out>
        maxfb = 0x7ffff4c2d790 <main_arena+80>
        p = 0xfffff10001225ca0
        nextp = 0x1326d4000
        unsorted_bin = 0x7ffff4c2d798 <main_arena+88>
        first_unsorted = <optimized out>
        nextchunk = 0x1229d9f
        size = 16492674433279
        nextsize = 8448
        prevsize = 16492674420735
        nextinuse = <optimized out>
        bck = <optimized out>
        fwd = <optimized out>
        __func__ = "malloc_consolidate"
    

    1 0x00007ffff48ed0e1 in _int_malloc (av=0x7ffff4c2d740 <main_arena>, bytes=2048)

    at malloc.c:3379
        nb = 2064
        idx = <optimized out>
        bin = <optimized out>
        victim = <optimized out>
        size = <optimized out>
        victim_index = <optimized out>
        remainder = <optimized out>
        remainder_size = <optimized out>
        block = <optimized out>
        bit = <optimized out>
        map = <optimized out>
        fwd = <optimized out>
        bck = <optimized out>
        errstr = 0x0
        __func__ = "_int_malloc"
    

    2 0x00007ffff48ef4d0 in GI_libc_malloc (bytes=2048) at malloc.c:2859

        ar_ptr = 0x7ffff4c2d740 <main_arena>
        victim = 0xde1
        __func__ = "__libc_malloc"
    

    3 0x00007ffff58b9e6f in g_realloc () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    No symbol table info available.

    4 0x00007ffff58d3254 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    No symbol table info available.

    5 0x00007ffff58d32a2 in g_string_sized_new () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    No symbol table info available.
    ---Type <return> to continue, or q <return> to quit---

    6 0x00007ffff58aa5e3 in g_io_channel_write_chars ()

    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
    No symbol table info available.

    7 0x00007ffff6589ceb in Glib::IOChannel::write(char const*, long, unsigned long&) ()

    from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
    No symbol table info available.

    8 0x00007ffff6589d3d in Glib::IOChannel::write(Glib::ustring const&) ()

    from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
    No symbol table info available.

    9 0x00000000004583f7 in VBA::Config::File::vSave(std::string const&) ()

    No symbol table info available.

    10 0x000000000048b401 in VBA::Window::vSaveConfig(std::string const&) ()

    No symbol table info available.

    11 0x00000000004871f4 in VBA::Window::~Window() ()

    No symbol table info available.

    12 0x000000000048751a in VBA::Window::~Window() ()

    No symbol table info available.

    13 0x000000000045ac27 in main ()

    No symbol table info available.

     
  • Now, with cmake -DCMAKE_BUILD_TYPE=Debug

    gdb ./gvbam
    GNU gdb (GDB) 7.6.1-ubuntu
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/...
    Reading symbols from /home/sergio/Projects/lp/fixes-test/gvbam...done.
    (gdb) run
    Starting program: /home/sergio/Projects/lp/fixes-test/./gvbam
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7fffe81b3700 (LWP 16071)]
    [New Thread 0x7fffe79b2700 (LWP 16072)]
    [New Thread 0x7fffe71b1700 (LWP 16073)]
    [New Thread 0x7fffe69b0700 (LWP 16074)]
    [Thread 0x7fffe69b0700 (LWP 16074) exited]
    [New Thread 0x7fffe69b0700 (LWP 16075)]
    [New Thread 0x7fffe5b32700 (LWP 16076)]
    [New Thread 0x7fffe5114700 (LWP 16077)]
    [New Thread 0x7fffe4913700 (LWP 16078)]
    [New Thread 0x7fffd1040700 (LWP 16079)]
    [Thread 0x7fffd1040700 (LWP 16079) exited]
    [Thread 0x7fffe4913700 (LWP 16078) exited]
    [Thread 0x7fffe69b0700 (LWP 16075) exited]

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff48ebc2b in malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>)
    at malloc.c:4094
    4094 malloc.c: No such file or directory.
    (gdb) bt full

    0 0x00007ffff48ebc2b in malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>)

    at malloc.c:4094
        fb = <optimized out>
        maxfb = 0x7ffff4c2d790 <main_arena+80>
        p = 0x132380f
        nextp = 0x0
        unsorted_bin = 0x7ffff4c2d798 <main_arena+88>
        first_unsorted = <optimized out>
        nextchunk = 0x1326b0f
        size = 13056
        nextsize = 0
        prevsize = <optimized out>
        nextinuse = <optimized out>
        bck = 0x7fff000005ff00
        fwd = 0x20000000200
        __func__ = "malloc_consolidate"
    

    1 0x00007ffff48ed0e1 in _int_malloc (av=0x7ffff4c2d740 <main_arena>, bytes=2048)

    at malloc.c:3379
        nb = 2064
        idx = <optimized out>
        bin = <optimized out>
        victim = <optimized out>
        size = <optimized out>
        victim_index = <optimized out>
        remainder = <optimized out>
        remainder_size = <optimized out>
        block = <optimized out>
        bit = <optimized out>
        map = <optimized out>
        fwd = <optimized out>
        bck = <optimized out>
        errstr = 0x0
        __func__ = "_int_malloc"
    

    2 0x00007ffff48ef4d0 in GI_libc_malloc (bytes=2048) at malloc.c:2859

        ar_ptr = 0x7ffff4c2d740 <main_arena>
        victim = 0x7fff000005ff00
        __func__ = "__libc_malloc"
    

    3 0x00007ffff58b9e6f in g_realloc () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    No symbol table info available.

    4 0x00007ffff58d3254 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    No symbol table info available.

    5 0x00007ffff58d32a2 in g_string_sized_new () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

    ---Type <return> to continue, or q <return> to quit---
    No symbol table info available.

    6 0x00007ffff58aa5e3 in g_io_channel_write_chars ()

    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
    No symbol table info available.

    7 0x00007ffff6589ceb in Glib::IOChannel::write(char const*, long, unsigned long&) ()

    from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
    No symbol table info available.

    8 0x00007ffff6589d3d in Glib::IOChannel::write(Glib::ustring const&) ()

    from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
    No symbol table info available.

    9 0x00000000004583f7 in VBA::Config::File::vSave (this=0xa05748, _rsFile=...)

    at /home/sergio/Projects/lp/fixes-test/src/gtk/configfile.cpp:222
        sName = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x9e2918 "[Directories]\n"}}
        poSection = {_M_node = 0xa31870}
        poFile = {pCppObject_ = 0xa39fa0}
    

    10 0x000000000048b401 in VBA::Window::vSaveConfig (this=0xa056a0, _rsFile=...)

    at /home/sergio/Projects/lp/fixes-test/src/gtk/window.cpp:747
    

    No locals.

    11 0x00000000004871f4 in VBA::Window::~Window (this=0xa056a0, __in_chrg=<optimized out="">,

    __vtt_parm=<optimized out>)
    at /home/sergio/Projects/lp/fixes-test/src/gtk/window.cpp:339
    

    No locals.

    12 0x000000000048751a in VBA::Window::~Window (this=0xa056a0, __in_chrg=<optimized out="">,

    __vtt_parm=<optimized out>)
    at /home/sergio/Projects/lp/fixes-test/src/gtk/window.cpp:347
    

    No locals.

    13 0x000000000045ac27 in main (argc=1, argv=0x7fffffffe3a8)

    at /home/sergio/Projects/lp/fixes-test/src/gtk/main.cpp:123
        bShowVersion = false
        oKit = <incomplete type>
        oGroup = <incomplete type>
        sGtkBuilderFile = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x9e23b8 "src/gtk/ui/vbam.ui"}}
        listRemaining = {<std::_Vector_base<Glib::ustring, std::allocator<Glib::ustring> >> = {
            _M_impl = {<std::allocator<Glib::ustring>> = {<__gnu_cxx::new_allocator<Glib::ustring>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
              _M_end_of_storage = 0x0}}, <No data fields>}
        poXml = {pCppObject_ = 0x9e2610}
    

    ---Type <return> to continue, or q <return> to quit---
    poWindow = 0xa056a0
    oContext = <incomplete type="">
    oVersion = <incomplete type="">
    oFileName = <incomplete type="">

     
  • Installed libglibmm-2.4-dbg and libglib2.0-0-dbg:

    gdb ./gvbam
    GNU gdb (GDB) 7.6.1-ubuntu
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/...
    Reading symbols from /home/sergio/Projects/lp/fixes-test/gvbam...done.
    (gdb) run
    Starting program: /home/sergio/Projects/lp/fixes-test/./gvbam
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7fffe81b3700 (LWP 17212)]
    [New Thread 0x7fffe79b2700 (LWP 17213)]
    [New Thread 0x7fffe71b1700 (LWP 17214)]
    [New Thread 0x7fffe69b0700 (LWP 17215)]
    [Thread 0x7fffe69b0700 (LWP 17215) exited]
    [New Thread 0x7fffe69b0700 (LWP 17216)]
    [New Thread 0x7fffe5b32700 (LWP 17217)]
    [New Thread 0x7fffe5114700 (LWP 17218)]
    [New Thread 0x7fffe4913700 (LWP 17219)]
    [Thread 0x7fffe5114700 (LWP 17218) exited]
    [Thread 0x7fffe69b0700 (LWP 17216) exited]

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff48ebc2b in malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>) at malloc.c:4094
    4094 malloc.c: No such file or directory.
    (gdb) bt full

    0 0x00007ffff48ebc2b in malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>) at malloc.c:4094

        fb = <optimized out>
        maxfb = 0x7ffff4c2d790 <main_arena+80>
        p = 0x11e0a3f
        nextp = 0x0
        unsorted_bin = 0x7ffff4c2d798 <main_arena+88>
        first_unsorted = <optimized out>
        nextchunk = 0x11e3b3f
        size = 12544
        nextsize = 274688
        prevsize = <optimized out>
        nextinuse = <optimized out>
        bck = 0x2d2d2d2d2d2d2d00
        fwd = 0x0
        __func__ = "malloc_consolidate"
    

    1 0x00007ffff48ed0e1 in _int_malloc (av=0x7ffff4c2d740 <main_arena>, bytes=2048) at malloc.c:3379

        nb = 2064
        idx = <optimized out>
        bin = <optimized out>
        victim = <optimized out>
        size = <optimized out>
        victim_index = <optimized out>
        remainder = <optimized out>
        remainder_size = <optimized out>
        block = <optimized out>
        bit = <optimized out>
        map = <optimized out>
        fwd = <optimized out>
        bck = <optimized out>
        errstr = 0x0
        __func__ = "_int_malloc"
    

    2 0x00007ffff48ef4d0 in GI_libc_malloc (bytes=2048) at malloc.c:2859

        ar_ptr = 0x7ffff4c2d740 <main_arena>
        victim = 0x2d2d2d2d2d2d2d00
        __func__ = "__libc_malloc"
    

    3 0x00007ffff58b9e6f in g_realloc (mem=<optimized out="">, n_bytes=2048) at /build/buildd/glib2.0-2.38.1/./glib/gmem.c:169

        newmem = <optimized out>
    

    4 0x00007ffff58d3254 in g_string_maybe_expand (string=string@entry=0x7fffd80015a0, len=len@entry=1024) at /build/buildd/glib2.0-2.38.1/./glib/gstring.c:107

    No locals.

    5 0x00007ffff58d32a2 in g_string_sized_new (dfl_size=1024) at /build/buildd/glib2.0-2.38.1/./glib/gstring.c:132

        string = 0x7fffd80015a0
    

    6 0x00007ffff58aa5e3 in g_io_channel_write_chars (channel=0x1301890, buf=0x9ff178 "[Directories]\n", count=14, bytes_written=0x7fffffffde78, error=0x7fffffffde58)

    at /build/buildd/glib2.0-2.38.1/./glib/giochannel.c:2266
        status = <optimized out>
        wrote_bytes = 0
        __PRETTY_FUNCTION__ = "g_io_channel_write_chars"
        __FUNCTION__ = "g_io_channel_write_chars"
    

    ---Type <return> to continue, or q <return> to quit---

    7 0x00007ffff6589ceb in Glib::IOChannel::write (this=this@entry=0xa38f60, buf=<optimized out="">, count=count@entry=14, bytes_written=@0x7fffffffde78: 0)

    at iochannel.cc:606
        gerror = 0x0
        retvalue = <optimized out>
    

    8 0x00007ffff6589d3d in Glib::IOChannel::write (this=0xa38f60, str=...) at iochannel.cc:214

        bytes_written = 0
    

    9 0x00000000004583f7 in VBA::Config::File::vSave (this=0xa047e8, _rsFile=...) at /home/sergio/Projects/lp/fixes-test/src/gtk/configfile.cpp:222

        sName = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0x9ff178 "[Directories]\n"}}
        poSection = {_M_node = 0x9ecfd0}
        poFile = {pCppObject_ = 0xa38f60}
    

    10 0x000000000048b401 in VBA::Window::vSaveConfig (this=0xa04740, _rsFile=...) at /home/sergio/Projects/lp/fixes-test/src/gtk/window.cpp:747

    No locals.

    11 0x00000000004871f4 in VBA::Window::~Window (this=0xa04740, in_chrg=<optimized out="">, vtt_parm=<optimized out="">)

    at /home/sergio/Projects/lp/fixes-test/src/gtk/window.cpp:339
    

    No locals.

    12 0x000000000048751a in VBA::Window::~Window (this=0xa04740, in_chrg=<optimized out="">, vtt_parm=<optimized out="">)

    at /home/sergio/Projects/lp/fixes-test/src/gtk/window.cpp:347
    

    No locals.

    13 0x000000000045ac27 in main (argc=1, argv=0x7fffffffe3a8) at /home/sergio/Projects/lp/fixes-test/src/gtk/main.cpp:123

        bShowVersion = false
        oKit = <incomplete type>
        oGroup = {_vptr.OptionGroup = 0x7ffff67b9190 <vtable for Glib::OptionGroup+16>, map_entries_ = {_M_t = {
              _M_impl = {<std::allocator<std::_Rb_tree_node<std::pair<Glib::ustring const, Glib::OptionGroup::CppOptionEntry> > >> = {<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<Glib::ustring const, Glib::OptionGroup::CppOptionEntry> > >> = {<No data fields>}, <No data fields>}, 
                _M_key_compare = {<std::binary_function<Glib::ustring, Glib::ustring, bool>> = {<No data fields>}, <No data fields>}, _M_header = {
                  _M_color = std::_S_red, _M_parent = 0x9e13b0, _M_left = 0x9e15b0, _M_right = 0x9e13b0}, _M_node_count = 2}}}, gobject_ = 0x9e11e0, 
          has_ownership_ = false}
        sGtkBuilderFile = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x9e1418 "src/gtk/ui/vbam.ui"}}
        listRemaining = {<std::_Vector_base<Glib::ustring, std::allocator<Glib::ustring> >> = {
            _M_impl = {<std::allocator<Glib::ustring>> = {<__gnu_cxx::new_allocator<Glib::ustring>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, 
              _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}
        poXml = {pCppObject_ = 0x9e1670}
        poWindow = 0xa04740
        oContext = {_vptr.OptionContext = 0x7ffff67b9110 <vtable for Glib::OptionContext+16>, gobject_ = 0x9e1110, has_ownership_ = true}
        oVersion = {_vptr.OptionEntry = 0x7ffff67b9150 <vtable for Glib::OptionEntry+16>, 
          GOptionFlags = (Glib::OptionEntry::FLAG_FILENAME | Glib::OptionEntry::FLAG_OPTIONAL_ARG | Glib::OptionEntry::FLAG_NOALIAS | unknown: 4130619776), 
          gobject_ = 0x9e1170}
        oFileName = {_vptr.OptionEntry = 0x7ffff67b9150 <vtable for Glib::OptionEntry+16>, 
          GOptionFlags = (Glib::OptionEntry::FLAG_HIDDEN | Glib::OptionEntry::FLAG_IN_MAIN | Glib::OptionEntry::FLAG_REVERSE | Glib::OptionEntry::FLAG_NO_ARG | Glib::OptionEntry::FLAG_NOALIAS | unknown: 4294959616), gobject_ = 0x9e1440}
    
     
  • My source is a little bit changed, this is the output from the tarball upstream:

    gdb ./gvbam
    GNU gdb (GDB) 7.6.1-ubuntu
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/...
    Reading symbols from /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/gvbam...done.
    (gdb) run
    Starting program: /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/./gvbam
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7fffe81b3700 (LWP 19509)]
    [New Thread 0x7fffe79b2700 (LWP 19510)]
    [New Thread 0x7fffe71b1700 (LWP 19511)]
    [New Thread 0x7fffe69b0700 (LWP 19512)]
    [Thread 0x7fffe69b0700 (LWP 19512) exited]
    [New Thread 0x7fffe69b0700 (LWP 19513)]
    [New Thread 0x7fffe5b32700 (LWP 19514)]
    [New Thread 0x7fffe5114700 (LWP 19515)]
    [New Thread 0x7fffe4913700 (LWP 19516)]
    [Thread 0x7fffe4913700 (LWP 19516) exited]
    [Thread 0x7fffe69b0700 (LWP 19513) exited]

    Program received signal SIGSEGV, Segmentation fault.
    _int_free (av=0x7ffff4c2d740 <main_arena>, p=0xa29ea0, have_lock=0) at malloc.c:3853
    3853 malloc.c: No such file or directory.

    bt full

    0 _int_free (av=0x7ffff4c2d740 <main_arena>, p=0xa29ea0, have_lock=0) at malloc.c:3853

        idx = 1
        fd = <optimized out>
        old = 0xffffffff00a2b9f0
        old_idx = <optimized out>
        size = <optimized out>
        fb = 0x7ffff4c2d750 <main_arena+16>
        nextchunk = <optimized out>
        nextsize = <optimized out>
        nextinuse = <optimized out>
        prevsize = <optimized out>
        bck = <optimized out>
        fwd = <optimized out>
        errstr = 0x0
        locked = 0
        __func__ = "_int_free"
    

    1 0x00007fffee59fd5f in pa_xfree () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so

    No symbol table info available.

    2 0x00007fffee5ce788 in pa_tagstruct_free_data () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so

    No symbol table info available.

    3 0x00007fffee5c3639 in pa_pstream_send_tagstruct_with_creds () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so

    No symbol table info available.

    4 0x00007ffff3f57c84 in pa_stream_disconnect () from /usr/lib/x86_64-linux-gnu/libpulse.so.0

    No symbol table info available.

    5 0x00007ffff7b79a26 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

    No symbol table info available.

    6 0x00007ffff7b4e0ec in SDL_AudioQuit () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

    No symbol table info available.

    7 0x00007ffff7b4cf95 in SDL_QuitSubSystem () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

    No symbol table info available.

    8 0x0000000000498145 in SoundSDL::~SoundSDL (this=0xa03d00, __in_chrg=<optimized out="">)

    at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/common/SoundSDL.cpp:149
        iSave = 0
    

    9 0x00000000004981e4 in SoundSDL::~SoundSDL (this=0xa03d00, __in_chrg=<optimized out="">)

    at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/common/SoundSDL.cpp:152
    

    No locals.

    10 0x000000000052c8f6 in soundShutdown () at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gba/Sound.cpp:488

    No locals.

    11 0x0000000000487a2d in VBA::Window::vUnInitSystem (this=0xa048a0) at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/window.cpp:454

    No locals.

    12 0x00000000004871ce in VBA::Window::~Window (this=0xa048a0, in_chrg=<optimized out="">, vtt_parm=<optimized out="">)

    at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/window.cpp:336
    

    No locals.

    13 0x000000000048751a in VBA::Window::~Window (this=0xa048a0, in_chrg=<optimized out="">, vtt_parm=<optimized out="">)

    at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/window.cpp:346
    

    No locals.

    14 0x000000000045ac27 in main (argc=1, argv=0x7fffffffe368) at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/main.cpp:122

        bShowVersion = false
        oKit = <incomplete type>
        oGroup = {_vptr.OptionGroup = 0x7ffff67b9190 <vtable for Glib::OptionGroup+16>, map_entries_ = {_M_t = {
              _M_impl = {<std::allocator<std::_Rb_tree_node<std::pair<Glib::ustring const, Glib::OptionGroup::CppOptionEntry> > >> = {<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<Glib::ustring const, Glib::OptionGroup::CppOptionEntry> > >> = {<No data fields>}, <No data fields>}, 
                _M_key_compare = {<std::binary_function<Glib::ustring, Glib::ustring, bool>> = {<No data fields>}, <No data fields>}, _M_header = {
                  _M_color = std::_S_red, _M_parent = 0x9e1510, _M_left = 0x9e1710, _M_right = 0x9e1510}, _M_node_count = 2}}}, gobject_ = 0x9e1340, 
          has_ownership_ = false}
        sGtkBuilderFile = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x9e1578 "src/gtk/ui/vbam.ui"}}
        listRemaining = {<std::_Vector_base<Glib::ustring, std::allocator<Glib::ustring> >> = {
            _M_impl = {<std::allocator<Glib::ustring>> = {<__gnu_cxx::new_allocator<Glib::ustring>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, 
              _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}
        poXml = {pCppObject_ = 0x9e17d0}
        poWindow = 0xa048a0
        oContext = {_vptr.OptionContext = 0x7ffff67b9110 <vtable for Glib::OptionContext+16>, gobject_ = 0x9e1270, has_ownership_ = true}
        oVersion = {_vptr.OptionEntry = 0x7ffff67b9150 <vtable for Glib::OptionEntry+16>, 
          GOptionFlags = (Glib::OptionEntry::FLAG_FILENAME | Glib::OptionEntry::FLAG_OPTIONAL_ARG | Glib::OptionEntry::FLAG_NOALIAS | unknown: 4130619776), 
          gobject_ = 0x9e12d0}
        oFileName = {_vptr.OptionEntry = 0x7ffff67b9150 <vtable for Glib::OptionEntry+16>, 
          GOptionFlags = (Glib::OptionEntry::FLAG_HIDDEN | Glib::OptionEntry::FLAG_IN_MAIN | Glib::OptionEntry::FLAG_REVERSE | Glib::OptionEntry::FLAG_NO_ARG | unknown: 4294959616), gobject_ = 0x9e15a0}
    
     
  • gdb ./gvbam
    GNU gdb (GDB) 7.6.1-ubuntu
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/...
    Reading symbols from /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/gvbam...done.
    (gdb) run
    Starting program: /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/./gvbam
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7fffe81b3700 (LWP 20355)]
    [New Thread 0x7fffe79b2700 (LWP 20356)]
    [New Thread 0x7fffe71b1700 (LWP 20357)]
    [New Thread 0x7fffe69b0700 (LWP 20358)]
    [Thread 0x7fffe69b0700 (LWP 20358) exited]
    [New Thread 0x7fffe69b0700 (LWP 20359)]
    [New Thread 0x7fffe5b32700 (LWP 20360)]
    [New Thread 0x7fffe5114700 (LWP 20361)]
    [New Thread 0x7fffe4913700 (LWP 20362)]
    [Thread 0x7fffe4913700 (LWP 20362) exited]
    [Thread 0x7fffe69b0700 (LWP 20359) exited]

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff48ebc2b in malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>) at malloc.c:4094
    4094 malloc.c: No such file or directory.
    (gdb) bt full

    0 0x00007ffff48ebc2b in malloc_consolidate (av=av@entry=0x7ffff4c2d740 <main_arena>) at malloc.c:4094

        fb = <optimized out>
        maxfb = 0x7ffff4c2d790 <main_arena+80>
        p = 0x12f79bf
        nextp = 0x0
        unsorted_bin = 0x7ffff4c2d798 <main_arena+88>
        first_unsorted = <optimized out>
        nextchunk = 0x13052bf
        size = 55552
        nextsize = 0
        prevsize = <optimized out>
        nextinuse = <optimized out>
        bck = 0x12f8a3000
        fwd = 0x12e48f000
        __func__ = "malloc_consolidate"
    

    1 0x00007ffff48ed0e1 in _int_malloc (av=0x7ffff4c2d740 <main_arena>, bytes=2048) at malloc.c:3379

        nb = 2064
        idx = <optimized out>
        bin = <optimized out>
        victim = <optimized out>
        size = <optimized out>
        victim_index = <optimized out>
        remainder = <optimized out>
        remainder_size = <optimized out>
        block = <optimized out>
        bit = <optimized out>
        map = <optimized out>
        fwd = <optimized out>
        bck = <optimized out>
        errstr = 0x0
        __func__ = "_int_malloc"
    

    2 0x00007ffff48ef4d0 in GI_libc_malloc (bytes=2048) at malloc.c:2859

        ar_ptr = 0x7ffff4c2d740 <main_arena>
        victim = 0x12f8a3000
        __func__ = "__libc_malloc"
    

    3 0x00007ffff58b9e6f in g_realloc (mem=<optimized out="">, n_bytes=2048) at /build/buildd/glib2.0-2.38.1/./glib/gmem.c:169

        newmem = <optimized out>
    

    4 0x00007ffff58d3254 in g_string_maybe_expand (string=string@entry=0x7fffd8001740, len=len@entry=1024) at /build/buildd/glib2.0-2.38.1/./glib/gstring.c:107

    No locals.

    5 0x00007ffff58d32a2 in g_string_sized_new (dfl_size=1024) at /build/buildd/glib2.0-2.38.1/./glib/gstring.c:132

        string = 0x7fffd8001740
    

    6 0x00007ffff58aa5e3 in g_io_channel_write_chars (channel=0x12e58b0, buf=0xa09b28 "[Directories]\n", count=14, bytes_written=0x7fffffffde38, error=0x7fffffffde18)

    at /build/buildd/glib2.0-2.38.1/./glib/giochannel.c:2266
        status = <optimized out>
        wrote_bytes = 0
        __PRETTY_FUNCTION__ = "g_io_channel_write_chars"
        __FUNCTION__ = "g_io_channel_write_chars"
    

    7 0x00007ffff6589ceb in Glib::IOChannel::write (this=this@entry=0xa390c0, buf=<optimized out="">, count=count@entry=14, bytes_written=@0x7fffffffde38: 0)

    at iochannel.cc:606
        gerror = 0x0
        retvalue = <optimized out>
    

    8 0x00007ffff6589d3d in Glib::IOChannel::write (this=0xa390c0, str=...) at iochannel.cc:214

        bytes_written = 0
    

    9 0x00000000004583f7 in VBA::Config::File::vSave (this=0xa04808, _rsFile=...) at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/configfile.cpp:221

        sName = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0xa09b28 "[Directories]\n"}}
        poSection = {_M_node = 0x9ecfd0}
        poFile = {pCppObject_ = 0xa390c0}
    

    10 0x000000000048b401 in VBA::Window::vSaveConfig (this=0xa04760, _rsFile=...) at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/window.cpp:746

    No locals.

    11 0x00000000004871f4 in VBA::Window::~Window (this=0xa04760, in_chrg=<optimized out="">, vtt_parm=<optimized out="">)

    at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/window.cpp:338
    

    No locals.

    12 0x000000000048751a in VBA::Window::~Window (this=0xa04760, in_chrg=<optimized out="">, vtt_parm=<optimized out="">)

    at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/window.cpp:346
    

    No locals.

    13 0x000000000045ac27 in main (argc=1, argv=0x7fffffffe368) at /home/sergio/Projects/teste-dbg/vbam-code-1230-trunk/src/gtk/main.cpp:122

        bShowVersion = false
        oKit = <incomplete type>
        oGroup = {_vptr.OptionGroup = 0x7ffff67b9190 <vtable for Glib::OptionGroup+16>, map_entries_ = {_M_t = {
              _M_impl = {<std::allocator<std::_Rb_tree_node<std::pair<Glib::ustring const, Glib::OptionGroup::CppOptionEntry> > >> = {<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<Glib::ustring const, Glib::OptionGroup::CppOptionEntry> > >> = {<No data fields>}, <No data fields>}, 
                _M_key_compare = {<std::binary_function<Glib::ustring, Glib::ustring, bool>> = {<No data fields>}, <No data fields>}, _M_header = {
                  _M_color = std::_S_red, _M_parent = 0x9e1470, _M_left = 0x9e1670, _M_right = 0x9e1470}, _M_node_count = 2}}}, gobject_ = 0x9e12a0, 
          has_ownership_ = false}
        sGtkBuilderFile = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x9e14d8 "src/gtk/ui/vbam.ui"}}
        listRemaining = {<std::_Vector_base<Glib::ustring, std::allocator<Glib::ustring> >> = {
            _M_impl = {<std::allocator<Glib::ustring>> = {<__gnu_cxx::new_allocator<Glib::ustring>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, 
              _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}
        poXml = {pCppObject_ = 0x9e1730}
        poWindow = 0xa04760
        oContext = {_vptr.OptionContext = 0x7ffff67b9110 <vtable for Glib::OptionContext+16>, gobject_ = 0x9e11d0, has_ownership_ = true}
        oVersion = {_vptr.OptionEntry = 0x7ffff67b9150 <vtable for Glib::OptionEntry+16>, 
          GOptionFlags = (Glib::OptionEntry::FLAG_FILENAME | Glib::OptionEntry::FLAG_OPTIONAL_ARG | Glib::OptionEntry::FLAG_NOALIAS | unknown: 4130619776), 
          gobject_ = 0x9e1230}
        oFileName = {_vptr.OptionEntry = 0x7ffff67b9150 <vtable for Glib::OptionEntry+16>, 
          GOptionFlags = (Glib::OptionEntry::FLAG_HIDDEN | Glib::OptionEntry::FLAG_IN_MAIN | Glib::OptionEntry::FLAG_REVERSE | Glib::OptionEntry::FLAG_NO_ARG | unknown: 4294959616), gobject_ = 0x9e1500}
    
     
  • Trying to reproduce in valgrind, but i'm unable to reproduce. Without valgrind, i can get a seg fault in the first try.

    valgrind ./gvbam
    ==32217== Memcheck, a memory error detector
    ==32217== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
    ==32217== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
    ==32217== Command: ./gvbam
    ==32217==
    ==32217== Conditional jump or move depends on uninitialised value(s)
    ==32217== at 0xD282CAC: ??? (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==32217== by 0xD2688E3: ??? (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==32217== by 0xD21D840: pixman_image_composite32 (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==32217== by 0x6DCAAC6: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6E0B8E3: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DFE6EB: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DFF0CA: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DFFF58: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DBEA36: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DCE98E: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6E02E33: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DC63FB: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217==
    ==32217== Conditional jump or move depends on uninitialised value(s)
    ==32217== at 0xD282FB4: ??? (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==32217== by 0xD2688E3: ??? (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==32217== by 0xD21D840: pixman_image_composite32 (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==32217== by 0x6DCAAC6: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6E0B8E3: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DFE6EB: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DFF0CA: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DFFC76: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DBE973: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DCE952: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6E02D41: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217== by 0x6DC605E: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==32217==
    ==32217== Conditional jump or move depends on uninitialised value(s)
    ==32217== at 0x260CC397: ??? (in /usr/lib/x86_64-linux-gnu/librsvg-2.so.2.36.4)
    ==32217== by 0x260CCF67: rsvg_handle_get_pixbuf_sub (in /usr/lib/x86_64-linux-gnu/librsvg-2.so.2.36.4)
    ==32217== by 0x25EA0E45: ??? (in /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so)
    ==32217== by 0xB7CEE8C: gdk_pixbuf_loader_close (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2800.1)
    ==32217== by 0xB7CB064: ??? (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2800.1)
    ==32217== by 0xB7CCD3C: gdk_pixbuf_new_from_stream_at_scale (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2800.1)
    ==32217== by 0xAE11334: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==32217== by 0xAE14369: gtk_icon_info_load_icon (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==32217== by 0xAE1450E: gtk_icon_theme_load_icon (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==32217== by 0xAF5D2C2: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==32217== by 0xAF5E2F9: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==32217== by 0xAF6294E: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==32217==
    ==32217== Thread 5:
    ==32217== Invalid read of size 8
    ==32217== at 0x50D8F8A: sem_wait (sem_wait.S:117)
    ==32217== by 0x4E863B1: SDL_SemWait (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==32217== by 0x497D5D: SoundSDL::read(unsigned short, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217== by 0x497CE6: SoundSDL::soundCallback(void
    , unsigned char*, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217== by 0x4E3E9B8: SDL_RunAudio (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==32217== by 0x4E46AC7: SDL_RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==32217== by 0x4E86188: RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==32217== by 0x50D2F6D: start_thread (pthread_create.c:311)
    ==32217== by 0x80D49CC: clone (clone.S:113)
    ==32217== Address 0x15702798 is 8 bytes inside a block of size 32 free'd
    ==32217== at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==32217== by 0x4980FB: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217== by 0x4981E3: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217== by 0x52C8F5: soundShutdown() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217== by 0x487A2C: VBA::Window::vUnInitSystem() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217== by 0x4871CD: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217== by 0x487519: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217== by 0x45AC26: main (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==32217==
    ==32217==
    ==32217== HEAP SUMMARY:
    ==32217== in use at exit: 3,920,144 bytes in 60,875 blocks
    ==32217== total heap usage: 704,853 allocs, 643,978 frees, 178,946,077 bytes allocated
    ==32217==
    ==32217== LEAK SUMMARY:
    ==32217== definitely lost: 136,480 bytes in 144 blocks
    ==32217== indirectly lost: 24,660 bytes in 578 blocks
    ==32217== possibly lost: 77,136 bytes in 1,086 blocks
    ==32217== still reachable: 3,499,460 bytes in 58,138 blocks
    ==32217== suppressed: 0 bytes in 0 blocks
    ==32217== Rerun with --leak-check=full to see details of leaked memory
    ==32217==
    ==32217== For counts of detected and suppressed errors, rerun with: -v
    ==32217== Use --track-origins=yes to see where uninitialised values come from
    ==32217== ERROR SUMMARY: 106 errors from 4 contexts (suppressed: 5 from 3)

     
  • Now with a invalid write

    valgrind ./gvbam
    ==13287== Memcheck, a memory error detector
    ==13287== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
    ==13287== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
    ==13287== Command: ./gvbam
    ==13287==
    ==13287== Conditional jump or move depends on uninitialised value(s)
    ==13287== at 0xD282CAC: ??? (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==13287== by 0xD2688E3: ??? (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==13287== by 0xD21D840: pixman_image_composite32 (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==13287== by 0x6DCAAC6: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6E0B8E3: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DFE6EB: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DFF0CA: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DFFF58: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DBEA36: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DCE98E: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6E02E33: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DC63FB: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287==
    ==13287== Conditional jump or move depends on uninitialised value(s)
    ==13287== at 0xD282FB4: ??? (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==13287== by 0xD2688E3: ??? (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==13287== by 0xD21D840: pixman_image_composite32 (in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2)
    ==13287== by 0x6DCAAC6: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6E0B8E3: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DFE6EB: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DFF0CA: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DFFC76: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DBE973: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DCE952: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6E02D41: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287== by 0x6DC605E: ??? (in /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.16)
    ==13287==
    ==13287== Conditional jump or move depends on uninitialised value(s)
    ==13287== at 0x260CC397: ??? (in /usr/lib/x86_64-linux-gnu/librsvg-2.so.2.36.4)
    ==13287== by 0x260CCF67: rsvg_handle_get_pixbuf_sub (in /usr/lib/x86_64-linux-gnu/librsvg-2.so.2.36.4)
    ==13287== by 0x25EA0E45: ??? (in /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so)
    ==13287== by 0xB7CEE8C: gdk_pixbuf_loader_close (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2800.1)
    ==13287== by 0xB7CB064: ??? (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2800.1)
    ==13287== by 0xB7CCD3C: gdk_pixbuf_new_from_stream_at_scale (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2800.1)
    ==13287== by 0xAE11334: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==13287== by 0xAE14369: gtk_icon_info_load_icon (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==13287== by 0xAE1450E: gtk_icon_theme_load_icon (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==13287== by 0xAF5D2C2: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==13287== by 0xAF5E2F9: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==13287== by 0xAF6294E: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.20)
    ==13287==
    ==13287== Thread 5:
    ==13287== Invalid read of size 4
    ==13287== at 0x50D5009: pthread_mutex_lock (pthread_mutex_lock.c:87)
    ==13287== by 0x4E8667D: SDL_mutexP (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x497D6D: SoundSDL::read(unsigned short, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x497CE6: SoundSDL::soundCallback(void
    , unsigned char, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4E3E9B8: SDL_RunAudio (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x4E46AC7: SDL_RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x4E86188: RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x50D2F6D: start_thread (pthread_create.c:311)
    ==13287== by 0x80D49CC: clone (clone.S:113)
    ==13287== Address 0x15702918 is 8 bytes inside a block of size 40 free'd
    ==13287== at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==13287== by 0x498133: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4981E3: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x52C8F5: soundShutdown() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x487A2C: VBA::Window::vUnInitSystem() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4871CD: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x487519: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x45AC26: main (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287==
    ==13287== Invalid write of size 4
    ==13287== at 0x50D5014: pthread_mutex_lock (pthread_mutex_lock.c:88)
    ==13287== by 0x4E8667D: SDL_mutexP (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x497D6D: SoundSDL::read(unsigned short
    , int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x497CE6: SoundSDL::soundCallback(void, unsigned char, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4E3E9B8: SDL_RunAudio (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x4E46AC7: SDL_RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x4E86188: RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x50D2F6D: start_thread (pthread_create.c:311)
    ==13287== by 0x80D49CC: clone (clone.S:113)
    ==13287== Address 0x15702914 is 4 bytes inside a block of size 40 free'd
    ==13287== at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==13287== by 0x498133: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4981E3: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x52C8F5: soundShutdown() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x487A2C: VBA::Window::vUnInitSystem() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4871CD: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x487519: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x45AC26: main (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287==
    ==13287== Invalid read of size 4
    ==13287== at 0x50D4FB3: pthread_mutex_lock (pthread_mutex_lock.c:130)
    ==13287== by 0x4E8667D: SDL_mutexP (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x497D6D: SoundSDL::read(unsigned short, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x497CE6: SoundSDL::soundCallback(void
    , unsigned char, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4E3E9B8: SDL_RunAudio (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x4E46AC7: SDL_RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x4E86188: RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x50D2F6D: start_thread (pthread_create.c:311)
    ==13287== by 0x80D49CC: clone (clone.S:113)
    ==13287== Address 0x1570291c is 12 bytes inside a block of size 40 free'd
    ==13287== at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==13287== by 0x498133: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4981E3: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x52C8F5: soundShutdown() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x487A2C: VBA::Window::vUnInitSystem() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4871CD: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x487519: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x45AC26: main (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287==
    ==13287== Invalid write of size 4
    ==13287== at 0x50D4FB8: pthread_mutex_lock (pthread_mutex_lock.c:128)
    ==13287== by 0x4E8667D: SDL_mutexP (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x497D6D: SoundSDL::read(unsigned short
    , int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x497CE6: SoundSDL::soundCallback(void, unsigned char, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4E3E9B8: SDL_RunAudio (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x4E46AC7: SDL_RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x4E86188: RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    ==13287== by 0x50D2F6D: start_thread (pthread_create.c:311)
    ==13287== by 0x80D49CC: clone (clone.S:113)
    ==13287== Address 0x15702918 is 8 bytes inside a block of size 40 free'd
    ==13287== at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==13287== by 0x498133: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4981E3: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x52C8F5: soundShutdown() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x487A2C: VBA::Window::vUnInitSystem() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x4871CD: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x487519: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287== by 0x45AC26: main (in /home/sergio/Projects/lp/fixes-make/gvbam)
    ==13287==
    ==13287==
    ==13287== HEAP SUMMARY:
    ==13287== in use at exit: 3,912,532 bytes in 60,778 blocks
    ==13287== total heap usage: 533,782 allocs, 473,004 frees, 157,630,871 bytes allocated
    ==13287==
    ==13287== LEAK SUMMARY:
    ==13287== definitely lost: 136,376 bytes in 143 blocks
    ==13287== indirectly lost: 24,596 bytes in 577 blocks
    ==13287== possibly lost: 76,512 bytes in 1,077 blocks
    ==13287== still reachable: 3,494,728 bytes in 58,061 blocks
    ==13287== suppressed: 0 bytes in 0 blocks
    ==13287== Rerun with --leak-check=full to see details of leaked memory
    ==13287==
    ==13287== For counts of detected and suppressed errors, rerun with: -v
    ==13287== Use --track-origins=yes to see where uninitialised values come from
    ==13287== ERROR SUMMARY: 108 errors from 7 contexts (suppressed: 5 from 3)

     
  • Compiled with gcc 4.6, 2 invalid read and 2 invalid write.

    Invalid write of size 4
    at 0x50D4FB8: pthread_mutex_lock (pthread_mutex_lock.c:128)
    by 0x4E8667D: SDL_mutexP (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    by 0x497D6D: SoundSDL::read(unsigned short, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    by 0x497CE6: SoundSDL::soundCallback(void
    , unsigned char*, int) (in /home/sergio/Projects/lp/fixes-make/gvbam)
    by 0x4E3E9B8: SDL_RunAudio (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    by 0x4E46AC7: SDL_RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    by 0x4E86188: RunThread (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
    by 0x50D2F6D: start_thread (pthread_create.c:311)
    by 0x80D49CC: clone (clone.S:113)
    Address 0x15702998 is 8 bytes inside a block of size 40 free'd
    at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x498133: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    by 0x4981E3: SoundSDL::~SoundSDL() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    by 0x52C8F5: soundShutdown() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    by 0x487A2C: VBA::Window::vUnInitSystem() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    by 0x4871CD: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    by 0x487519: VBA::Window::~Window() (in /home/sergio/Projects/lp/fixes-make/gvbam)
    by 0x45AC26: main (in /home/sergio/Projects/lp/fixes-make/gvbam)

     
    Last edit: Sergio Benjamim 2014-04-30
  • I compiled in Xubuntu Utopic x86, I call it from terminal and when i closes it, sometimes it remains in the system/RAM, you can see in monitor system. Terminal becomes unresponsive until i kill vbam in monitor system.

     
  • Can you please try with svn r1226, I suspect the sound sync changes from the two following revs for this issue.

     
  • It does not lost it config with this version, and no segmentation fault.

     
  • Christoph Korn
    Christoph Korn
    2014-07-06

    Will this be fixed in a new revision?

    Shouldn't the config file be written after closing the configuration dialog? And not in the destructor of the main window?