Coder Social home page Coder Social logo

ffi-gphoto2's People

Contributors

chunkerchunker avatar lenlo avatar rumpuslabs avatar sija avatar zaeleus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ffi-gphoto2's Issues

ffi-gphoto2 crashes when run with ffi-1.12 on an ARM Mac

It looks like has been fixed with ffi-1.15 (see below).

$ gem install ffi-gphoto2
Fetching ffi-1.12.2.gem
Fetching ffi-gphoto2-0.8.0.gem
Building native extensions. This could take a while...
Successfully installed ffi-1.12.2
Successfully installed ffi-gphoto2-0.8.0
Parsing documentation for ffi-1.12.2
Installing ri documentation for ffi-1.12.2
Parsing documentation for ffi-gphoto2-0.8.0
Installing ri documentation for ffi-gphoto2-0.8.0
Done installing documentation for ffi, ffi-gphoto2 after 2 seconds
2 gems installed
$ echo "require 'gphoto2'" | ruby -
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/library.rb:275: [BUG] Bus Error at 0x0000000104f40000
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

-- Control frame information -----------------------------------------------
c:0016 p:---- s:0117 e:000116 CFUNC  :attach
c:0015 p:0250 s:0111 e:000110 METHOD /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/library.rb:275
c:0014 p:0109 s:0091 e:000090 CLASS  /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port.rb:27
c:0013 p:0007 s:0088 e:000087 CLASS  /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port.rb:4
c:0012 p:0013 s:0085 e:000084 TOP    /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port.rb:3 [FINISH]
c:0011 p:---- s:0082 e:000081 CFUNC  :require
c:0010 p:0195 s:0077 e:000076 METHOD <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85
c:0009 p:0011 s:0060 e:000059 TOP    /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2.rb:2 [FINISH]
c:0008 p:---- s:0057 e:000056 CFUNC  :require
c:0007 p:0195 s:0052 e:000051 METHOD <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85
c:0006 p:0011 s:0035 e:000034 TOP    /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/gphoto2.rb:3 [FINISH]
c:0005 p:---- s:0032 e:000031 CFUNC  :require
c:0004 p:0081 s:0027 e:000026 RESCUE <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160
c:0003 p:0677 s:0023 e:000022 METHOD <internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149
c:0002 p:0005 s:0006 e:000005 EVAL   -:1 [FINISH]
c:0001 p:0000 s:0003 E:0019a0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
-:1:in `<main>'
<internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
<internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
<internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/gphoto2.rb:3:in `<top (required)>'
<internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2.rb:2:in `<top (required)>'
<internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port.rb:3:in `<top (required)>'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port.rb:4:in `<module:FFI>'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port.rb:27:in `<module:GPhoto2Port>'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/library.rb:275:in `attach_function'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/library.rb:275:in `attach'

-- Other runtime information -----------------------------------------------

* Loaded script: -

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 ruby2_keywords.rb
    5 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
    6 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/trans/transdb.bundle
    7 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/rbconfig.rb
    8 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/compatibility.rb
    9 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/defaults.rb
   10 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/deprecate.rb
   11 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/errors.rb
   12 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/exceptions.rb
   13 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/defaults/operating_system.rb
   14 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/basic_specification.rb
   15 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/stub_specification.rb
   16 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/text.rb
   17 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/user_interaction.rb
   18 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/specification_policy.rb
   19 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/util/list.rb
   20 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/platform.rb
   21 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/version.rb
   22 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/requirement.rb
   23 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/specification.rb
   24 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/util.rb
   25 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/dependency.rb
   26 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_gem.rb
   27 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/monitor.bundle
   28 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/monitor.rb
   29 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb
   30 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_warn.rb
   31 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems.rb
   32 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/path_support.rb
   33 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/version.rb
   34 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/core_ext/name_error.rb
   35 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/levenshtein.rb
   36 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/jaro_winkler.rb
   37 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/spell_checker.rb
   38 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   39 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   40 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/spell_checkers/name_error_checkers.rb
   41 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/spell_checkers/method_name_checker.rb
   42 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/spell_checkers/key_error_checker.rb
   43 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/spell_checkers/null_checker.rb
   44 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/tree_spell_checker.rb
   45 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/spell_checkers/require_path_checker.rb
   46 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean/formatters/plain_formatter.rb
   47 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/did_you_mean.rb
   48 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/bundler_version_finder.rb
   49 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/logger/version.rb
   50 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/logger/formatter.rb
   51 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/logger/period.rb
   52 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/logger/log_device.rb
   53 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/logger/severity.rb
   54 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/logger/errors.rb
   55 /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/logger.rb
   56 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi_c.bundle
   57 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/platform.rb
   58 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/data_converter.rb
   59 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/types.rb
   60 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/library.rb
   61 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/errno.rb
   62 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/pointer.rb
   63 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/memorypointer.rb
   64 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/struct_layout.rb
   65 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/struct_layout_builder.rb
   66 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/struct_by_reference.rb
   67 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/struct.rb
   68 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/union.rb
   69 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/managedstruct.rb
   70 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/callback.rb
   71 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/io.rb
   72 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/autopointer.rb
   73 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/variadic.rb
   74 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/enum.rb
   75 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/version.rb
   76 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi/ffi.rb
   77 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi.rb
   78 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_result.rb
   79 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_serial_parity.rb
   80 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_type.rb
   81 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_settings_serial.rb
   82 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_settings_usb.rb
   83 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_settings_usb_disk_direct.rb
   84 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_settings_usb_scsi.rb
   85 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_settings.rb
   86 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port.rb
   87 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_info.rb
   88 /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-gphoto2-0.8.0/lib/ffi/gphoto2_port/gp_port_info_list.rb

