arirusso / unimidi

Realtime MIDI IO for Ruby
Other
255 stars 27 forks source link

Pointer Error when listing midi devices #21

Closed antoinelyset closed 10 years ago

antoinelyset commented 12 years ago

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 commented 12 years ago

@antoinelyset

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

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

antoinelyset commented 12 years ago

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>'
arirusso commented 12 years ago

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

antoinelyset commented 12 years ago

Ok, I will see this ! :)

ghost commented 11 years ago

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

thanks

ghost commented 11 years ago

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

thank you

arirusso commented 11 years ago

@freepoulite

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

ghost commented 11 years ago

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 commented 11 years ago

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

arirusso commented 11 years ago

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

ghost commented 11 years ago

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 commented 11 years ago

is it suppose to work on Lion with ruby 1.9.3?

arirusso commented 11 years ago

Yes, it works for me with that setup

ghost commented 11 years ago

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

arirusso commented 11 years ago

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

ghost commented 11 years ago

http://stackoverflow.com/questions/9166291/converting-a-cfstringref-to-char/9166500#9166500

this solution works for me

thanks for all

arirusso commented 11 years ago

Awesome! can you do a pull request?

ghost commented 11 years ago

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

ghost commented 11 years ago

https://github.com/arirusso/ffi-coremidi/pull/2