Forum: Ruby-core [ruby-trunk - Bug #8692][Open] segv in fiddle

054b5f6b8afdd5f6190bad08e46cd782?d=identicon&s=25 zzak (Zachary Scott) (Guest)
on 2013-07-26 04:46
(Received via mailing list)
Issue #8692 has been reported by zzak (Zachary Scott).

----------------------------------------
Bug #8692: segv in fiddle
https://bugs.ruby-lang.org/issues/8692

Author: zzak (Zachary Scott)
Status: Open
Priority: Normal
Assignee:
Category: ext
Target version:
ruby -v: ruby 2.1.0dev (2013-07-26 trunk 42177) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
(({require 'fiddle'}))
(({libc = Fiddle.dlopen('libc.dylib')}))
(({time = Fiddle::Function.new( libc['time'], [Fiddle::TYPE_VOIDP],
Fiddle::TYPE_VOIDP )}))
(({puts time.call(nil)}))

stack trace: https://gist.github.com/zzak/6085700
=end
054b5f6b8afdd5f6190bad08e46cd782?d=identicon&s=25 zzak (Zachary Scott) (Guest)
on 2013-07-26 04:46
(Received via mailing list)
Issue #8692 has been updated by zzak (Zachary Scott).

Description updated


----------------------------------------
Bug #8692: segv in fiddle
https://bugs.ruby-lang.org/issues/8692#change-40678

Author: zzak (Zachary Scott)
Status: Open
Priority: Normal
Assignee:
Category: ext
Target version:
ruby -v: ruby 2.1.0dev (2013-07-26 trunk 42177) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
(({require 'fiddle'}))

(({libc = Fiddle.dlopen('libc.dylib')}))

(({time = Fiddle::Function.new( libc['time'], [Fiddle::TYPE_VOIDP],
Fiddle::TYPE_VOIDP )}))

(({puts time.call(nil)}))

stack trace: https://gist.github.com/zzak/6085700
=end
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2013-07-26 05:29
(Received via mailing list)
Issue #8692 has been updated by nobu (Nobuyoshi Nakada).

Description updated


----------------------------------------
Bug #8692: segv in fiddle
https://bugs.ruby-lang.org/issues/8692#change-40679

Author: zzak (Zachary Scott)
Status: Open
Priority: Normal
Assignee:
Category: ext
Target version:
ruby -v: ruby 2.1.0dev (2013-07-26 trunk 42177) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
  require 'fiddle'
  libc = Fiddle.dlopen('libc.dylib')
  time = Fiddle::Function.new( libc['time'], [Fiddle::TYPE_VOIDP],
Fiddle::TYPE_VOIDP )
  puts time.call(nil)

stack trace: ((<URL:https://gist.github.com/zzak/6085700>))
=end
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2013-07-26 05:56
(Received via mailing list)
Issue #8692 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Rejected

=begin
(({time()})) returns (({time_t})), not pointer.
As Fiddle doesn't provide (({TYPE_TIME_T})) currently, you have to use
(({TYPE_LONG})) instead.

  require 'fiddle'
  libc = Fiddle.dlopen(nil)
  time = Fiddle::Function.new(libc['time'], [Fiddle::TYPE_VOIDP],
Fiddle::TYPE_LONG)
  puts time.call(nil)
=end

----------------------------------------
Bug #8692: segv in fiddle
https://bugs.ruby-lang.org/issues/8692#change-40681

Author: zzak (Zachary Scott)
Status: Rejected
Priority: Normal
Assignee:
Category: ext
Target version:
ruby -v: ruby 2.1.0dev (2013-07-26 trunk 42177) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
  require 'fiddle'
  libc = Fiddle.dlopen('libc.dylib')
  time = Fiddle::Function.new( libc['time'], [Fiddle::TYPE_VOIDP],
Fiddle::TYPE_VOIDP )
  puts time.call(nil)

stack trace: ((<URL:https://gist.github.com/zzak/6085700>))
=end
This topic is locked and can not be replied to.