* Process memory map:

104de0000-104de4000 r-x /opt/homebrew/Cellar/ruby/3.0.0_1/bin/ruby
104de4000-104de8000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/bin/ruby
104de8000-104dec000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/bin/ruby
104dec000-104df4000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/bin/ruby
104df4000-104dfc000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104dfc000-104e00000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e00000-104e04000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e04000-104e08000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e08000-104e0c000 --- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e0c000-104e14000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e14000-104e18000 --- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e18000-104e1c000 --- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e1c000-104e24000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e24000-104e28000 --- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e28000-104e2c000 --- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e2c000-104e34000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e34000-104e38000 --- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e38000-104e3c000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e3c000-104e40000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e40000-104e80000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e80000-104e84000 r-x /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e84000-104e88000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e88000-104e8c000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e8c000-104e94000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/encdb.bundle
104e94000-104e98000 r-x /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/trans/transdb.bundle
104e98000-104e9c000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/trans/transdb.bundle
104e9c000-104ea0000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/trans/transdb.bundle
104ea0000-104ea8000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/enc/trans/transdb.bundle
104ea8000-104eac000 r-x /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/monitor.bundle
104eac000-104eb0000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/monitor.bundle
104eb0000-104eb4000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/monitor.bundle
104eb4000-104ebc000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/arm64-darwin20/monitor.bundle
104ebc000-104ed8000 r-x /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi_c.bundle
104ed8000-104edc000 r-- /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi_c.bundle
104edc000-104ee0000 rw- /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi_c.bundle
104ee0000-104ef4000 r-- /opt/homebrew/lib/ruby/gems/3.0.0/gems/ffi-1.12.2/lib/ffi_c.bundle
104ef4000-104f08000 r-x /usr/local/lib/libffi.8.dylib
104f08000-104f0c000 r-- /usr/local/lib/libffi.8.dylib
104f0c000-104f10000 rw- /usr/local/lib/libffi.8.dylib
104f10000-104f14000 r-- /usr/local/lib/libffi.8.dylib
104f14000-104f1c000 r-x /opt/homebrew/Cellar/libgphoto2/2.5.27/lib/libgphoto2_port.12.dylib
104f1c000-104f20000 r-- /opt/homebrew/Cellar/libgphoto2/2.5.27/lib/libgphoto2_port.12.dylib
104f20000-104f24000 rw- /opt/homebrew/Cellar/libgphoto2/2.5.27/lib/libgphoto2_port.12.dylib
104f24000-104f2c000 r-- /opt/homebrew/Cellar/libgphoto2/2.5.27/lib/libgphoto2_port.12.dylib
104f2c000-104f34000 r-x /opt/homebrew/Cellar/libtool/2.4.6_3/lib/libltdl.7.dylib
104f34000-104f38000 r-- /opt/homebrew/Cellar/libtool/2.4.6_3/lib/libltdl.7.dylib
104f38000-104f3c000 rw- /opt/homebrew/Cellar/libtool/2.4.6_3/lib/libltdl.7.dylib
104f3c000-104f44000 r-- /opt/homebrew/Cellar/libtool/2.4.6_3/lib/libltdl.7.dylib
104f44000-104f48000 rw- /usr/lib/dyld
10504c000-1050c8000 r-x /usr/lib/dyld
1050c8000-1050d0000 r-- /usr/lib/dyld
1050d0000-1050d4000 rw- /usr/lib/dyld
1050d4000-105108000 rw- /usr/lib/dyld
105108000-10514c000 r-- /usr/lib/dyld
10514c000-105150000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/libruby.3.0.dylib
105150000-1053bc000 r-x /opt/homebrew/Cellar/ruby/3.0.0_1/lib/libruby.3.0.dylib
1053bc000-1053c4000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/libruby.3.0.dylib
1053c4000-1053c8000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/libruby.3.0.dylib
1053c8000-1053d4000 rw- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/libruby.3.0.dylib
1053d4000-10543c000 r-- /opt/homebrew/Cellar/ruby/3.0.0_1/lib/libruby.3.0.dylib
10543c000-105440000 ---
105440000-1054e4000 rw-
1054e4000-1054e8000 ---
1054e8000-10558c000 rw-
10558c000-105590000 ---
105590000-105634000 rw-
105634000-105638000 ---
105638000-1056dc000 rw-
1056dc000-1056e0000 ---
1056e0000-105784000 rw-
105784000-105788000 ---
105788000-10582c000 rw-
10582c000-105830000 ---
105830000-1058d4000 rw-
1058d4000-1058d8000 ---
1058d8000-10597c000 rw-
10597c000-105980000 ---
105980000-105a24000 rw-
105a24000-105a28000 ---
105a28000-105acc000 rw-
105acc000-105ad0000 ---
105ad0000-105b74000 rw-
105b74000-105b78000 ---
105b78000-105c1c000 rw-
105c1c000-105c20000 ---
105c20000-105cc4000 rw-
105cc4000-105cc8000 ---
105cc8000-105d6c000 rw-
105d6c000-105d70000 ---
105d70000-105e14000 rw-
105e14000-105e18000 ---
105e18000-105ebc000 rw-
105ebc000-105ec0000 ---
105ec0000-105f64000 rw-
105f64000-105f68000 ---
105f68000-10600c000 rw-
10600c000-106010000 ---
106010000-1060b4000 rw-
1060b4000-1060b8000 ---
1060b8000-10615c000 rw-
10615c000-106160000 ---
106160000-106204000 rw-
106204000-106208000 ---
106208000-1062ac000 rw-
1062ac000-1062b0000 ---
1062b0000-106354000 rw-
106354000-106358000 ---
106358000-1063fc000 rw-
1063fc000-106400000 ---
106400000-1064a4000 rw-
1064a4000-1064a8000 ---
1064a8000-10654c000 rw-
10654c000-106550000 ---
106550000-1065f4000 rw-
1065f4000-1065f8000 ---
1065f8000-10669c000 rw-
10669c000-1066a0000 ---
1066a0000-106744000 rw-
106744000-106748000 ---
106748000-1067ec000 rw-
1067ec000-1067f0000 ---
1067f0000-106894000 rw-
106894000-106898000 ---
106898000-10693c000 rw-
13b600000-13b700000 rw-
13b700000-13b800000 rw-
13b800000-13c000000 rw-
140000000-140800000 rw-
140800000-141000000 rw-
141000000-141800000 rw-
141800000-142000000 rw-
142000000-142800000 rw-
142800000-143000000 rw-
143000000-143800000 rw-
143800000-144000000 rw-
144000000-144800000 rw-
144800000-145000000 rw-
145000000-145800000 rw-
145800000-146000000 rw-
146000000-146800000 rw-
146800000-147000000 rw-
147000000-147800000 rw-
147800000-148000000 rw-
14b600000-14b700000 rw-
14b700000-14b800000 rw-
14b800000-14c000000 rw-
14c000000-14c100000 rw-
14c100000-14c104000 rw-
14c200000-14c300000 rw-
14c800000-14d000000 rw-
14d000000-14f000000 rw-
14f000000-14f800000 rw-
150000000-150800000 rw-
150800000-151000000 rw-
151000000-151800000 rw-
151800000-152000000 rw-
152000000-152800000 rw-
152800000-153000000 rw-
153000000-153800000 rw-
153800000-154000000 rw-
154000000-154800000 rw-
154800000-155000000 rw-
155000000-155800000 rw-
155800000-156000000 rw-
156000000-156800000 rw-
156800000-157000000 rw-
157000000-157800000 rw-
157800000-158000000 rw-
167020000-16a824000 ---
16a824000-16b020000 rw-
16b020000-16b024000 ---
16b024000-16b0ac000 rw-
180000000-190000000 r--
190000000-1a0000000 r--
1a0000000-1b0000000 r--
1b0000000-1c0000000 r--
1c0000000-1d0000000 r--
1d0000000-1e0000000 r--
1e0000000-1f0000000 r--
1f0000000-1fc000000 r--
1fc000000-1fe000000 rw-
1fe000000-200000000 r--
200000000-202000000 r--
202000000-2025c0000 r--
2025c0000-207e34000 rw-
207e34000-208000000 r--
208000000-210000000 r--
210000000-220000000 r--
220000000-230000000 r--
230000000-240000000 r--
240000000-250000000 r--
250000000-260000000 r--
260000000-270000000 r--
270000000-280000000 r--
fc0000000-1000000000 ---
1000000000-7000000000 ---
[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.

Abort trap: 6

$ git clone https://github.com/zaeleus/ffi-gphoto2.git
$ cd https://github.com/zaeleus/ffi-gphoto2.git
$ (echo /1.12/s/1.12/1.15/; echo wq) | ed ffi-gphoto2.gemspec 
1109
1109
$ git diff
diff --git a/ffi-gphoto2.gemspec b/ffi-gphoto2.gemspec
index 6a5b207..6e682e0 100644
--- a/ffi-gphoto2.gemspec
+++ b/ffi-gphoto2.gemspec
@@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency 'rspec', '~> 3.9.0'
   spec.add_development_dependency 'yard', '~> 0.9.0'
 
-  spec.add_dependency 'ffi', '~> 1.12.0'
+  spec.add_dependency 'ffi', '~> 1.15.0'
 end
$ gem build ffi-gphoto2.gemspec 
  Successfully built RubyGem
  Name: ffi-gphoto2
  Version: 0.8.0
  File: ffi-gphoto2-0.8.0.gem
$ gem install ffi-gphoto2-0.8.0.gem 
Successfully installed ffi-gphoto2-0.8.0
Parsing documentation for ffi-gphoto2-0.8.0
Done installing documentation for ffi-gphoto2 after 4 seconds
1 gem installed
$ echo "require 'gphoto2'" | ruby -
$ 

memory leak

hello

having issues with (broken down to suspected code)

device = GPhoto2::Camera.first
data = device.preview.data

leaks - i call the data = device.preview.data in a loop - to get a updated preview - works - but seems that memory is leaking

how can i check and verify that this is called

FFI::GPhoto2.gp_file_free(ptr)

actual code:

while true
          sleep 0.5
          @mutex.synchronize do
           file = device.preview
           self.preview = file.data
          end
          if shutdown
            break
          end
      end

if i remove the device.preview - and do self.preview="123" the leak is gone.

regards
helmut

ffi-gphoto2 gem not working when bundled and used in Sinatra/Rails app

Great gem! I can only seem to use it in one off ruby scripts though. When I include it in a Gemfile for a Rails or Sinatra app, bundle install and require 'gphoto2' I am met with the following error:

.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/ffi/gphoto2_port.rb:3:in `module:GPhoto2Port': uninitialized constant FFI::Library (NameError)

Any thoughts?

reset camera

i would love to get a Camer.reset, wich does a usb reset, like gphoto2 --reset
(as sometimes the cam hang's)

the required C code


        GPPort      *port;
        GPPortInfo  info;

        /* If a camera is already open, close it, as we need a new port */
        if (gp_params.camera) {
            gp_camera_exit (gp_params.camera, gp_params.context);
            /* exit, not free. will reopen on next command. */
        }

        params->p.r = gp_port_new (&port);
        if (params->p.r != GP_OK) {
            gp_log(GP_LOG_ERROR,"port_reset", "new failed %d", params->p.r);
            break;
        }
        params->p.r = gp_camera_get_port_info (gp_params.camera, &info);
        if (params->p.r != GP_OK) {
            gp_log(GP_LOG_ERROR,"port_reset", "camera_get_port_info failed");
            break;
        }
        params->p.r = gp_port_set_info (port, info);
        if (params->p.r != GP_OK) {
            gp_log(GP_LOG_ERROR,"port_reset", "port_set_info failed");
            break;
        }
        params->p.r = gp_port_open (port);
        if (params->p.r != GP_OK) {
            gp_log(GP_LOG_ERROR,"port_reset", "open failed %d", params->p.r);
            break;
        }
        params->p.r = gp_port_reset (port);
        gp_port_close (port);
        gp_port_free (port);

actually i have no clue of the ffi stuff, could you help me with it?

Calling save fails when setting iso, shutterspeed2 or f-number

I can set some configuration keys like imagesize and imagequality then call camera.save and camera.capture just fine. But when I try to set configuration for iso and call camera.save I get an Unspecified error (-1). And when I try to set configuration for shutterspeed2 or f-number and call camera.save I get an Unsupported operation (-6).

This works:

2.1.2 :001 > require 'gphoto2'
 => true 
2.1.2 :002 > camera = GPhoto2::Camera.first
 => #<GPhoto2::Camera:0x007fe6110bc4b8 @window=nil, @config=nil, @dirty=false, @model="Nikon DSC D5200", @port="usb:029,006"> 
2.1.2 :003 > camera['imagequality'] = 'JPEG Basic'
 => "JPEG Basic" 
2.1.2 :004 > camera['imagesize'] = '2992x2000'
 => "2992x2000" 
2.1.2 :005 > camera.save
 => true 
2.1.2 :006 > file = camera.capture
 => #<GPhoto2::CameraFile:0x007fe6129033c8 @cam..........

This doesn't:

2.1.2 :001 > require 'gphoto2'
 => true 
2.1.2 :002 > camera = GPhoto2::Camera.first
 => #<GPhoto2::Camera:0x007fdf2204fca0 @window=nil, @config=nil, @dirty=false, @model="Nikon DSC D5200", @port="usb:029,006"> 
2.1.2 :003 > camera['f-number'].choices
 => ["f/3.5", "f/4", "f/4.5", "f/5", "f/5.6", "f/6.3", "f/7.1", "f/8", "f/9", "f/10", "f/11", "f/13", "f/14", "f/16", "f/18", "f/20", "f/22"] 
2.1.2 :004 > camera['f-number'] = 'f/4.5'
 => "f/4.5" 
2.1.2 :005 > camera.save
RuntimeError: Unsupported operation (-6)
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2.rb:54:in `check!'
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2/camera/configuration.rb:132:in `set_config'
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2/camera/configuration.rb:73:in `save'
    from (irb):5

Nor this:

2.1.2 :001 > require 'gphoto2'
 => true 
2.1.2 :002 > camera = GPhoto2::Camera.first
 => #<GPhoto2::Camera:0x007fae7c0b70e8 @window=nil, @config=nil, @dirty=false, @model="Nikon DSC D5200", @port="usb:029,006"> 
2.1.2 :003 > camera['iso'].choices
 => ["100", "125", "160", "200", "250", "320", "400", "500", "640", "800", "1000", "1250", "1600", "2000", "2500", "3200", "4000", "5000", "6400", "8000", "10000", "12800", "25600"] 
2.1.2 :004 > camera['iso'] = '800'
 => "800" 
2.1.2 :005 > camera.save
RuntimeError: Unspecified error (-1)
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2.rb:54:in `check!'
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2/camera/configuration.rb:132:in `set_config'
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2/camera/configuration.rb:73:in `save'
    from (irb):5

Nor this:

2.1.2 :001 > require 'gphoto2'
 => true 
2.1.2 :002 > camera = GPhoto2::Camera.first
 => #<GPhoto2::Camera:0x007fc9198c4210 @window=nil, @config=nil, @dirty=false, @model="Nikon DSC D5200", @port="usb:029,006"> 
2.1.2 :003 > camera['shutterspeed2'].choices
 => ["1/4000", "1/3200", "1/2500", "1/2000", "1/1600", "1/1250", "1/1000", "1/800", "1/640", "1/500", "1/400", "1/320", "1/250", "1/200", "1/160", "1/125", "1/100", "1/80", "1/60", "1/50", "1/40", "1/30", "1/25", "1/20", "1/15", "1/13", "1/10", "1/8", "1/6", "1/5", "1/4", "1/3", "10/25", "1/2", "10/16", "10/13", "1", "13/10", "16/10", "2", "25/10", "3", "4", "5", "6", "8", "10", "13", "15", "20", "25", "30"] 
2.1.2 :004 > camera['shutterspeed2'] = '1/200'
 => "1/200" 
2.1.2 :005 > camera.save
RuntimeError: Unsupported operation (-6)
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2.rb:54:in `check!'
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2/camera/configuration.rb:132:in `set_config'
    from /Users/grandstand/.rvm/gems/ruby-2.1.2/gems/ffi-gphoto2-0.5.0/lib/gphoto2/camera/configuration.rb:73:in `save'
    from (irb):5

Out of date with current libgphoto2

First, thanks for this gem.

I'm seeing a lot of errors with the latest libgphoto2. Any interest in updating things? (I would be willing to throw a little money behind a bug bounty if you wanted ($200?))

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.