[#12372] Release compatibility/train — Prashant Srinivasan <Prashant.Srinivasan@...>

Hello all,

28 messages 2007/10/03
[#12373] Re: Release compatibility/train — Yukihiro Matsumoto <matz@...> 2007/10/03

Hi,

[#12374] Re: Release compatibility/train — David Flanagan <david@...> 2007/10/03

Yukihiro Matsumoto wrote:

[#12376] Re: Release compatibility/train — Prashant Srinivasan <Prashant.Srinivasan@...> 2007/10/03

[#12377] Re: Release compatibility/train — Yukihiro Matsumoto <matz@...> 2007/10/03

Hi,

[#12382] Re: Release compatibility/train — Charles Oliver Nutter <charles.nutter@...> 2007/10/03

Yukihiro Matsumoto wrote:

[#12385] Re: Release compatibility/train — Yukihiro Matsumoto <matz@...> 2007/10/03

Hi,

[#12388] Re: Release compatibility/train — Charles Oliver Nutter <charles.nutter@...> 2007/10/03

Yukihiro Matsumoto wrote:

[#12389] Re: Release compatibility/train — Yukihiro Matsumoto <matz@...> 2007/10/03

Hi,

[#12406] Re: Release compatibility/train — "David A. Black" <dblack@...> 2007/10/03

Hi --

[#12383] Include Rake in Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

20 messages 2007/10/03

[#12539] Ordered Hashes in 1.9? — Michael Neumann <mneumann@...>

Hi all,

17 messages 2007/10/08
[#12542] Re: Ordered Hashes in 1.9? — Yukihiro Matsumoto <matz@...> 2007/10/08

Hi,

[#12681] Unicode: Progress? — murphy <murphy@...>

Hello!

17 messages 2007/10/15

[#12693] retry: revised 1.9 http patch — Hugh Sasse <hgs@...>

I'm reposting this because I've had little response to this version

11 messages 2007/10/15

[#12697] Range.first is incompatible with Enumerable.first — David Flanagan <david@...>

The new Enumerable.first method is a generalization of Array.first to

11 messages 2007/10/16

[#12754] Improving 'syntax error, unexpected $end, expecting kEND'? — Hugh Sasse <hgs@...>

I've had a look at this, but can't see how to do it: When I get

17 messages 2007/10/18
[#12886] Re: Improving 'syntax error, unexpected $end, expecting kEND'? — David Flanagan <david@...> 2007/10/23

The patch below changes this message to:

[#12758] Encoding::primary_encoding — David Flanagan <david@...>

Hi,

25 messages 2007/10/18
[#12763] Re: Encoding::primary_encoding — Nobuyoshi Nakada <nobu@...> 2007/10/19

Hi,

[#12802] Re: Encoding::primary_encoding — Wolfgang N疆asi-Donner <ed.odanow@...> 2007/10/21

Nobuyoshi Nakada schrieb:

[#12803] Re: Encoding::primary_encoding — Nobuyoshi Nakada <nobu@...> 2007/10/21

Hi,

[#12804] Re: Encoding::primary_encoding — Wolfgang N疆asi-Donner <ed.odanow@...> 2007/10/21

Nobuyoshi Nakada schrieb:

[#12808] Re: Encoding::primary_encoding — Nobuyoshi Nakada <nobu@...> 2007/10/22

Hi,

[#12818] Re: Encoding::primary_encoding — Wolfgang N疆asi-Donner <ed.odanow@...> 2007/10/22

Nobuyoshi Nakada schrieb:

[#12820] Re: Encoding::primary_encoding — "Michal Suchanek" <hramrach@...> 2007/10/22

T24gMjIvMTAvMjAwNywgV29sZmdhbmcgTsOhZGFzaS1Eb25uZXIgPGVkLm9kYW5vd0B3b25hZG8u

[#12823] Re: Encoding::primary_encoding — Wolfgang Nádasi-Donner <ed.odanow@...> 2007/10/22

Michal Suchanek schrieb:

[#12824] Re: Encoding::primary_encoding — Nobuyoshi Nakada <nobu@...> 2007/10/22

Hi,

[#12767] \u escapes in string literals: proof of concept implementation — David Flanagan <david@...>

Back at the end of August, Matz wrote (see

45 messages 2007/10/19
[#12769] Re: \u escapes in string literals: proof of concept implementation — "Nobuyoshi Nakada" <nobu@...> 2007/10/19

Hi,

[#12782] Re: \u escapes in string literals: proof of concept implementation — David Flanagan <david@...> 2007/10/20

Nobuyoshi Nakada wrote:

[#12831] Re: \u escapes in string literals: proof of concept implementation — Yukihiro Matsumoto <matz@...> 2007/10/22

Hi,

[#12841] Re: \u escapes in string literals: proof of concept implementation — David Flanagan <david@...> 2007/10/22

Yukihiro Matsumoto wrote:

[#12862] Re: \u escapes in string literals: proof of concept implementation — Martin Duerst <duerst@...> 2007/10/23

At 04:19 07/10/23, David Flanagan wrote:

[#12864] Re: \u escapes in string literals: proof of concept implementation — David Flanagan <david@...> 2007/10/23

Martin Duerst wrote:

[#12870] Re: \u escapes in string literals: proof of concept implementation — Martin Duerst <duerst@...> 2007/10/23

At 13:10 07/10/23, David Flanagan wrote:

[#12872] Re: \u escapes in string literals: proof of concept implementation — David Flanagan <david@...> 2007/10/23

Martin Duerst wrote:

[#12936] Re: \u escapes in string literals: proof of concept implementation — Yukihiro Matsumoto <matz@...> 2007/10/25

Hi,

[#12980] Re: \u escapes in string literals: proof of concept implementation — David Flanagan <david@...> 2007/10/26

Yukihiro Matsumoto wrote:

[#13028] Re: \u escapes in string literals: proof of concept implementation — Nobuyoshi Nakada <nobu@...> 2007/10/29

Hi,

[#13032] Re: \u escapes in string literals: proof of concept implementation — David Flanagan <david@...> 2007/10/29

Nobuyoshi Nakada wrote:

[#13034] Re: \u escapes in string literals: proof of concept implementation — Nobuyoshi Nakada <nobu@...> 2007/10/29

Hi,

[#13082] Re: \u escapes in string literals: proof of concept implementation — Martin Duerst <duerst@...> 2007/10/30

At 16:46 07/10/29, Nobuyoshi Nakada wrote:

[#13231] Re: \u escapes in string literals: proof of concept implementation — Nobuyoshi Nakada <nobu@...> 2007/11/06

Hi,

[#13234] Re: \u escapes in string literals: proof of concept implementation — Martin Duerst <duerst@...> 2007/11/06

At 11:29 07/11/06, Nobuyoshi Nakada wrote:

[#12825] clarification of ruby libraries installation paths? — Lucas Nussbaum <lucas@...>

Hi,

53 messages 2007/10/22
[#12830] Re: clarification of ruby libraries installation paths? — Ben Bleything <ben@...> 2007/10/22

On Mon, Oct 22, 2007, Lucas Nussbaum wrote:

[#12833] Re: clarification of ruby libraries installation paths? — Lucas Nussbaum <lucas@...> 2007/10/22

On 23/10/07 at 00:13 +0900, Ben Bleything wrote:

[#12835] Re: clarification of ruby libraries installation paths? — "Austin Ziegler" <halostatue@...> 2007/10/22

On 10/22/07, Lucas Nussbaum <lucas@lucas-nussbaum.net> wrote:

[#12836] Re: clarification of ruby libraries installation paths? — Lucas Nussbaum <lucas@...> 2007/10/22

On 23/10/07 at 01:55 +0900, Austin Ziegler wrote:

[#12888] Re: clarification of ruby libraries installation paths? — Gonzalo Garramu <ggarra@...> 2007/10/23

Lucas Nussbaum wrote:

[#12894] Re: clarification of ruby libraries installation paths? — Lucas Nussbaum <lucas@...> 2007/10/24

On 24/10/07 at 05:14 +0900, Gonzalo Garramu wrote:

[#13057] Re: clarification of ruby libraries installation paths? — Gonzalo Garramu <ggarra@...> 2007/10/29

Lucas Nussbaum wrote:

[#13058] Re: clarification of ruby libraries installation paths? — Lucas Nussbaum <lucas@...> 2007/10/29

On 30/10/07 at 07:28 +0900, Gonzalo Garramu wrote:

[#12848] Re: clarification of ruby libraries installation paths? — Sam Roberts <sroberts@...> 2007/10/22

On Tue, Oct 23, 2007 at 01:55:29AM +0900, Austin Ziegler wrote:

[#12855] Re: clarification of ruby libraries installation paths? — "Austin Ziegler" <halostatue@...> 2007/10/23

On 10/22/07, Sam Roberts <sroberts@uniserve.com> wrote:

[#13016] Re: clarification of ruby libraries installation paths? — bob@... (Bob Proulx) 2007/10/28

Austin Ziegler wrote:

[#13029] Re: clarification of ruby libraries installation paths? — "Austin Ziegler" <halostatue@...> 2007/10/29

On 10/28/07, Bob Proulx <bob@proulx.com> wrote:

[#13054] Austin Ziegler's behaviour (Was: clarification of ruby libraries installation paths?) — Lucas Nussbaum <lucas@...> 2007/10/29

Austin,

[#13055] Re: Austin Ziegler's behaviour (Was: clarification of ruby libraries installation paths?) — "Luis Lavena" <luislavena@...> 2007/10/29

On 10/29/07, Lucas Nussbaum <lucas@lucas-nussbaum.net> wrote:

[#13064] Re: Austin Ziegler's behaviour (Was: clarification of ruby libraries installation paths?) — "Austin Ziegler" <halostatue@...> 2007/10/30

On 10/29/07, Luis Lavena <luislavena@gmail.com> wrote:

[#13066] Re: Austin Ziegler's behaviour (Was: clarification of ruby libraries installation paths?) — "Luis Lavena" <luislavena@...> 2007/10/30

On 10/30/07, Austin Ziegler <halostatue@gmail.com> wrote:

[#13094] Re: Austin Ziegler's behaviour (Was: clarification of ruby libraries installation paths?) — "Rick Bradley" <rick@...> 2007/10/30

Do we think that maybe, just maybe, things went off the rails when the

[#13095] Re: Austin Ziegler's behaviour (Was: clarification of ruby libraries installation paths?) — "Luis Lavena" <luislavena@...> 2007/10/30

On 10/30/07, Rick Bradley <rick@rickbradley.com> wrote:

[#12900] Hopefully Complete List of Possible Encoding Specifications - Existing Ones — Wolfgang Nádasi-Donner <ed.odanow@...>

Dear Ruby 1.9 architects, developers, and testers!

31 messages 2007/10/24
[#12905] Re: Hopefully Complete List of Possible Encoding Specifications - Existing Ones — Yukihiro Matsumoto <matz@...> 2007/10/24

Hi,

[#12907] Re: Hopefully Complete List of Possible Encoding Specifications - Existing Ones — Wolfgang Nádasi-Donner <ed.odanow@...> 2007/10/24

Yukihiro Matsumoto schrieb:

[#12909] Re: Hopefully Complete List of Possible Encoding Specifications - Existing Ones — Yukihiro Matsumoto <matz@...> 2007/10/24

Hi,

[#12940] Re: Hopefully Complete List of Possible Encoding Specifications - Existing Ones — Wolfgang Nádasi-Donner <ed.odanow@...> 2007/10/25
[#12942] Re: Hopefully Complete List of Possible Encoding Specifications - Existing Ones — Wolfgang Nádasi-Donner <ed.odanow@...> 2007/10/25

I have a (hopefully) final question before testing all

[#12948] Re: Hopefully Complete List of Possible Encoding Specifications - Existing Ones — Nobuyoshi Nakada <nobu@...> 2007/10/26

Hi,

[#12951] Fluent programming in Ruby — David Flanagan <david@...>

From the ChangeLog:

16 messages 2007/10/26

[#12996] General hash keys for colon notation — murphy <murphy@...>

Dear language designer(s) and parser wizards,

16 messages 2007/10/28

[#13027] Implementation of "guessUTF" method - final questions — Wolfgang Nádasi-Donner <ed.odanow@...>

Dear Ruby designers, developers, and testers!

22 messages 2007/10/29

[#13069] new Enumerable.butfirst method — David Flanagan <david@...>

Matz,

17 messages 2007/10/30

Ruby 1.9.0 Segmentation fault on thread creation

From: Brent Roman <brent@...>
Date: 2007-10-24 23:44:28 UTC
List: ruby-core #12912
More information on this multithreaded crash:

My application is starting up a six or seven service
threads.  Each thread simulates a piece of robotic
hardware for simulation runs.  Ruby fails sometimes
after starting just one thread, but on the next run it may start
five before crashing.  It always fails just as a thread is first
started.  It never has managed to start all threads without
segfaulting.

The failures occur in one of three places in vm.c
The failure site is random among the three run-to-run.

I have not been able to produce a simple test case,
but I now have a lot more information:

Here's 'C' backtrace from gdb for crash site #1:

(gdb) backtrace
#0  0x080f095d in lfp_set_special_cref (lfp=0xb7d52138, cref=0x0) at
vm.c:822
#1  0x080f03b8 in vm_invoke_proc (th=0x8452208, proc=0x84521a8,
self=3083694740, argc=2, argv=0x84521f8) at vm.c:616
#2  0x080fa271 in thread_start_func_2 (th=0x8452208,
stack_start=0xb768e3c0) at thread.c:317
#3  0x080f980e in thread_start_func_1 (th_ptr=0x8452208) at
thread_pthread.ci:163
#4  0xb7f594bb in start_thread () from /lib/libpthread.so.0
#5  0xb7e914de in clone () from /lib/libc.so.6

BTW-  Native OS thread make debugging in gdb much more straightforward.
      Yea!


Where The SegFault occurs in vm.c here:

static NODE *
lfp_set_special_cref(VALUE *lfp, NODE * cref)
{
    struct RValues *values = (void *) lfp[-1];
///// values = 1 (i.e. FIXNUM(0)) by the line above ////
    NODE *old_cref;

    if (VMDEBUG) {
        check_svar();
    }

///// "values" dereference causes segfault in line below /////
   if (cref == 0 && ((VALUE)values == Qnil || values->basic.klass == 0)) {
        old_cref = 0;
    }
    else {
        old_cref = (NODE *)lfp_svar_get(GET_THREAD(), lfp, 2);
        lfp_svar_set(GET_THREAD(), lfp, 2, (VALUE)cref);
    }
    return old_cref;
}

values is loaded with Ruby FixNum(0) at lfp[-1].
The test values==Qnil is not sufficient to ensure that
it can be dereferenced.


Here's 'C' backtrace from gdb for crash site #2:

static NODE *
lfp_get_special_cref(VALUE *lfp)
{
    struct RValues *values;
//attempt to dereference values==1 on next line
    if (((VALUE)(values = (void *)lfp[-1])) != Qnil &&
values->basic.klass) {
        return (NODE *)values->basic.klass;
    }
    else {
        return 0;
    }
}


Here is the corresponding backtrace for this case:

#0  0x080eda28 in lfp_get_special_cref (lfp=0xb7ccc138) at insnhelper.ci:830
#1  0x080edc50 in get_cref (iseq=0x831cea8, lfp=0xb7ccc138) at
insnhelper.ci:924
#2  0x080f5fab in vm_get_cvar_base (th=0x844f5a0, iseq=0x831cea8) at
insnhelper.ci:1047
#3  0x080f1430 in vm_eval (th=0x844f5a0, initial=0) at insns.def:189
#4  0x080f6e72 in vm_eval_body (th=0x844f5a0) at vm.c:1163
#5  0x080f0058 in invoke_block (th=0x844f5a0, block=0x844f540,
self=3083151940, argc=0, argv=0x844f590) at vm.c:583
#6  0x080f01da in vm_invoke_proc (th=0x844f5a0, proc=0x844f540,
self=3083151940, argc=2, argv=0x844f590) at vm.c:622
#7  0x080f9f99 in thread_start_func_2 (th=0x844f5a0,
stack_start=0xb7a103c0) at thread.c:316
#8  0x080f9552 in thread_start_func_1 (th_ptr=0x844f5a0) at
thread_pthread.ci:163
#9  0xb7ed34bb in start_thread () from /lib/libpthread.so.0
#10 0xb7e0b4de in clone () from /lib/libc.so.6


Here's 'C' backtrace from gdb for crash site #3:

static VALUE
rb_const_get_0(VALUE klass, ID id, int exclude, int recurse)
{
    VALUE value, tmp;
    int mod_retry = 0;

    tmp = klass;
  retry:
    while (tmp && !NIL_P(tmp)) {
/// segfault in this next "while" expression
        while (RCLASS_IV_TBL(tmp) &&
st_lookup(RCLASS_IV_TBL(tmp),id,&value)) {
            if (value == Qundef) {
                if (!RTEST(rb_autoload_load(tmp, id))) break;
                continue;
            }
            if (exclude && tmp == rb_cObject && klass != rb_cObject) {
                rb_warn("toplevel constant %s referenced by %s::%s",
                        rb_id2name(id), rb_class2name(klass),
rb_id2name(id));
            }
            return value;
        }
        if (!recurse && klass != rb_cObject) break;
....

And, here is the backtrace corresponding to that final failure site:

#0  0x080e8262 in rb_const_get_0 (klass=138068320, id=8317, exclude=0,
recurse=2) at variable.c:1421
#1  0x080e8352 in rb_const_get (klass=138068320, id=8317) at variable.c:1453
#2  0x080f64a2 in vm_get_ev_const (th=0x844e748, iseq=0x831ad18,
klass=138068320, id=8317, is_defined=0) at insnhelper.ci:1023
#3  0x080f1554 in vm_eval (th=0x844e748, initial=0) at insns.def:225
#4  0x080f6e72 in vm_eval_body (th=0x844e748) at vm.c:1163
#5  0x080f0058 in invoke_block (th=0x844e748, block=0x844e6e8,
self=3083964760, argc=0, argv=0x844e738) at vm.c:583
#6  0x080f01da in vm_invoke_proc (th=0x844e748, proc=0x844e6e8,
self=3083964760, argc=2, argv=0x844e738) at vm.c:622
#7  0x080f9f99 in thread_start_func_2 (th=0x844e748,
stack_start=0xb7bd83c0) at thread.c:316
#8  0x080f9552 in thread_start_func_1 (th_ptr=0x844e748) at
thread_pthread.ci:163
#9  0xb7f994bb in start_thread () from /lib/libpthread.so.0
#10 0xb7ed14de in clone () from /lib/libc.so.6


Given these hints, what might I try next to isolate the bug?

By the way:
This application adds methods and instance variables
to the base Thread class and subclasses
Thread to create its own ScheduleThread class for
simulation of real-time hardware in simulated time.

This works fine in Ruby 1.6.8 and seems OK in 1.8.6
Is it a bad idea in Ruby 1.9?



In This Thread

Prev Next