ruby segfaults on class clone

Bug #484756 reported by takahiro watanabe on 2009-11-18
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ruby
Fix Released
Undecided
Unassigned
ruby1.8 (Debian)
Fix Released
Unknown
ruby1.8 (Ubuntu)
High
Unassigned
Karmic
Undecided
Unassigned

Bug Description

Binary package hint: ruby1.8

The bug explained in the blow URL still exist.
Please fix.

http://www.hinet.mydns.jp/tdiary/?date=20090506
(Contents are written in JAPANESE)

Below is the result when I execute the test code in the URL.

takahiro% ruby -ve "C=0; o=''; o.instance_eval('def m; C; end'); o.clone.m"
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
(eval):1: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]

Aborted

MattColyer (matt-colyer) wrote :

I can verify that this bug exists in my installation as well.

Bryan McLellan (btm) on 2009-11-25
summary: - ruby in ubuntu segfaults when running a certain code.
+ ruby garbage collector segfaults under certain conditions
Changed in ruby1.8 (Ubuntu):
importance: Undecided → High
status: New → Triaged

Upstream bug: http://redmine.ruby-lang.org/issues/show/2326

Upstream contains another test and a possible fix. I can reproduce both the upstream condition and the one in this bug, as well as a third [1] on 9.10 (karmic) with ruby1.8=1.8.7.174-1

[1] http://tickets.opscode.com/browse/CHEF-530

Changed in ruby:
status: New → In Progress
Lucas Nussbaum (lucas) wrote :

 Bryan, could you please check if the more recent version in Debian is also affected?

Bryan McLellan (btm) wrote :

tested on ec2:

on lenny / ruby1.8=1.8.7.72-3lenny1 - the above test segfaults, but the Time test upstream works
on squeeze / ruby1.8=1.8.7.174-2 - the above test passes, but the Time test upstream segfaults

domU-12-31-39-04-26-23:~# ruby -e 't1 = t2 = Time.now ; while t1.sec == t2.sec do t2 = Time.now end'
-e:1: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]

Aborted
domU-12-31-39-04-26-23:~# apt-cache policy ruby1.8 | grep Installed
  Installed: 1.8.7.174-2
domU-12-31-39-04-26-23:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux testing (squeeze)
Release: testing
Codename: squeeze

Bryan McLellan (btm) wrote :
Changed in ruby:
status: In Progress → Fix Released
Bryan McLellan (btm) wrote :

The bug reported by OP is fixed in debian in 090812_class_clone_segv.dpatch in =1.8.7.174-2

I can't find an Ruby bug report for it, but I did link the debian bug report. The other issue appears unrelated, and is now filed as LP #488115.

Bryan McLellan (btm) on 2009-11-25
summary: - ruby garbage collector segfaults under certain conditions
+ ruby segfaults on class clone
Martin Pitt (pitti) wrote :

This is reportedly fixed in lucid in 1.8.7.174-2.

Changed in ruby1.8 (Ubuntu):
status: Triaged → Fix Released

Accepted ruby1.8 into karmic-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in ruby1.8 (Ubuntu Karmic):
status: New → Fix Committed
tags: added: verification-needed
Bryan McLellan (btm) wrote :

Installed ruby1.8 and libruby1.8 version 1.8.7.174-1ubuntu1 from karmic-proposed.

Ran both tests successfully with experiencing a segfault, confirming package in -proposed fixes this bug.

$ ruby -e 't1 = t2 = Time.now ; while t1.sec == t2.sec do t2 = Time.now end'
$ ruby -ve "C=0; o=''; o.instance_eval('def m; C; end'); o.clone.m"
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
$

Bryan McLellan (btm) wrote :

My mistake.

*without* a segfault.

Works as expected.

Martin Pitt (pitti) on 2009-12-08
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ruby1.8 - 1.8.7.174-1ubuntu1

---------------
ruby1.8 (1.8.7.174-1ubuntu1) karmic-proposed; urgency=medium

  * Added debian/patches/091125_gc_check.dpatch: Avoid segv on gc run whe
    heap fills up with deferred objects. (LP: #488115)
  * Added debian/patches/090812_class_clone_segv.dpatch: avoid segv when an
    object cloned. (LP: #484756)
 -- Bryan McLellan <email address hidden> Tue, 01 Dec 2009 03:33:13 -0800

Changed in ruby1.8 (Ubuntu Karmic):
status: Fix Committed → Fix Released
Changed in ruby1.8 (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.