chetan / dht-sensor-ffi

A ruby library to read from a DHT-XX type humidity/temperature sensor
MIT License
26 stars 6 forks source link

Segmentation Fault #6

Closed sol-vin closed 11 months ago

sol-vin commented 7 years ago
2.4.0 :001 > require "dht-sensor-ffi"
 => true
2.4.0 :002 > val DhtSensor.read(21, 11)
/home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb:23: [BUG] Segmentation fault at 0x000007
ruby 2.4.0p0 (2016-12-24 revision 57164) [armv7l-linux-eabihf]

-- Control frame information -----------------------------------------------
c:0021 p:---- s:0114 e:000113 CFUNC  :readDHT
c:0020 p:0091 s:0106 e:000105 METHOD /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb:23
c:0019 p:0017 s:0096 e:000094 EVAL   (irb):2 [FINISH]
c:0018 p:---- s:0092 e:000091 CFUNC  :eval
c:0017 p:0025 s:0084 e:000083 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/workspace.rb:87
c:0016 p:0027 s:0076 e:000074 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/context.rb:381
c:0015 p:0024 s:0069 e:000068 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:493
c:0014 p:0041 s:0060 e:000059 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:627
c:0013 p:0011 s:0054 e:000053 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:490
c:0012 p:0128 s:0049 e:000048 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:246 [FINISH]
c:0011 p:---- s:0045 e:000044 CFUNC  :loop
c:0010 p:0009 s:0041 e:000040 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:232 [FINISH]
c:0009 p:---- s:0038 e:000037 CFUNC  :catch
c:0008 p:0018 s:0033 e:000032 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:231
c:0007 p:0037 s:0029 E:0007f8 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:489
c:0006 p:0008 s:0025 e:000024 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:430 [FINISH]
c:0005 p:---- s:0022 e:000021 CFUNC  :catch
c:0004 p:0075 s:0017 E:0022ac METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:429
c:0003 p:0118 s:0012 e:000011 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:385
c:0002 p:0023 s:0006 e:000005 EVAL   /home/pi/.rvm/rubies/ruby-2.4.0/bin/irb:11 [FINISH]
c:0001 p:0000 s:0003 E:001020 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/home/pi/.rvm/rubies/ruby-2.4.0/bin/irb:11:in `<main>'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:385:in `start'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:429:in `run'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:429:in `catch'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:430:in `block in run'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:489:in `eval_input'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:231:in `each_top_level_statement'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:231:in `catch'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:232:in `block in each_top_level_statement'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:232:in `loop'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:246:in `block (2 levels) in each_top_level_statement'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:490:in `block in eval_input'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:627:in `signal_status'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:493:in `block (2 levels) in eval_input'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/context.rb:381:in `evaluate'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/workspace.rb:87:in `evaluate'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/workspace.rb:87:in `eval'
(irb):2:in `irb_binding'
/home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb:23:in `read'
/home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb:23:in `readDHT'

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

* Loaded script: irb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/encdb.so
    5 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/trans/transdb.so
    6 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/unicode_normalize.rb
    7 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/rbconfig.rb
    8 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/compatibility.rb
    9 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/defaults.rb
   10 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/deprecate.rb
   11 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/errors.rb
   12 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/version.rb
   13 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/requirement.rb
   14 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/platform.rb
   15 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/basic_specification.rb
   16 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/stub_specification.rb
   17 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/util/list.rb
   18 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/stringio.so
   19 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/specification.rb
   20 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/exceptions.rb
   21 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/dependency.rb
   22 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   23 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/monitor.rb
   24 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   25 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems.rb
   26 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/path_support.rb
   27 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/version.rb
   28 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/core_ext/name_error.rb
   29 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/levenshtein.rb
   30 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/jaro_winkler.rb
   31 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checker.rb
   32 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb
   33 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   34 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   35 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb
   36 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/method_name_checker.rb
   37 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/null_checker.rb
   38 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/formatter.rb
   39 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean.rb
   40 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/e2mmap.rb
   41 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/init.rb
   42 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/workspace.rb
   43 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/inspector.rb
   44 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/output-method.rb
   45 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/context.rb
   46 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/extend-command.rb
   47 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/notifier.rb
   48 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/slex.rb
   49 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-token.rb
   50 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb
   51 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/src_encoding.rb
   52 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/magic-file.rb
   53 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/readline.so
   54 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/input-method.rb
   55 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/locale.rb
   56 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb
   57 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/completion.rb
   58 /home/pi/.rvm/scripts/irbrc.rb
   59 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/dht_sensor.so
   60 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/reading.rb
   61 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi_c.so
   62 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/platform.rb
   63 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/types.rb
   64 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/library.rb
   65 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/errno.rb
   66 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/pointer.rb
   67 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/memorypointer.rb
   68 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/struct_layout_builder.rb
   69 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/struct.rb
   70 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/union.rb
   71 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/managedstruct.rb
   72 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/callback.rb
   73 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/io.rb
   74 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/autopointer.rb
   75 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/variadic.rb
   76 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/enum.rb
   77 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/ffi.rb
   78 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi.rb
   79 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb

* Process memory map:

00010000-00011000 r-xp 00000000 b3:07 272806     /home/pi/.rvm/rubies/ruby-2.4.0/bin/ruby
00020000-00021000 rw-p 00000000 b3:07 272806     /home/pi/.rvm/rubies/ruby-2.4.0/bin/ruby
01824000-01b85000 rw-p 00000000 00:00 0          [heap]
755d7000-755dd000 r-xp 00000000 b3:07 134827     /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.2
755dd000-755e5000 ---p 00006000 b3:07 134827     /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.2
755e5000-755e6000 r--p 00006000 b3:07 134827     /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.2
755e6000-755e7000 rw-p 00007000 b3:07 134827     /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.2
755e7000-75604000 r-xp 00000000 b3:07 402430     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi_c.so
75604000-75614000 ---p 0001d000 b3:07 402430     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi_c.so
75614000-75615000 rw-p 0001d000 b3:07 402430     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi_c.so
75615000-76615000 rw-s 00000000 00:06 1712       /dev/gpiomem
76615000-76632000 r-xp 00000000 b3:07 262273     /lib/arm-linux-gnueabihf/libgcc_s.so.1
76632000-76641000 ---p 0001d000 b3:07 262273     /lib/arm-linux-gnueabihf/libgcc_s.so.1
76641000-76642000 rw-p 0001c000 b3:07 262273     /lib/arm-linux-gnueabihf/libgcc_s.so.1
76642000-76703000 r-xp 00000000 b3:07 134550     /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20
76703000-76712000 ---p 000c1000 b3:07 134550     /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20
76712000-76716000 r--p 000c0000 b3:07 134550     /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20
76716000-76718000 rw-p 000c4000 b3:07 134550     /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20
76718000-7671e000 rw-p 00000000 00:00 0
76731000-76736000 r-xp 00000000 b3:07 533001     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/dht_sensor.so
76736000-76745000 ---p 00005000 b3:07 533001     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/dht_sensor.so
76745000-76746000 rw-p 00004000 b3:07 533001     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/dht_sensor.so
76746000-76762000 r-xp 00000000 b3:07 262392     /lib/arm-linux-gnueabihf/libtinfo.so.5.9
76762000-76771000 ---p 0001c000 b3:07 262392     /lib/arm-linux-gnueabihf/libtinfo.so.5.9
76771000-76773000 r--p 0001b000 b3:07 262392     /lib/arm-linux-gnueabihf/libtinfo.so.5.9
76773000-76774000 rw-p 0001d000 b3:07 262392     /lib/arm-linux-gnueabihf/libtinfo.so.5.9
76774000-76790000 r-xp 00000000 b3:07 262393     /lib/arm-linux-gnueabihf/libncurses.so.5.9
76790000-7679f000 ---p 0001c000 b3:07 262393     /lib/arm-linux-gnueabihf/libncurses.so.5.9
7679f000-767a0000 r--p 0001b000 b3:07 262393     /lib/arm-linux-gnueabihf/libncurses.so.5.9
767a0000-767a1000 rw-p 0001c000 b3:07 262393     /lib/arm-linux-gnueabihf/libncurses.so.5.9
767a1000-767d4000 r-xp 00000000 b3:07 262360     /lib/arm-linux-gnueabihf/libreadline.so.6.3
767d4000-767dc000 ---p 00033000 b3:07 262360     /lib/arm-linux-gnueabihf/libreadline.so.6.3
767dc000-767dd000 r--p 00033000 b3:07 262360     /lib/arm-linux-gnueabihf/libreadline.so.6.3
767dd000-767e1000 rw-p 00034000 b3:07 262360     /lib/arm-linux-gnueabihf/libreadline.so.6.3
767e1000-767e2000 rw-p 00000000 00:00 0
767ee000-767f5000 r--s 00000000 b3:07 136693     /usr/lib/arm-linux-gnueabihf/gconv/gconv-modules.cache
767f5000-767fb000 r-xp 00000000 b3:07 402273     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/readline.so
767fb000-7680a000 ---p 00006000 b3:07 402273     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/readline.so
7680a000-7680b000 rw-p 00005000 b3:07 402273     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/readline.so
7680b000-76811000 r-xp 00000000 b3:07 402271     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/stringio.so
76811000-76821000 ---p 00006000 b3:07 402271     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/stringio.so
76821000-76822000 rw-p 00006000 b3:07 402271     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/stringio.so
76822000-76824000 r-xp 00000000 b3:07 530938     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/trans/transdb.so
76824000-76833000 ---p 00002000 b3:07 530938     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/trans/transdb.so
76833000-76834000 rw-p 00001000 b3:07 530938     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/trans/transdb.so
76834000-768b5000 rw-p 00000000 00:00 0
768b5000-76a3e000 r--p 00000000 b3:07 140922     /usr/lib/locale/locale-archive
76a3e000-76b69000 r-xp 00000000 b3:07 262334     /lib/arm-linux-gnueabihf/libc-2.19.so
76b69000-76b79000 ---p 0012b000 b3:07 262334     /lib/arm-linux-gnueabihf/libc-2.19.so
76b79000-76b7b000 r--p 0012b000 b3:07 262334     /lib/arm-linux-gnueabihf/libc-2.19.so
76b7b000-76b7c000 rw-p 0012d000 b3:07 262334     /lib/arm-linux-gnueabihf/libc-2.19.so
76b7c000-76b7f000 rw-p 00000000 00:00 0
76b7f000-76be8000 r-xp 00000000 b3:07 262288     /lib/arm-linux-gnueabihf/libm-2.19.so
76be8000-76bf8000 ---p 00069000 b3:07 262288     /lib/arm-linux-gnueabihf/libm-2.19.so
76bf8000-76bf9000 r--p 00069000 b3:07 262288     /lib/arm-linux-gnueabihf/libm-2.19.so
76bf9000-76bfa000 rw-p 0006a000 b3:07 262288     /lib/arm-linux-gnueabihf/libm-2.19.so
76bfa000-76c01000 r-xp 00000000 b3:07 262379     /lib/arm-linux-gnueabihf/libcrypt-2.19.so
76c01000-76c10000 ---p 00007000 b3:07 262379     /lib/arm-linux-gnueabihf/libcrypt-2.19.so
76c10000-76c11000 r--p 00006000 b3:07 262379     /lib/arm-linux-gnueabihf/libcrypt-2.19.so
76c11000-76c12000 rw-p 00007000 b3:07 262379     /lib/arm-linux-gnueabihf/libcrypt-2.19.so
76c12000-76c39000 rw-p 00000000 00:00 0
76c39000-76c3b000 r-xp 00000000 b3:07 262409     /lib/arm-linux-gnueabihf/libdl-2.19.so
76c3b000-76c4a000 ---p 00002000 b3:07 262409     /lib/arm-linux-gnueabihf/libdl-2.19.so
76c4a000-76c4b000 r--p 00001000 b3:07 262409     /lib/arm-linux-gnueabihf/libdl-2.19.so
76c4b000-76c4c000 rw-p 00002000 b3:07 262409     /lib/arm-linux-gnueabihf/libdl-2.19.so
76c4c000-76cad000 r-xp 00000000 b3:07 134537     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.2.0
76cad000-76cbc000 ---p 00061000 b3:07 134537     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.2.0
76cbc000-76cbd000 r--p 00060000 b3:07 134537     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.2.0
76cbd000-76cbe000 rw-p 00061000 b3:07 134537     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.2.0
76cbe000-76cd2000 r-xp 00000000 b3:07 262347     /lib/arm-linux-gnueabihf/libpthread-2.19.so
76cd2000-76ce2000 ---p 00014000 b3:07 262347     /lib/arm-linux-gnueabihf/libpthread-2.19.so
76ce2000-76ce3000 r--p 00014000 b3:07 262347     /lib/arm-linux-gnueabihf/libpthread-2.19.so
76ce3000-76ce4000 rw-p 00015000 b3:07 262347     /lib/arm-linux-gnueabihf/libpthread-2.19.so
76ce4000-76ce6000 rw-p 00000000 00:00 0
76ce7000-76ce9000 r-xp 00000000 b3:07 530925     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/encdb.so
76ce9000-76cf8000 ---p 00002000 b3:07 530925     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/encdb.so
76cf8000-76cf9000 rw-p 00001000 b3:07 530925     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/encdb.so
76cf9000-76f81000 r-xp 00000000 b3:07 401829     /home/pi/.rvm/rubies/ruby-2.4.0/lib/libruby.so.2.4.0
76f81000-76f90000 ---p 00288000 b3:07 401829     /home/pi/.rvm/rubies/ruby-2.4.0/lib/libruby.so.2.4.0
76f90000-76f95000 rw-p 00287000 b3:07 401829     /home/pi/.rvm/rubies/ruby-2.4.0/lib/libruby.so.2.4.0
76f95000-76f9b000 rw-p 00000000 00:00 0
76f9b000-76fa0000 r-xp 00000000 b3:07 135036     /usr/lib/arm-linux-gnueabihf/libarmmem.so
76fa0000-76faf000 ---p 00005000 b3:07 135036     /usr/lib/arm-linux-gnueabihf/libarmmem.so
76faf000-76fb0000 rw-p 00004000 b3:07 135036     /usr/lib/arm-linux-gnueabihf/libarmmem.so
76fb0000-76fd0000 r-xp 00000000 b3:07 262239     /lib/arm-linux-gnueabihf/ld-2.19.so
76fd2000-76fd3000 rw-p 00000000 00:00 0
76fd3000-76fd4000 r-xp 00000000 00:00 0
76fd4000-76fd6000 rw-p 00000000 00:00 0
76fd6000-76fd7000 ---p 00000000 00:00 0
76fd7000-76fda000 rwxp 00000000 00:00 0
76fda000-76fdf000 rw-p 00000000 00:00 0
76fdf000-76fe0000 r--p 0001f000 b3:07 262239     /lib/arm-linux-gnueabihf/ld-2.19.so
76fe0000-76fe1000 rw-p 00020000 b3:07 262239     /lib/arm-linux-gnueabihf/ld-2.19.so
7e18d000-7e98c000 rwxp 00000000 00:00 0          [stack]
7ea3a000-7ea3b000 r-xp 00000000 00:00 0          [sigpage]
7ea3b000-7ea3c000 r--p 00000000 00:00 0          [vvar]
7ea3c000-7ea3d000 r-xp 00000000 00:00 0          [vdso]
ffff0000-ffff1000 r-xp 00000000 00:00 0          [vectors]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted
pi@raspberrypi:~ $

This happens when using the latest Raspian with the DHT11 on an RPI3.

uname -a: Linux raspberrypi 4.4.34-v7+ #930 SMP Wed Nov 23 15:20:41 GMT 2016 armv7l GNU/Linux

gem list:

pi@raspberrypi:~ $ gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.3.0)
bundler-unload (1.0.2)
dht-sensor-ffi (0.2.0)
did_you_mean (1.1.0)
executable-hooks (1.3.2)
ffi (1.9.17)
gem-wrappers (1.2.7)
io-console (default: 0.4.6)
json (default: 2.0.2)
minitest (5.10.1)
net-telnet (0.1.1)
openssl (default: 2.0.2)
power_assert (0.4.1)
psych (default: 2.2.2)
rake (12.0.0)
rdoc (default: 5.0.0)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
test-unit (3.2.3)
xmlrpc (0.2.1)
pi@raspberrypi:~ $
vizvamitra commented 7 years ago

@redcodefinal I've just encountered the same problem and it turned out that I simply ran my script without sudo.

chetan commented 7 years ago

@vizvamitra Do you mean to say that running with sudo fixed the issue for you? I can amend the readme to note that this may be necessary (as it was previously)

vizvamitra commented 7 years ago

@chetan yes, running with sudo fixed the issue

sol-vin commented 7 years ago

Same issue.


pi@raspberrypi:~ $ rvmsudo gem install dht-sensor-ffi
Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. Run:

    export rvmsudo_secure_path=1

to avoid the warning, put it in shell initialization file to make it persistent.

In case there is no `secure_path` in `/etc/sudoers`. Run:

    export rvmsudo_secure_path=0

to avoid the warning, put it in shell initialization file to make it persistent.
Building native extensions.  This could take a while...
Successfully installed dht-sensor-ffi-0.2.0
Parsing documentation for dht-sensor-ffi-0.2.0
Done installing documentation for dht-sensor-ffi after 1 seconds
1 gem installed
pi@raspberrypi:~ $ irb
2.4.0 :001 > require "dht-sensor-ffi"
 => true
2.4.0 :002 > DhtSensor.read(5, 11)
/home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb:23: [BUG] Segmentation fault at 0x000007
ruby 2.4.0p0 (2016-12-24 revision 57164) [armv7l-linux-eabihf]

-- Control frame information -----------------------------------------------
c:0021 p:---- s:0113 e:000112 CFUNC  :readDHT
c:0020 p:0091 s:0105 e:000104 METHOD /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb:23
c:0019 p:0016 s:0095 e:000094 EVAL   (irb):2 [FINISH]
c:0018 p:---- s:0092 e:000091 CFUNC  :eval
c:0017 p:0025 s:0084 e:000083 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/workspace.rb:87
c:0016 p:0027 s:0076 e:000074 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/context.rb:381
c:0015 p:0024 s:0069 e:000068 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:493
c:0014 p:0041 s:0060 e:000059 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:627
c:0013 p:0011 s:0054 e:000053 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:490
c:0012 p:0128 s:0049 e:000048 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:246 [FINISH]
c:0011 p:---- s:0045 e:000044 CFUNC  :loop
c:0010 p:0009 s:0041 e:000040 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:232 [FINISH]
c:0009 p:---- s:0038 e:000037 CFUNC  :catch
c:0008 p:0018 s:0033 e:000032 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:231
c:0007 p:0037 s:0029 E:0004d8 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:489
c:0006 p:0008 s:0025 e:000024 BLOCK  /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:430 [FINISH]
c:0005 p:---- s:0022 e:000021 CFUNC  :catch
c:0004 p:0075 s:0017 E:000fec METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:429
c:0003 p:0118 s:0012 e:000011 METHOD /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:385
c:0002 p:0023 s:0006 e:000005 EVAL   /home/pi/.rvm/rubies/ruby-2.4.0/bin/irb:11 [FINISH]
c:0001 p:0000 s:0003 E:002040 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/home/pi/.rvm/rubies/ruby-2.4.0/bin/irb:11:in `<main>'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:385:in `start'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:429:in `run'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:429:in `catch'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:430:in `block in run'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:489:in `eval_input'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:231:in `each_top_level_statement'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:231:in `catch'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:232:in `block in each_top_level_statement'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:232:in `loop'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb:246:in `block (2 levels) in each_top_level_statement'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:490:in `block in eval_input'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:627:in `signal_status'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb:493:in `block (2 levels) in eval_input'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/context.rb:381:in `evaluate'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/workspace.rb:87:in `evaluate'
/home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/workspace.rb:87:in `eval'
(irb):2:in `irb_binding'
/home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb:23:in `read'
/home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb:23:in `readDHT'

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

