Actions
Backport #7516
closedDL::Function#bind causes SEGV when Fiddle is available
Status:
Closed
Assignee:
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) over 11 years ago
- 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) over 11 years ago
- Tracker changed from Bug to Backport
- Project changed from Ruby master to Backport193
- Status changed from Closed to Assigned
- Assignee set to usa (Usaku NAKAMURA)
Please backport r38211 which fixes SEGV bug
Updated by usa (Usaku NAKAMURA) over 11 years ago
- 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
Like0
Like0Like0Like0