Bug #8692

segv in fiddle

Added by Zachary Scott 9 months ago. Updated 9 months ago.

[ruby-core:56187]
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

Description

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

stack trace: ((URL:https://gist.github.com/zzak/6085700))
=end

History

#1 Updated by Zachary Scott 9 months ago

  • Description updated (diff)

#2 Updated by Nobuyoshi Nakada 9 months ago

  • Description updated (diff)

#3 Updated by Nobuyoshi Nakada 9 months ago

  • Status changed from Open to Rejected

=begin
(({time()})) returns (({timet})), not pointer.
As Fiddle doesn't provide (({TYPE
TIMET})) currently, you have to use (({TYPELONG})) instead.

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

Also available in: Atom PDF