* Loaded script: irb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/encdb.so
    5 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/trans/transdb.so
    6 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/unicode_normalize.rb
    7 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/rbconfig.rb
    8 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/compatibility.rb
    9 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/defaults.rb
   10 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/deprecate.rb
   11 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/errors.rb
   12 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/version.rb
   13 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/requirement.rb
   14 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/platform.rb
   15 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/basic_specification.rb
   16 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/stub_specification.rb
   17 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/util/list.rb
   18 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/stringio.so
   19 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/specification.rb
   20 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/exceptions.rb
   21 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/dependency.rb
   22 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   23 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/monitor.rb
   24 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   25 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems.rb
   26 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/path_support.rb
   27 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/version.rb
   28 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/core_ext/name_error.rb
   29 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/levenshtein.rb
   30 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/jaro_winkler.rb
   31 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checker.rb
   32 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb
   33 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   34 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   35 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb
   36 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/method_name_checker.rb
   37 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/null_checker.rb
   38 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean/formatter.rb
   39 /home/pi/.rvm/gems/ruby-2.4.0@global/gems/did_you_mean-1.1.0/lib/did_you_mean.rb
   40 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/e2mmap.rb
   41 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/init.rb
   42 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/workspace.rb
   43 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/inspector.rb
   44 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/output-method.rb
   45 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/context.rb
   46 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/extend-command.rb
   47 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/notifier.rb
   48 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/slex.rb
   49 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-token.rb
   50 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/ruby-lex.rb
   51 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/src_encoding.rb
   52 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/magic-file.rb
   53 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/readline.so
   54 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/input-method.rb
   55 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/locale.rb
   56 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb.rb
   57 /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/irb/completion.rb
   58 /home/pi/.rvm/scripts/irbrc.rb
   59 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/dht_sensor.so
   60 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/reading.rb
   61 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi_c.so
   62 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/platform.rb
   63 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/types.rb
   64 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/library.rb
   65 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/errno.rb
   66 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/pointer.rb
   67 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/memorypointer.rb
   68 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/struct_layout_builder.rb
   69 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/struct.rb
   70 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/union.rb
   71 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/managedstruct.rb
   72 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/callback.rb
   73 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/io.rb
   74 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/autopointer.rb
   75 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/variadic.rb
   76 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/enum.rb
   77 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi/ffi.rb
   78 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi.rb
   79 /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor-ffi.rb

