Your message dated Fri, 03 Apr 2015 22:48:55 +0000
with message-id <e1yeaov-00026p...@franck.debian.org>
and subject line Bug#781504: fixed in ruby2.1 2.1.5-2
has caused the Debian Bug report #781504,
regarding Segmentation fault after pack & ioctl & unpack
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
781504: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781504
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: ruby2.1
Version: 2.1.5-1
Severity: grave
Tags: patch
Hi,
When testing OpenStack Fuel, one of the components is using rethtool, which
suffer from below ruby 2.1 upstream bug:
https://bugs.ruby-lang.org/issues/10568
The fix is attached in the above bug report, in this URL:
https://bugs.ruby-lang.org/attachments/download/4936/ruby-2.1-rb-str-associated.patch
I have also attached the patch.
I tested to rebuilding the Ruby 2.1 interpreter using this patch, and this
solved my issue.
It would be super nice if this patch could land in Jessie before the release.
This kind of crash IMO deserves such action. If you don't have time to patch
the current Ruby 2.1 interpreter and would accept an NMU, let me know, and
I will do so.
Cheers,
Thomas Goirand (zigo)
diff --git a/pack.c b/pack.c
index 71dd6af..6e515b2 100644
--- a/pack.c
+++ b/pack.c
@@ -234,6 +234,31 @@ static void qpencode(VALUE,VALUE,long);
static unsigned long utf8_to_uv(const char*,long*);
+static ID id_associated;
+
+static void
+str_associate(VALUE str, VALUE add)
+{
+ VALUE assoc;
+
+ assoc = rb_attr_get(str, id_associated);
+ if (RB_TYPE_P(assoc, T_ARRAY)) {
+ /* already associated */
+ rb_ary_concat(assoc, add);
+ }
+ else {
+ rb_ivar_set(str, id_associated, add);
+ }
+}
+
+static VALUE
+str_associated(VALUE str)
+{
+ VALUE assoc = rb_attr_get(str, id_associated);
+ if (NIL_P(assoc)) assoc = Qfalse;
+ return assoc;
+}
+
/*
* call-seq:
* arr.pack ( aTemplateString ) -> aBinaryString
@@ -921,7 +960,7 @@ pack_pack(VALUE ary, VALUE fmt)
}
if (associates) {
- rb_str_associate(res, associates);
+ str_associate(res, associates);
}
OBJ_INFECT(res, fmt);
switch (enc_info) {
@@ -1801,7 +1840,7 @@ pack_unpack(VALUE str, VALUE fmt)
VALUE a;
const VALUE *p, *pend;
- if (!(a = rb_str_associated(str))) {
+ if (!(a = str_associated(str))) {
rb_raise(rb_eArgError, "no associated pointer");
}
p = RARRAY_CONST_PTR(a);
@@ -1810,7 +1849,7 @@ pack_unpack(VALUE str, VALUE fmt)
if (RB_TYPE_P(*p, T_STRING) && RSTRING_PTR(*p) == t) {
if (len < RSTRING_LEN(*p)) {
tmp = rb_tainted_str_new(t, len);
- rb_str_associate(tmp, a);
+ str_associate(tmp, a);
}
else {
tmp = *p;
@@ -1844,7 +1883,7 @@ pack_unpack(VALUE str, VALUE fmt)
VALUE a;
const VALUE *p, *pend;
- if (!(a = rb_str_associated(str))) {
+ if (!(a = str_associated(str))) {
rb_raise(rb_eArgError, "no associated pointer");
}
p = RARRAY_CONST_PTR(a);
@@ -2006,4 +2045,6 @@ Init_pack(void)
{
rb_define_method(rb_cArray, "pack", pack_pack, 1);
rb_define_method(rb_cString, "unpack", pack_unpack, 1);
+
+ id_associated = rb_intern_const("__pack_associated__");
}
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb
index 3f0931b..38c1981 100644
--- a/test/ruby/test_pack.rb
+++ b/test/ruby/test_pack.rb
@@ -181,7 +181,7 @@ def test_pack_p
assert_equal a[0], a.pack("p").unpack("p")[0]
assert_equal a, a.pack("p").freeze.unpack("p*")
assert_raise(ArgumentError) { (a.pack("p") + "").unpack("p*") }
- assert_raise(ArgumentError) { (a.pack("p") << "d").unpack("p*") }
+ assert_equal a, (a.pack("p") << "d").unpack("p*")
end
def test_format_string_modified
--- End Message ---
--- Begin Message ---
Source: ruby2.1
Source-Version: 2.1.5-2
We believe that the bug you reported is fixed in the latest version of
ruby2.1, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 781...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Antonio Terceiro <terce...@debian.org> (supplier of updated ruby2.1 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Tue, 31 Mar 2015 21:50:39 -0300
Source: ruby2.1
Binary: ruby2.1 libruby2.1 ruby2.1-dev ruby2.1-doc ruby2.1-tcltk
Architecture: source all
Version: 2.1.5-2
Distribution: unstable
Urgency: medium
Maintainer: Antonio Terceiro <terce...@debian.org>
Changed-By: Antonio Terceiro <terce...@debian.org>
Description:
libruby2.1 - Libraries necessary to run Ruby 2.1
ruby2.1 - Interpreter of object-oriented scripting language Ruby
ruby2.1-dev - Header files for compiling extension modules for the Ruby 2.1
ruby2.1-doc - Documentation for Ruby 2.1
ruby2.1-tcltk - Ruby/Tk for Ruby 2.1
Closes: 781504
Changes:
ruby2.1 (2.1.5-2) unstable; urgency=medium
.
* Fix Segmentation fault after pack & ioctl & unpack (Closes: #781504)
- apply r44804 from upstream svn
* debian/upstream-changes: simpler and more accurate implementation
Checksums-Sha1:
12661f3347c56c76b426261980aef8057851a27e 2406 ruby2.1_2.1.5-2.dsc
07c03c615b5a368c84a831f90311791c06e00c0d 85460 ruby2.1_2.1.5-2.debian.tar.xz
c87da5e83b146420e14d384ac6b45acb71599a40 3367870 ruby2.1-doc_2.1.5-2_all.deb
Checksums-Sha256:
78c11261a2aaa9ee70c591137bc09a9db51adf347699dce235a289c4238aec22 2406
ruby2.1_2.1.5-2.dsc
6c594fab8361c479f46b265aa114a7e829b2f80c3a423ac58952143b5283b9fe 85460
ruby2.1_2.1.5-2.debian.tar.xz
fb37d116a9e0effc873bc7ba5e96ac3208d9e412e5ff7d9453e5302736e1f4fc 3367870
ruby2.1-doc_2.1.5-2_all.deb
Files:
ff5deb2fb3b658f39b577f8ec104e2ba 2406 ruby extra ruby2.1_2.1.5-2.dsc
a0a6631dd1dcae59bd28ee276d3089fc 85460 ruby extra ruby2.1_2.1.5-2.debian.tar.xz
221a04c04ffedae7292f77467f46ce52 3367870 doc extra ruby2.1-doc_2.1.5-2_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCAAGBQJVHxZBAAoJEPwNsbvNRgve0n8QAPKmn91HifjwbHpuLYHDcf5z
za78OC4vRDATPqai8yHPuDtF6kVkiDldcSPgvHcTkg8sWqyXQbCWOPJEm/HeBs6s
am6u/KG6Qv/A0ubIhJp7d21mSs80A4v2fa5F0TSORKAHjv2T96W85g6g5/n3YtQ4
9hCk55XblRgnMlSiixMeCktPOQwuEmzUOr7DXMXlU9MMw4uDkhv1v041DwvoQETO
W9+I5WeoWuN0e7LedQKyZyzB3G5LjimeMD5W+Ls/yVrzMnG5tiiZK7H0bMTgdYWY
rBwaQpCIYrkkKqn7mrbEpNfDkA4pahM2aD9kYXjl3TvG4nntUuBYKwtS8kdE3p4s
3yIIX73JvkMUQuolMgR3xzEe+de6RbG07aX5NiFcQsfByuW1WnFV1xqNCKPPPdYO
wcIg9cdzsm/7yMkk/AkZTbtTw3HaN5OrBfEr7dVQ1kyrLYHyCVwbzrUCrhHDanKE
7gWv2xsJgM7hleiLtirP2p6DWPpqzNwN6BwAtWxrfG21L3XnvHoAoVd1ifepsvgx
z972ZLixWtCU/wLChnizSOWTuZ7pcl6aieqmf42PBRQ1CNLg+tg4d5IaYAWIs9Ev
APWp75N0RiJ8mCXAKEvRuKJMjVetqcvCBlTS+G8/26Adl46Rw5cMiFxOrcSPpfCs
wsmnXHn8vygdNhmZoBXQ
=ShOo
-----END PGP SIGNATURE-----
--- End Message ---