[DRE-commits] [SCM] ruby-spoon.git branch, master, updated. upstream/0.0.2_git20130104-12-g341aab5
Cédric Boutillier
boutil at debian.org
Mon Jan 7 16:37:54 UTC 2013
The following commit has been merged in the master branch:
commit 341aab58113209a91afa87e0cd1f31d9cf13eb0d
Author: Cédric Boutillier <boutil at debian.org>
Date: Mon Jan 7 17:21:02 2013 +0100
add patches from https://github.com/libc/spoon/
diff --git a/debian/changelog b/debian/changelog
index c2cc204..1cc3a8b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,5 +7,10 @@ ruby-spoon (0.0.2~git20130104-1) unstable; urgency=low
[ Cédric Boutillier ]
* debian/ruby-spoon.lintian-overrides: override lintian message about
missing upstream changelog.
+ * debian/patches:
+ + increase_size_spawnattributes.patch: increase the size of
+ SpawnAttributes pointers to avoid segfault on 64bit architectures
+ + pass_release_method.patch: circumvent the fact that AutoPointers from
+ the FFI gem do not support classes.
- -- Hideki Yamane <henrich at debian.org> Fri, 04 Jan 2013 11:37:03 +0900
+ -- Cédric Boutillier <boutil at debian.org> Mon, 07 Jan 2013 17:20:10 +0100
diff --git a/debian/patches/increase_size_spawnattributes.patch b/debian/patches/increase_size_spawnattributes.patch
new file mode 100644
index 0000000..231f86e
--- /dev/null
+++ b/debian/patches/increase_size_spawnattributes.patch
@@ -0,0 +1,27 @@
+Description: SpawnAttributes is 336 bytes on 64bit linux
+ Allocation 128 bytes causes memory corruption on 64 bit linux. Because
+ the structure underneath is bigger. Increase the size.
+Author: Eugene Pimenov <eugene at libc.st>
+Origin: https://github.com/libc/spoon/commit/9eceb369adf086ad407bd562f74fb43a4e1c2c02
+Reviewed-by: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2012-12-26
+---
+ lib/spoon/unix.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/spoon/unix.rb b/lib/spoon/unix.rb
+index 8e9d09b..080f653 100644
+--- a/lib/spoon/unix.rb
++++ b/lib/spoon/unix.rb
+@@ -39,7 +39,7 @@ def dup2(fd, newfd)
+
+ class SpawnAttributes
+ attr_reader :pointer
+- SIZE = FFI::Platform.mac? ? FFI.type_size(:pointer) : 128
++ SIZE = FFI::Platform.mac? ? FFI.type_size(:pointer) : 336
+
+ def initialize
+ @pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), self.class)
+--
+1.7.10
+
diff --git a/debian/patches/pass_release_method.patch b/debian/patches/pass_release_method.patch
new file mode 100644
index 0000000..b419e03
--- /dev/null
+++ b/debian/patches/pass_release_method.patch
@@ -0,0 +1,36 @@
+Description: AutoPointer does not support classes in ffi gem
+ FFI gem (for MRI) does not support passing classes for deallocator. Use
+ pass unbound method, since it's supported by both rubies.
+Origin: https://github.com/libc/spoon/commit/4454035a6db686ee4ca364d68a4fdc756168a1f9
+Author: Eugene Pimenov <eugene at libc.st>
+Reviewed-by: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2012-12-26
+---
+ lib/spoon/unix.rb | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/spoon/unix.rb b/lib/spoon/unix.rb
+index 080f653..9746d0d 100644
+--- a/lib/spoon/unix.rb
++++ b/lib/spoon/unix.rb
+@@ -8,7 +8,7 @@ class FileActions
+ SIZE = FFI::Platform.mac? ? FFI.type_size(:pointer) : 128
+
+ def initialize
+- @pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), self.class)
++ @pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), self.class.method(:release))
+ error = LibC.posix_spawn_file_actions_init(@pointer)
+ raise SystemCallError.new("posix_file_actions_init", error) unless error == 0
+ end
+@@ -42,7 +42,7 @@ class SpawnAttributes
+ SIZE = FFI::Platform.mac? ? FFI.type_size(:pointer) : 336
+
+ def initialize
+- @pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), self.class)
++ @pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), self.class.method(:release))
+ error = LibC.posix_spawnattr_init(@pointer)
+ raise SystemCallError.new("posix_spawnattr_init", error) unless error == 0
+ end
+--
+1.7.10
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0b01cf7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+increase_size_spawnattributes.patch
+pass_release_method.patch
diff --git a/debian/source/local-options b/debian/source/local-options
new file mode 100644
index 0000000..4aceb10
--- /dev/null
+++ b/debian/source/local-options
@@ -0,0 +1 @@
+unapply-patches
--
ruby-spoon.git
More information about the Pkg-ruby-extras-commits
mailing list