Project

General

Profile

Actions

Bug #8692

closed

segv in fiddle

Added by zzak (zzak _) over 11 years ago. Updated over 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-07-26 trunk 42177) [x86_64-darwin12.4.0]
[ruby-core:56187]

Description

=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

Updated by zzak (zzak _) over 11 years ago

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0