msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.31k stars 1.23k forks source link

Running gphoto2/libgphoto2 on Windows IoT Core (or Desktop UWP app) Error : 'Out of memory' (-3) #5278

Open mms- opened 5 years ago

mms- commented 5 years ago

Running gphoto2 mingw 64 bit binaries on Windows IoT Core and unable to detect or load the usb library. Reproduce using : gphoto2.exe --debug --debug-logfile=my-logfile.txt --auto-detect --summary

The same binaries on desktop Windows 10 work just fine. However on Windows 10 desktop this exact same error occurs when using libgphoto2 library directly from a UWP app. Faults at the same point with same output, loading usb1 iolib.

Seems like it is unable to access or enumerate the usb devices and the error itself is misleading?

This occurs with or without winusb driver installed for the Nikon camera and weather it is connected or not. Seems like a general failure. Any ideas?

Libusb is the cause or the error: gp_port_library_list libusb1.c:216: Out of memory: 'descs = calloc (nrofdevs, sizeof(descs[0]))' failed.

Complete output:

0.000000 main (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST: 0.015621 main (2): gphoto2 2.5.20 0.015621 main (2): gphoto2 has been compiled with the following options: 0.031240 main (2): + x86_64-w64-mingw32-gcc (C compiler used) 0.031240 main (2): + popt (mandatory, for handling command-line parameters) 0.031240 main (2): + exif (for displaying EXIF information) 0.046862 main (2): + no cdk (for accessing configuration options) 0.046862 main (2): + no aa (for displaying live previews) 0.062481 main (2): + jpeg (for displaying live previews in JPEG format) 0.062481 main (2): + readline (for easy navigation in the shell) 0.062481 main (2): libgphoto2 2.5.21 0.062481 main (2): libgphoto2 has been compiled with the following options: 0.062481 main (2): + all camlibs 0.062481 main (2): + x86_64-w64-mingw32-gcc (C compiler used) 0.062481 main (2): + ltdl (for portable loading of camlibs) 0.062481 main (2): + EXIF (for special handling of EXIF files) 0.062481 main (2): libgphoto2_port 0.12.0 0.078060 main (2): libgphoto2_port has been compiled with the following options: 0.078060 main (2): + iolibs: disk ptpip usb1 0.078060 main (2): + x86_64-w64-mingw32-gcc (C compiler used) 0.078060 main (2): + ltdl (for portable loading of iolibs) 0.078060 main (2): + USB (libusb1, for USB cameras) 0.078060 main (2): + no serial (for serial cameras) 0.078060 main (2): + no resmgr (serial port access and locking) 0.078060 main (2): + no ttylock (serial port locking) 0.078060 main (2): + no lockdev (serial port locking) 0.078060 main (2): CAMLIBS env var not set, using compile-time default instead 0.093678 main (2): IOLIBS env var not set, using compile-time default instead 0.093678 main (2): invoked with following arguments: 0.093678 main (2): --debug 0.093678 main (2): --debug-logfile=my-logfile.txt 0.093678 main (2): --auto-detect 0.093678 main (2): --summary 0.109305 load_settings (2): Creating gphoto config directory ('C:\Data\Users\administrator.gphoto') 0.109305 verify_settings (2): Can't open settings file 'C:\Data\Users\administrator.gphoto\settings' for reading. 0.109305 load_settings (2): Loading settings from file 'C:\Data\Users\administrator.gphoto\settings'. 0.109305 load_settings (2): Can't open settings file 'C:\Data\Users\administrator.gphoto\settings' for reading. 0.109305 load_settings (2): Creating gphoto config directory ('C:\Data\Users\administrator.gphoto') 0.124925 verify_settings (2): Can't open settings file 'C:\Data\Users\administrator.gphoto\settings' for reading. 0.124925 load_settings (2): Loading settings from file 'C:\Data\Users\administrator.gphoto\settings'. 0.124925 load_settings (2): Can't open settings file 'C:\Data\Users\administrator.gphoto\settings' for reading. 0.124925 main (2): The user has not specified both a model and a port. Try to figure them out. 0.124925 gp_port_info_list_load (2): Using ltdl to load io-drivers from '.\IOLIBS'... 0.124925 foreach_func (2): Called for filename './IOLIBS/disk'. 0.140543 foreach_func (2): Loaded '' ('^disk:') from './IOLIBS/disk'. 0.140543 foreach_func (2): Called for filename './IOLIBS/ptpip'. 0.140543 foreach_func (2): Loaded 'PTP/IP Connection' ('ptpip:') from './IOLIBS/ptpip'. 0.140543 foreach_func (2): Loaded '' ('^ptpip:') from './IOLIBS/ptpip'. 0.140543 foreach_func (2): Called for filename './IOLIBS/usb1'. 0.186573 gp_port_library_list libusb1.c:216: Out of memory: 'descs = calloc (nrofdevs, sizeof(descs[0]))' failed. 0.202190 foreach_func gphoto2-port-info-list.c:237: Error during assembling of port list: 'Out of memory' (-3). 0.202190 foreach_func (2): Loaded '' ('^usb:') from './IOLIBS/usb1'. 0.202190 gp_port_info_list_count (2): Counting entries (4 available)... 0.202190 gp_port_info_list_count (2): 1 regular entries available. 0.202190 gp_abilities_list_load_dir (2): Using ltdl to load camera libraries from '.\CAMLIBS'... 0.202190 foreach_func (2): Found './CAMLIBS/adc65'. 0.202190 foreach_func (2): Found './CAMLIBS/agfa_cl20'. 0.217810 foreach_func (2): Found './CAMLIBS/aox'. 0.217810 foreach_func (2): Found './CAMLIBS/ax203'. 0.217810 foreach_func (2): Found './CAMLIBS/barbie'. 0.217810 foreach_func (2): Found './CAMLIBS/canon'.

peterbud commented 5 years ago

Pls see my reply: https://github.com/gphoto/libgphoto2/issues/411#issuecomment-487375945