Menu

#10 std::bad_alloc error in bbpager

open
bbpager (9)
5
2012-11-11
2005-09-26
Anonymous
No

Trying to load bbpager on blackbox startup and put in
the slit.

xxx@pirate$ bbpager -w
xxx@pirate$ terminate called after throwing an instance
of 'std::bad_alloc'
what(): St9bad_alloc

+ Abort trap (core dumped) bbpager -w
xxx@pirate$

Above is the error received. Can call bbpager from
within blackbox, but cannot put in slit.

jdmancuso@rgare.com

Discussion

  • John Kennis

    John Kennis - 2005-10-02

    Logged In: YES
    user_id=552033

    You have this problem when you do bbpager -w after
    blackbox is started ?

    Can you please attach the core dump.

     
  • Nobody/Anonymous

    Logged In: NO

    Yes, I have the problem after blackbox is started.

     
  • Nobody/Anonymous

    Logged In: NO

    Cannot find an editor that can read the dump, otherwise I
    would attach it.

     
  • Nobody/Anonymous

    Logged In: NO

    I too get this once in a while. I always run bbapger -w and after a couple of hours it will abort. Here is the backtrace.

    (gdb) r -w
    Starting program: /usr/X11R6/bin/bbpager -w
    terminate called after throwing an instance of 'std::bad_alloc'
    what(): St9bad_alloc

    Program received signal SIGABRT, Aborted.
    0x484d4573 in kill () from /lib/libc.so.6
    (gdb) bt
    #0 0x484d4573 in kill () from /lib/libc.so.6
    #1 0x484d4510 in raise () from /lib/libc.so.6
    #2 0x484d3224 in abort () from /lib/libc.so.6
    #3 0x4839e027 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.5
    #4 0x483a222c in __cxxabiv1::__terminate () from /usr/lib/libstdc++.so.5
    #5 0x483a2264 in std::terminate () from /usr/lib/libstdc++.so.5
    #6 0x483a21b8 in __cxa_throw () from /usr/lib/libstdc++.so.5
    #7 0x483e17ca in operator new () from /usr/lib/libstdc++.so.5
    #8 0x483e1713 in operator new[] () from /usr/lib/libstdc++.so.5
    #9 0x08068c9d in bt::Image::render ()
    #10 0x08072a93 in bt::RealPixmapCache::find ()
    #11 0x08072ee4 in bt::PixmapCache::find ()
    #12 0x080589ce in PagerWindow::buildWindow (this=0x813a280, reconfigure=false) at pager.cxx:158
    #13 0x08058f6f in PagerWindow (this=0x813a280, toolwindow=0x0, _window=5108) at pager.cxx:76
    #14 0x080573cd in WMInterface::updateWindowList (this=0x81364b0) at stl_iterator.h:614
    #15 0x0805745d in WMInterface::propertyNotifyEvent (this=0x81364b0, event=0x0) at wminterface.cxx:185
    #16 0x0805a6d6 in bt::Application::process_event ()
    #17 0x0805bda1 in bt::Application::run ()
    #18 0x0804db88 in main (argc=2, argv=0xbfbfe660) at main.cxx:104

     
  • Nobody/Anonymous

    Logged In: NO

    Running it inside valgrind immediately gives this ...

    ==8689== Memcheck, a memory error detector for x86-linux.
    ==8689== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.
    ==8689== Using valgrind-2.1.0, a program supervision framework for x86-linux.
    ==8689== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
    ==8689== Estimated CPU clock rate is 1205 MHz
    ==8689== For more details, rerun with: -v
    ==8689==
    ==8689== Syscall param shmctl(IPC_SET or IPC_RMID,buf) contains uninitialised or unaddressable byte(s)
    ==8689== at 0x3C3FFA77: (within /lib/libc.so.6)
    ==8689== by 0x8068A61: bt::Image::renderPixmap(bt::Display const&, unsigned) (in /usr/X11R6/bin/bbpag
    er)
    ==8689== by 0x8068D0B: bt::Image::render(bt::Display const&, unsigned, bt::Texture const&) (in /usr/X
    11R6/bin/bbpager)
    ==8689== by 0x8072A92: bt::RealPixmapCache::find(unsigned, bt::Texture const&, unsigned, unsigned, un
    signed long) (in /usr/X11R6/bin/bbpager)
    ==8689== Address 0x0 is not stack'd, malloc'd or free'd
    ==8689==
    ==8689== Syscall param write(buf) contains uninitialised or unaddressable byte(s)
    ==8689== at 0x3C4739CF: (within /lib/libc.so.6)
    ==8689== by 0x3C12020C: _X11TransWrite (in /usr/X11R6/lib/libX11.so.6)
    ==8689== by 0x3C10670A: _XFlushInt (in /usr/X11R6/lib/libX11.so.6)
    ==8689== by 0x3C1067DD: _XReply (in /usr/X11R6/lib/libX11.so.6)
    ==8689== Address 0x3C4B83C4 is 184 bytes inside a block of size 16384 alloc'd
    ==8689== at 0x3C03294B: calloc (in /usr/local/lib/valgrind/vgpreload_memcheck.so)
    ==8689== by 0x3C0F763C: XOpenDisplay (in /usr/X11R6/lib/libX11.so.6)
    ==8689== by 0x805DEEE: bt::Display::Display(char const*, bool) (in /usr/X11R6/bin/bbpager)
    ==8689== by 0x805B75B: bt::Application::Application(std::string const&, char const*, bool) (in /usr/X
    11R6/bin/bbpager)

     
  • Nobody/Anonymous

    Logged In: NO

    I catched the crash within valgrind, and these are the error immediately before the crash:

    ==1100== Conditional jump or move depends on uninitialised value(s)
    ==1100== at 0x8058C39: PagerWindow::buildWindow(bool) (pager.cxx:139)
    ==1100== by 0x80592E8: PagerWindow::PagerWindow(ToolWindow*, unsigned long) (pager.cxx:76)
    ==1100== by 0x80576C8: WMInterface::updateWindowList() (stl_iterator.h:614)
    ==1100== by 0x8057758: WMInterface::propertyNotifyEvent(XPropertyEvent const*) (wminterface.cxx:185)
    ==1100==
    ==1100== Use of uninitialised value of size 4
    ==1100== at 0x8058C95: PagerWindow::buildWindow(bool) (pager.cxx:145)
    ==1100== by 0x80592E8: PagerWindow::PagerWindow(ToolWindow*, unsigned long) (pager.cxx:76)
    ==1100== by 0x80576C8: WMInterface::updateWindowList() (stl_iterator.h:614)
    ==1100== by 0x8057758: WMInterface::propertyNotifyEvent(XPropertyEvent const*) (wminterface.cxx:185)
    ==1100==
    ==1100== Use of uninitialised value of size 4
    ==1100== at 0x8058CB3: PagerWindow::buildWindow(bool) (pager.cxx:146)
    ==1100== by 0x80592E8: PagerWindow::PagerWindow(ToolWindow*, unsigned long) (pager.cxx:76)
    ==1100== by 0x80576C8: WMInterface::updateWindowList() (stl_iterator.h:614)
    ==1100== by 0x8057758: WMInterface::propertyNotifyEvent(XPropertyEvent const*) (wminterface.cxx:185)
    ==1100==
    ==1100== Use of uninitialised value of size 8
    ==1100== at 0x8058CC6: PagerWindow::buildWindow(bool) (pager.cxx:147)
    ==1100== by 0x80592E8: PagerWindow::PagerWindow(ToolWindow*, unsigned long) (pager.cxx:76)
    ==1100== by 0x80576C8: WMInterface::updateWindowList() (stl_iterator.h:614)
    ==1100== by 0x8057758: WMInterface::propertyNotifyEvent(XPropertyEvent const*) (wminterface.cxx:185)
    ==1100==
    ==1100== Use of uninitialised value of size 8
    ==1100== at 0x8058CE4: PagerWindow::buildWindow(bool) (pager.cxx:148)
    ==1100== by 0x80592E8: PagerWindow::PagerWindow(ToolWindow*, unsigned long) (pager.cxx:76)
    ==1100== by 0x80576C8: WMInterface::updateWindowList() (stl_iterator.h:614)
    ==1100== by 0x8057758: WMInterface::propertyNotifyEvent(XPropertyEvent const*) (wminterface.cxx:1
    85)

    valgrind: vg_malloc2.c:1008 (vgPlain_arena_malloc): Assertion `new_sb != ((void*)0)' failed.
    ==1100== at 0xB802BE1F: (within /usr/local/lib/valgrind/stage2)
    ==1100== by 0xB802BE1E: (within /usr/local/lib/valgrind/stage2)
    ==1100== by 0xB802BE5D: vgPlain_core_assert_fail (in /usr/local/lib/valgrind/stage2)
    ==1100== by 0xB8028091: vgPlain_arena_malloc (in /usr/local/lib/valgrind/stage2)

    So, whats happening is, that PagerWindow::buildWindow is called without the following fields being initialized: desktop_nr, window_x, window_y. At least, that's how I read it.

     

Log in to post a comment.

MongoDB Logo MongoDB