* Process memory map:

00010000-00011000 r-xp 00000000 b3:07 272806     /home/pi/.rvm/rubies/ruby-2.4.0/bin/ruby
00020000-00021000 rw-p 00000000 b3:07 272806     /home/pi/.rvm/rubies/ruby-2.4.0/bin/ruby
00b9d000-00f18000 rw-p 00000000 00:00 0          [heap]
75576000-7557c000 r-xp 00000000 b3:07 134827     /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.2
7557c000-75584000 ---p 00006000 b3:07 134827     /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.2
75584000-75585000 r--p 00006000 b3:07 134827     /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.2
75585000-75586000 rw-p 00007000 b3:07 134827     /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.2
75586000-755a3000 r-xp 00000000 b3:07 402430     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi_c.so
755a3000-755b3000 ---p 0001d000 b3:07 402430     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi_c.so
755b3000-755b4000 rw-p 0001d000 b3:07 402430     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/ffi-1.9.17/lib/ffi_c.so
755b4000-765b4000 rw-s 00000000 00:06 1576       /dev/gpiomem
765b4000-765d1000 r-xp 00000000 b3:07 262273     /lib/arm-linux-gnueabihf/libgcc_s.so.1
765d1000-765e0000 ---p 0001d000 b3:07 262273     /lib/arm-linux-gnueabihf/libgcc_s.so.1
765e0000-765e1000 rw-p 0001c000 b3:07 262273     /lib/arm-linux-gnueabihf/libgcc_s.so.1
765e1000-766a2000 r-xp 00000000 b3:07 134550     /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20
766a2000-766b1000 ---p 000c1000 b3:07 134550     /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20
766b1000-766b5000 r--p 000c0000 b3:07 134550     /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20
766b5000-766b7000 rw-p 000c4000 b3:07 134550     /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20
766b7000-766bd000 rw-p 00000000 00:00 0
766d1000-766d6000 r-xp 00000000 b3:07 533000     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/dht_sensor.so
766d6000-766e5000 ---p 00005000 b3:07 533000     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/dht_sensor.so
766e5000-766e6000 rw-p 00004000 b3:07 533000     /home/pi/.rvm/gems/ruby-2.4.0@bucket/gems/dht-sensor-ffi-0.2.0/lib/dht-sensor/dht_sensor.so
766e6000-76702000 r-xp 00000000 b3:07 262392     /lib/arm-linux-gnueabihf/libtinfo.so.5.9
76702000-76711000 ---p 0001c000 b3:07 262392     /lib/arm-linux-gnueabihf/libtinfo.so.5.9
76711000-76713000 r--p 0001b000 b3:07 262392     /lib/arm-linux-gnueabihf/libtinfo.so.5.9
76713000-76714000 rw-p 0001d000 b3:07 262392     /lib/arm-linux-gnueabihf/libtinfo.so.5.9
76714000-76730000 r-xp 00000000 b3:07 262393     /lib/arm-linux-gnueabihf/libncurses.so.5.9
76730000-7673f000 ---p 0001c000 b3:07 262393     /lib/arm-linux-gnueabihf/libncurses.so.5.9
7673f000-76740000 r--p 0001b000 b3:07 262393     /lib/arm-linux-gnueabihf/libncurses.so.5.9
76740000-76741000 rw-p 0001c000 b3:07 262393     /lib/arm-linux-gnueabihf/libncurses.so.5.9
76741000-76774000 r-xp 00000000 b3:07 262360     /lib/arm-linux-gnueabihf/libreadline.so.6.3
76774000-7677c000 ---p 00033000 b3:07 262360     /lib/arm-linux-gnueabihf/libreadline.so.6.3
7677c000-7677d000 r--p 00033000 b3:07 262360     /lib/arm-linux-gnueabihf/libreadline.so.6.3
7677d000-76781000 rw-p 00034000 b3:07 262360     /lib/arm-linux-gnueabihf/libreadline.so.6.3
76781000-76782000 rw-p 00000000 00:00 0
7678f000-76796000 r--s 00000000 b3:07 136693     /usr/lib/arm-linux-gnueabihf/gconv/gconv-modules.cache
76796000-7679c000 r-xp 00000000 b3:07 402273     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/readline.so
7679c000-767ab000 ---p 00006000 b3:07 402273     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/readline.so
767ab000-767ac000 rw-p 00005000 b3:07 402273     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/readline.so
767ac000-767b2000 r-xp 00000000 b3:07 402271     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/stringio.so
767b2000-767c2000 ---p 00006000 b3:07 402271     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/stringio.so
767c2000-767c3000 rw-p 00006000 b3:07 402271     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/stringio.so
767c3000-767c5000 r-xp 00000000 b3:07 530938     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/trans/transdb.so
767c5000-767d4000 ---p 00002000 b3:07 530938     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/trans/transdb.so
767d4000-767d5000 rw-p 00001000 b3:07 530938     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/trans/transdb.so
767d5000-76856000 rw-p 00000000 00:00 0
76856000-769df000 r--p 00000000 b3:07 140922     /usr/lib/locale/locale-archive
769df000-76b0a000 r-xp 00000000 b3:07 262334     /lib/arm-linux-gnueabihf/libc-2.19.so
76b0a000-76b1a000 ---p 0012b000 b3:07 262334     /lib/arm-linux-gnueabihf/libc-2.19.so
76b1a000-76b1c000 r--p 0012b000 b3:07 262334     /lib/arm-linux-gnueabihf/libc-2.19.so
76b1c000-76b1d000 rw-p 0012d000 b3:07 262334     /lib/arm-linux-gnueabihf/libc-2.19.so
76b1d000-76b20000 rw-p 00000000 00:00 0
76b20000-76b89000 r-xp 00000000 b3:07 262288     /lib/arm-linux-gnueabihf/libm-2.19.so
76b89000-76b99000 ---p 00069000 b3:07 262288     /lib/arm-linux-gnueabihf/libm-2.19.so
76b99000-76b9a000 r--p 00069000 b3:07 262288     /lib/arm-linux-gnueabihf/libm-2.19.so
76b9a000-76b9b000 rw-p 0006a000 b3:07 262288     /lib/arm-linux-gnueabihf/libm-2.19.so
76b9b000-76ba2000 r-xp 00000000 b3:07 262379     /lib/arm-linux-gnueabihf/libcrypt-2.19.so
76ba2000-76bb1000 ---p 00007000 b3:07 262379     /lib/arm-linux-gnueabihf/libcrypt-2.19.so
76bb1000-76bb2000 r--p 00006000 b3:07 262379     /lib/arm-linux-gnueabihf/libcrypt-2.19.so
76bb2000-76bb3000 rw-p 00007000 b3:07 262379     /lib/arm-linux-gnueabihf/libcrypt-2.19.so
76bb3000-76bda000 rw-p 00000000 00:00 0
76bda000-76bdc000 r-xp 00000000 b3:07 262409     /lib/arm-linux-gnueabihf/libdl-2.19.so
76bdc000-76beb000 ---p 00002000 b3:07 262409     /lib/arm-linux-gnueabihf/libdl-2.19.so
76beb000-76bec000 r--p 00001000 b3:07 262409     /lib/arm-linux-gnueabihf/libdl-2.19.so
76bec000-76bed000 rw-p 00002000 b3:07 262409     /lib/arm-linux-gnueabihf/libdl-2.19.so
76bed000-76c4e000 r-xp 00000000 b3:07 134537     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.2.0
76c4e000-76c5d000 ---p 00061000 b3:07 134537     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.2.0
76c5d000-76c5e000 r--p 00060000 b3:07 134537     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.2.0
76c5e000-76c5f000 rw-p 00061000 b3:07 134537     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.2.0
76c5f000-76c73000 r-xp 00000000 b3:07 262347     /lib/arm-linux-gnueabihf/libpthread-2.19.so
76c73000-76c83000 ---p 00014000 b3:07 262347     /lib/arm-linux-gnueabihf/libpthread-2.19.so
76c83000-76c84000 r--p 00014000 b3:07 262347     /lib/arm-linux-gnueabihf/libpthread-2.19.so
76c84000-76c85000 rw-p 00015000 b3:07 262347     /lib/arm-linux-gnueabihf/libpthread-2.19.so
76c85000-76c87000 rw-p 00000000 00:00 0
76c89000-76c8b000 r-xp 00000000 b3:07 530925     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/encdb.so
76c8b000-76c9a000 ---p 00002000 b3:07 530925     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/encdb.so
76c9a000-76c9b000 rw-p 00001000 b3:07 530925     /home/pi/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/armv7l-linux-eabihf/enc/encdb.so
76c9b000-76f23000 r-xp 00000000 b3:07 401829     /home/pi/.rvm/rubies/ruby-2.4.0/lib/libruby.so.2.4.0
76f23000-76f32000 ---p 00288000 b3:07 401829     /home/pi/.rvm/rubies/ruby-2.4.0/lib/libruby.so.2.4.0
76f32000-76f37000 rw-p 00287000 b3:07 401829     /home/pi/.rvm/rubies/ruby-2.4.0/lib/libruby.so.2.4.0
76f37000-76f3d000 rw-p 00000000 00:00 0
76f3d000-76f42000 r-xp 00000000 b3:07 135036     /usr/lib/arm-linux-gnueabihf/libarmmem.so
76f42000-76f51000 ---p 00005000 b3:07 135036     /usr/lib/arm-linux-gnueabihf/libarmmem.so
76f51000-76f52000 rw-p 00004000 b3:07 135036     /usr/lib/arm-linux-gnueabihf/libarmmem.so
76f52000-76f72000 r-xp 00000000 b3:07 262239     /lib/arm-linux-gnueabihf/ld-2.19.so
76f74000-76f75000 rw-p 00000000 00:00 0
76f75000-76f76000 r-xp 00000000 00:00 0
76f76000-76f78000 rw-p 00000000 00:00 0
76f78000-76f79000 ---p 00000000 00:00 0
76f79000-76f7c000 rwxp 00000000 00:00 0
76f7c000-76f81000 rw-p 00000000 00:00 0
76f81000-76f82000 r--p 0001f000 b3:07 262239     /lib/arm-linux-gnueabihf/ld-2.19.so
76f82000-76f83000 rw-p 00020000 b3:07 262239     /lib/arm-linux-gnueabihf/ld-2.19.so
7e188000-7e987000 rwxp 00000000 00:00 0          [stack]
7eef8000-7eef9000 r-xp 00000000 00:00 0          [sigpage]
7eef9000-7eefa000 r--p 00000000 00:00 0          [vvar]
7eefa000-7eefb000 r-xp 00000000 00:00 0          [vdso]
ffff0000-ffff1000 r-xp 00000000 00:00 0          [vectors]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted
pi@raspberrypi:~ $
chetan commented 7 years ago

Did you try sudo irb? That should work 

sol-vin commented 7 years ago

Oh I'm sorry I thought you meant sudo the gem install let me see if that will work.

EDIT: Absolutely fixed it thank you so much! I don't understand why we need to sudo though I thought we were only reading GPIO and my version of Raspian is the one where they made GPIO unprivileged.