HaikuArchives / PhotoGrabber

PhotoGrabber is an application that downloads/deletes pictures from USB digital cameras
2 stars 10 forks source link

Drag and drop causes a crash #27

Closed Vidrep closed 2 years ago

Vidrep commented 4 years ago

Dragging and dropping photos to my Desktop triggers the debugger. Debug report below.

Vidrep commented 4 years ago

Debug information for team /boot/system/apps/PhotoGrabber/PhotoGrabber (847): CPU(s): 8x Intel Core™ i7-3770 Memory: 15.88 GiB total, 598.41 MiB used Haiku revision: hrev54594 Sep 23 2020 07:24:08 (x86_64)

Active Threads:
    thread 847: PhotoGrabber (main)
    thread 851: w>PhotoGrabber 
    thread 852: cameralooper 
    thread 853: BUSBRoster looper 
    thread 859: team 847 debug task 
    thread 856: download_items 
        state: Call (getNumAvailable() < getNumBlocks())

        Frame       IP          Function Name
        -----------------------------------------------
        00000000    0x369863c2cf    _kern_debugger + 0x7 
            Disassembly:
                _kern_debugger:
                0x000000369863c2c8:   48c7c0e1000000  mov $0xe1, %rax
                0x000000369863c2cf:             0f05  syscall  <--

        0x7f5cafbd3650  0x3698642cd0    __assert_fail + 0x60 
        0x7f5cafbd36a0  0x36986c7470    BPrivate::hoardHeap::freeBlock(BPrivate::block*&, BPrivate::superblock*&, int, BPrivate::processHeap*) + 0x650 
        0x7f5cafbd36e0  0x36986c794b    BPrivate::processHeap::free(void*) + 0xfb 
        0x7f5cafbd3700  0x36986c8a1d    free + 0x3d 
        0x7f5cafbd38c0  0x1df41c9a45    BeCam_MainWindow::DownloadItems(items_data*) + 0x2d5 
        0x7f5cafbd38e0  0x369863b077    thread_entry + 0x17 
diversys commented 4 years ago

Try running like this LD_PRELOAD=/system/lib/libroot_debug.so /system/apps/PhotoGrabber/PhotoGrabber and attach a new back trace.

Vidrep commented 4 years ago
Active Threads:
    thread 4260: PhotoGrabber (main)
    thread 4264: w>PhotoGrabber 
    thread 4265: cameralooper 
    thread 4266: BUSBRoster looper 
    thread 4272: team 4260 debug task 
    thread 4269: download_items 
        state: Call (leak check info has invalid size 16045690984833335023 for element size 256, probably memory has been overwritten past allocation size
)

        Frame       IP          Function Name
        -----------------------------------------------
        00000000    0xf8e2ec30df    _kern_debugger + 0x7 
            Disassembly:
                _kern_debugger:
                0x000000f8e2ec30d8:   48c7c0e1000000  mov $0xe1, %rax
                0x000000f8e2ec30df:             0f05  syscall  <--

        0x7f827b3fb430  0xf8e2f4cf8d    panic(char const*, ...) + 0xad 
        0x7f827b3fb490  0xf8e2f4f29d    heap_free(heap_allocator_s*, void*) + 0x90d 
        0x7f827b3fb520  0xf8e2f4f436    debug_heap_free(void*) + 0x26 
        0x7f827b3fb6e0  0x116cdddea45   BeCam_MainWindow::DownloadItems(items_data*) + 0x2d5 
        0x7f827b3fb700  0xf8e2ec1e87    thread_entry + 0x17
Vidrep commented 3 years ago

Tested as working OK on 32 bit. So, apparently only a problem on 64 bit Haiku.

Vidrep commented 2 years ago

Can we add this to hacktoberfest?

scottmc commented 2 years ago

Add. Be sure to sign up on the hacktoberfest site. Let me know if you have any issues getting credit for pull requests you submit for this one or any others on HaikuArchives that are labeled hacktoberfest.

waddlesplash commented 2 years ago

I ran into quite a lot of crashes before I actually got any images to appear in PhotoGrabber, and so by the time I got to actually viewing images, I could not reproduce this crash. @Vidrep, see if a build of PhotoGrabber works now.

BTW: the "Enhanced PTP" plugin did not work with my phone. The older (currently disabled) PTP plugin did...

Vidrep commented 2 years ago

PhotoGrabber crash is fixed with the last set of commits on january 26.

waddlesplash commented 2 years ago

Very good!