Project

General

Profile

This project is closed and read-only.

Actions

Backport #7516

closed

DL::Function#bind causes SEGV when Fiddle is available

Backport #7516: DL::Function#bind causes SEGV when Fiddle is available

Added by ngoto (Naohisa Goto) almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
[ruby-dev:46708]

Description

The following script causes SEGV in "f.call(123, 456)" when fiddle is available.
Without Fiddle, it shows correct result.

require 'dl'
require 'dl/func'
include DL
f = Function.new(CFunc.new(0, TYPE_INT, 'test'), [TYPE_INT, TYPE_INT])
f.bind { |x,y| x + y }
p f.call(123, 456)

Updated by ngoto (Naohisa Goto) almost 14 years ago Actions #1

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38211.
Naohisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/dl/lib/dl/func.rb (DL::Function#bind): When Fiddle is used,
    @ptr (Peter Backman) should be updated. This fixes SEGV raised in DL::Function#call
    after calling DL::Function#bind. [Bug #7516] [ruby-dev:46708]
  • test/dl/test_func.rb (test_bind): test for the above

Updated by ngoto (Naohisa Goto) almost 14 years ago Actions #2

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 13
  • Status changed from Closed to Assigned
  • Assignee set to usa (Usaku NAKAMURA)

Please backport r38211 which fixes SEGV bug

Updated by usa (Usaku NAKAMURA) almost 14 years ago Actions #3

  • Status changed from Assigned to Closed

This issue was solved with changeset r38502.
Naohisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 38211: [Backport #7516]

* ext/dl/lib/dl/func.rb (DL::Function#bind): When Fiddle is used,
  @ptr should be updated. This fixes SEGV raised in DL::Function#call
  after calling DL::Function#bind. [Bug #7516] [ruby-dev:46708]

* test/dl/test_func.rb (test_bind): test for the above
Actions

Also available in: PDF Atom