Project

General

Profile

Backport #7516

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

Added by ngoto (Naohisa Goto) almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[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)

Associated revisions

Revision 9920da55
Added by ngoto (Naohisa Goto) almost 7 years ago

  • 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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 38211
Added by ngoto (Naohisa Goto) almost 7 years ago

  • 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

Revision 38211
Added by ngoto (Naohisa Goto) almost 7 years ago

  • 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

Revision 38211
Added by ngoto (Naohisa Goto) almost 7 years ago

  • 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

Revision 38211
Added by ngoto (Naohisa Goto) almost 7 years ago

  • 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

Revision 38211
Added by ngoto (Naohisa Goto) almost 7 years ago

  • 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

Revision 38211
Added by ngoto (Naohisa Goto) almost 7 years ago

  • 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

Revision e85d6f8b
Added by usa (Usaku NAKAMURA) over 6 years ago

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 38502
Added by usa (Usaku NAKAMURA) over 6 years ago

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

History

#1

Updated by ngoto (Naohisa Goto) almost 7 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
#2

Updated by ngoto (Naohisa Goto) almost 7 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

#3

Updated by usa (Usaku NAKAMURA) over 6 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

Also available in: Atom PDF