Pointer Error when listing midi devices #21

Closed
antoinelyset opened this Issue Sep 19, 2012 · 19 comments

Comments

Projects
None yet
2 participants

Hi,

I got an error when listing midi devices :

unimidi list                                                                                                                                                                                   [15:55:29]
input:
/Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/ffi-1.1.5/lib/ffi/pointer.rb:42:in `get_string': invalid memory read at address=0x00000000000000 (FFI::NullPointerError)
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/ffi-1.1.5/lib/ffi/pointer.rb:42:in `read_string'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/ffi-coremidi-0.1.7/lib/coremidi/device.rb:23:in `initialize'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/ffi-coremidi-0.1.7/lib/coremidi/device.rb:41:in `new'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/ffi-coremidi-0.1.7/lib/coremidi/device.rb:41:in `all'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/ffi-coremidi-0.1.7/lib/coremidi/endpoint.rb:52:in `all_by_type'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/unimidi-0.3.3/lib/unimidi/adapter/ffi-coremidi.rb:28:in `populate'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:143:in `ensure_initialized'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:110:in `all_by_type'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:249:in `all'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:55:in `list'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/unimidi-0.3.3/lib/unimidi.rb:26:in `command'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/gems/unimidi-0.3.3/bin/unimidi:10:in `<top (required)>'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/bin/unimidi:19:in `load'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/bin/unimidi:19:in `<main>'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p125-perf/bin/ruby_noexec_wrapper:14:in `<main>'

arirusso was assigned Sep 19, 2012

Owner

arirusso commented Sep 19, 2012

@antoinelyset

thanks, will check it out in the next couple of days

I wonder if it has to do with using p125-perf?

I get the same error with : ruby-1.9.3-p194 (I'm on Mac OS Mountain Lion)

$ unimidi list                                                                                                                                                                                [15:04:57]
input:
/Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.1.5/lib/ffi/pointer.rb:42:in `get_string': invalid memory read at address=0x00000000000000 (FFI::NullPointerError)
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.1.5/lib/ffi/pointer.rb:42:in `read_string'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/ffi-coremidi-0.1.7/lib/coremidi/device.rb:23:in `initialize'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/ffi-coremidi-0.1.7/lib/coremidi/device.rb:41:in `new'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/ffi-coremidi-0.1.7/lib/coremidi/device.rb:41:in `all'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/ffi-coremidi-0.1.7/lib/coremidi/endpoint.rb:52:in `all_by_type'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/unimidi-0.3.3/lib/unimidi/adapter/ffi-coremidi.rb:28:in `populate'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:143:in `ensure_initialized'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:110:in `all_by_type'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:249:in `all'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:55:in `list'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/unimidi-0.3.3/lib/unimidi.rb:26:in `command'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/gems/unimidi-0.3.3/bin/unimidi:10:in `<top (required)>'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/bin/unimidi:19:in `load'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/bin/unimidi:19:in `<main>'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/lyset/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Owner

arirusso commented Sep 20, 2012

I don't have Mountain Lion yet, it's possible they changed the CoreMIDI API. Nonetheless, I'll give it a try on 1.9.3 and hopefully get some idea what's going on. Not unlikely that I'll have Mountain Lion in the next month or so

You may want to try downgrading ffi-1.1.5 to an older version too, like 1.0.x

@antoinelyset

Ok, I will see this ! :)

@ghost

ghost commented Dec 9, 2012

Hello, i've got the same issue here
any news, hints, alternatives ?

thanks

@ghost

ghost commented Dec 11, 2012

drowngrade ffi to 1.0.x don't solve the problem for me
any help would be really appreciated

thank you

Owner

arirusso commented Dec 11, 2012

@freepoulite

I haven't been able to recreate this error... What OS and Ruby version are you using?

@ghost

ghost commented Dec 11, 2012

Hello

thank you for answering me
i'm using osx 10.7.5 and ruby 1.9.3p327

imac-de-pierre:~ pierrebaille$ unimidi list
input:
/Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/ffi-1.2.0/lib/ffi/pointer.rb:42:in get_string': invalid memory read at address=0x00000000000000 (FFI::NullPointerError) from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/ffi-1.2.0/lib/ffi/pointer.rb:42:inread_string'
from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/ffi-coremidi-0.1.8/lib/coremidi/device.rb:23:in initialize' from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/ffi-coremidi-0.1.8/lib/coremidi/device.rb:41:innew'
from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/ffi-coremidi-0.1.8/lib/coremidi/device.rb:41:in all' from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/ffi-coremidi-0.1.8/lib/coremidi/endpoint.rb:52:inall_by_type'
from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/unimidi-0.3.3/lib/unimidi/adapter/ffi-coremidi.rb:28:in populate' from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:143:inensure_initialized'
from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:110:in all_by_type' from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:249:inall'
from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/unimidi-0.3.3/lib/unimidi/congruous_api_adapter.rb:55:in list' from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/unimidi-0.3.3/lib/unimidi.rb:26:incommand'
from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/gems/unimidi-0.3.3/bin/unimidi:10:in <top (required)>' from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/bin/unimidi:19:inload'
from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/bin/unimidi:19:in <main>' from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:ineval'
from /Users/pierrebaille/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `

'

thank you

Pierre

Le 11 déc. 2012 à 16:46, Ari Russo a écrit :

@freepoulite

I haven't been able to recreate this error... What OS and Ruby version are you using?


Reply to this email directly or view it on GitHub.

@ghost

ghost commented Dec 12, 2012

I've just try on another machine with fresh ruby install and same OS and ruby version and it give me the same thing
good luck and thanks for your time

Owner

arirusso commented Dec 12, 2012

Do you have any MIDI devices connected? any IAC devices? Are you using RVM?

@ghost

ghost commented Dec 12, 2012

i've tried several combinations, with or without Midi devices connected, with or without IAC ports available and yes i'm using rvm.
i have try "unimidi list" with ruby 1.8.7 with the same result
i haven't been able to install 1.9.2 for the moment

@ghost

ghost commented Dec 14, 2012

is it suppose to work on Lion with ruby 1.9.3?

Owner

arirusso commented Dec 14, 2012

Yes, it works for me with that setup

@ghost

ghost commented Dec 14, 2012

someone told me that this issue comes from a compatibility problem between macos and ruby and should be fixed with rbenv, but i'm a beginner and i can't find a way to solve it... anyway... thanks a lot for all

Owner

arirusso commented Dec 14, 2012

I'll have a look at it but it's going to have to wait a little bit

Owner

arirusso commented Dec 27, 2012

Awesome! can you do a pull request?

@ghost

ghost commented Dec 28, 2012

sorry the link in my preview post is wrong
here it is http://stackoverflow.com/questions/14030213/ffi-null-pointer-error-with-unimidi

arirusso closed this Aug 31, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment