Permalink
Browse files

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.
  • Loading branch information...
1 parent 6381689 commit 9eceb369adf086ad407bd562f74fb43a4e1c2c02 @libc committed Dec 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/spoon/unix.rb
View
2 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)

0 comments on commit 9eceb36

Please sign in to comment.