Project

General

Profile

Actions

Backport #3896

closed

Bus error in ObjectSpace.count_objects_size

Added by eitoball (Eito Katagiri) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
[ruby-core:32667]

Description

=begin
Hello,

ObjectSpace.count_objects_size causes a bus error in ruby-1.9.2.

ruby -robjspace -ve "ObjectSpace.count_objects_size"
ruby 1.9.2p7 (2010-09-29 revision 29373) [i386-darwin9.8.0]
-e:1: [BUG] Bus Error

The following patch should solve this issue.

diff --git a/gc.c b/gc.c
index 25fcc3d..564d260 100644
--- a/gc.c
+++ b/gc.c
@@ -1145,7 +1145,7 @@ rb_data_typed_object_alloc(VALUE klass, void *datap, const
size_t
rb_objspace_data_type_memsize(VALUE obj)
{

  • if (RTYPEDDATA_P(obj)) {
  • if (RTYPEDDATA_P(obj) && RTYPEDDATA_TYPE(obj)->dsize) {
    return RTYPEDDATA_TYPE(obj)->dsize(RTYPEDDATA_DATA(obj));
    }
    else {

The trunk version does not have this issue because it checks the existence of dsize function pointer.
=end


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #3693: visibility hidden functionsClosed08/14/2010Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to yugui (Yuki Sonoda)

=begin
It's a part of r28986.
=end

Actions #2

Updated by yugui (Yuki Sonoda) over 13 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r29570.
Eito, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0