HaikuArchives / VMwareAddons

VMwareAdd-ons is a set of tools to enhance interaction with Haiku running in VMware
MIT License
7 stars 9 forks source link

Random Deskbar crashes #12

Open diversys opened 6 years ago

diversys commented 6 years ago

vmware_tray randomly crashes Deskbar every 10-30 minutes. Closing vmware_tray seems to fix all of the crashes.

launch_roster stop x-vnd.be-tskb
LD_PRELOAD=/system/lib/libroot_debug.so Deskbar
Active Threads:
  thread 35930: Deskbar (main)
  thread 35935: _BMediaRoster_ 
  thread 35936: Expando Window Watcher 
  thread 35939: w>Twitcher 
  thread 36086: team 35930 debug task 
  thread 35940: w>Deskbar 
    state: Call (someone wrote beyond small allocation at 0x1802db80; size: 56 bytes; allocated by 35940; value: 0x1802db00)

    Frame    IP      Function Name
    -----------------------------------------------
    00000000  0x61db756aa7  _kern_debugger + 0x7 
      Disassembly:
        _kern_debugger:
        0x00000061db756aa0:   48c7c0e1000000  mov $0xe1, %rax
        0x00000061db756aa7:             0f05  syscall  <--

    0x7f6ee09780b0  0x61db7503e9  debugger + 0x2f 
    0x7f6ee0978590  0x61db7f6718  panic(char const*, ...) + 0xad 
    0x7f6ee09785f0  0x61db7f82cb  heap_free(heap_allocator_s*, void*) + 0x1ca 
    0x7f6ee0978680  0x61db7f8b9b  debug_heap_free(void*) + 0x29 
    0x7f6ee0978690  0x61db7fb833  free + 0xb 
    0x7f6ee09786b0  0x1818fbbb5f4  BMessage::_Clear() + 0x66 
    0x7f6ee09786f0  0x1818fbbbd45  BMessage::Unflatten(BDataIO*) + 0x53 
    0x7f6ee0978760  0x1818fbbd26c  BMessage::Unflatten(char const*) + 0x48 
    0x7f6ee0978810  0x1818fbbdec2  BMessage::FindMessage(char const*, int, BMessage*) const + 0x4a 
    0x7f6ee0978820  0x1818fbbdfe2  BMessage::FindMessage(char const*, BMessage*) const + 0xc 
    0x7f6ee0978920  0x1818fbb122a  BClipboard::_DownloadFromSystem(bool) + 0x86 
    0x7f6ee0978950  0x1818fbb12ee  BClipboard::Lock() + 0x2a 
    0x7f6ee0978990  0x12dfc13b113  VMWAddOnsTray::MessageReceived(BMessage*) + 0x233 
    0x7f6ee09789a0  0x1818fbb6ccd  BLooper::DispatchMessage(BMessage*, BHandler*) + 0x31 
    0x7f6ee0978cc0  0x1818fc71a55  BWindow::DispatchMessage(BMessage*, BHandler*) + 0x139f 
    0x7f6ee0978d60  0x1818fc6b80f  BWindow::task_looper() + 0x261 
    0x7f6ee0978d80  0x1818fbb5a21  BLooper::_task0_(void*) + 0x1b 
    0x7f6ee0978da0  0x61db7558bf  thread_entry + 0x10 
    00000000  0x7fd40c818260  commpage_thread_exit + 0
diversys commented 6 years ago

Probably crashes somewhere here: https://github.com/HaikuArchives/VMwareAddons/blob/bd3350d510d3f408bdb27cfbe1becf0b368bb9db/vmware_tray/VMWAddOnsTray.cpp#L207-L234

diversys commented 5 years ago

To workaround this bug create a folder mkdir /boot/home/config/settings/system/debug_server and then lpe /boot/home/config/settings/system/debug_server/settings file with this content:

executable_actions {
    Deskbar kill
}
diversys commented 5 years ago

With new memory allocator:

LD_PRELOAD=libroot_debug.so MALLOC_DEBUG=g Deskbar

Debug information for team /boot/system/Deskbar (1177):
CPU(s): 2x Intel Core™ i7-3635QM
Memory: 2.00 GiB total, 509.16 MiB used
Haiku revision: hrev53142 May 17 2019 17:29:54 (x86_64)

Active Threads:
    thread 1177: Deskbar (main)
    thread 1183: _BMediaRoster_ 
    thread 1184: Expando Window Watcher 
    thread 1187: w>Twitcher 
    thread 8798: team 1177 debug task 
    thread 1188: w>Deskbar 
        state: Call (thread 1188 tried accessing address 0x89b000 which is a guard page (base: 0x89aff0, size: 16, alignment: 16, allocated by thread: 1188, freed by thread: -1))

        Frame       IP          Function Name
        -----------------------------------------------
        00000000    0x1a2e08e8b7f   _kern_debugger + 0x7 
            Disassembly:
                _kern_debugger:
                0x000001a2e08e8b78:   48c7c0e1000000  mov $0xe1, %rax
                0x000001a2e08e8b7f:             0f05  syscall  <--

        0x7f27bb84f570  0x1a2e0991130   panic(char const*, ...) + 0xc0 
        0x7f27bb84f5d0  0x1a2e0991581   guarded_heap_segfault_handler(int, __siginfo_t*, void*) + 0x181 
        0x7f27bb84f5d0  0x7f87bc6dd23b  commpage_signal_handler + 0x2b 
        0x7f27bb84fa20  0x2e8cff4eb2    VMWBackdoor::SetHostClipboard(char*, unsigned long) + 0x30 
        0x7f27bb84fa60  0x2e8cff315d    VMWAddOnsTray::MessageReceived(BMessage*) + 0x20b 
        0x7f27bb84fc90  0x707c1682e1    BWindow::DispatchMessage(BMessage*, BHandler*) + 0x411 
        0x7f27bb84fd20  0x707c163d25    BWindow::task_looper() + 0x1b5 
        0x7f27bb84fd40  0x707c09ee16    BLooper::_task0_(void*) + 0x26 
        0x7f27bb84fd60  0x1a2e08e78d7   thread_entry + 0x17 
        00000000    0x7f87bc6dd260  commpage_thread_exit + 0