Project

General

Profile

Actions

Bug #4411

closed

Context saving issue on PPC64

Added by a3li (Alex Legler) almost 12 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
-
[ruby-core:35318]

Description

=begin
Hi,

please see this bug report with a stacktrace and gdb info: https://bugzilla.redhat.com/show_bug.cgi?id=628715
It also includes a proposed patch which I'd like to have considered for inclusion. The issue is still there in p334.

Thanks!
=end


Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #3796: make check fails on powerpc64 linuxClosedshyouhei (Shyouhei Urabe)09/07/2010Actions
Actions #1

Updated by naruse (Yui NARUSE) almost 12 years ago

  • Priority changed from Normal to 3

=begin
We can't see brewweb.devel.redhat.com.
=end

Actions #2

Updated by a3li (Alex Legler) almost 12 years ago

=begin
I cannot access it either, it seems to be redhat-internal.

In case you were looking for the patch, it is here: https://bugzilla.redhat.com/attachment.cgi?id=445801
=end

Updated by nobu (Nobuyoshi Nakada) almost 12 years ago

  • ruby -v changed from ruby 1.8.7 (2010-06-23 patchlevel 299) [powerpc64-linux] to -

=begin
Hi,

At Tue, 22 Feb 2011 15:33:59 +0900,
Alex Legler wrote in [ruby-core:35333]:

In case you were looking for the patch, it is here: https://bugzilla.redhat.com/attachment.cgi?id=445801

It's gccish code.

  • (((j)->status)?:(just_before_setjmp)), \
    

--
Nobu Nakada
=end

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

=begin
Hi,

At Tue, 22 Feb 2011 15:33:59 +0900,
Alex Legler wrote in [ruby-core:35333]:

In case you were looking for the patch, it is here: https://bugzilla.redhat.com/attachment.cgi?id=445801

It's gccish code.

  • (((j)->status)?:(just_before_setjmp)), \
    

--
Nobu Nakada
=end

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

=begin
Hi,

At Tue, 22 Feb 2011 15:33:59 +0900,
Alex Legler wrote in [ruby-core:35333]:

In case you were looking for the patch, it is here: https://bugzilla.redhat.com/attachment.cgi?id=445801

It's gccish code.

  • (((j)->status)?:(just_before_setjmp)), \
    

--
Nobu Nakada
=end

Updated by Anonymous over 11 years ago

It's gccish code.

  • (((j)->status)?:(just_before_setjmp)), \
    

GCCish or not it's been few months with no reaction here. Vanilla ruby is therefore unusable on PPC64. Can you provide better patch or at least a suggestion how we should fix it "in a better way"?
Cheers,
Kacper Kowalik

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

=begin
Hi,

: At Tue, 17 May 2011 03:50:32 +0900,
: Kacper Kowalik wrote in [ruby-core:36232]:
GCCish or not it's been few months with no reaction
here. Vanilla ruby is therefore unusable on PPC64. Can you
provide better patch or at least a suggestion how we should
fix it "in a better way"?

Does this work?


diff --git a/eval.c b/eval.c
index a54fdce..e25ee24 100644
--- a/eval.c
+++ b/eval.c
@@ -188,6 +188,9 @@ int function_call_may_return_twice_false_2 = 0;
(function_call_may_return_twice_false_2 ?
setjmp(function_call_may_return_twice_jmp_buf) :
0)
+# elif defined(__ia64)
+# define JUST_BEFORE_SETJMP(extra_save, j) ((void)0)
+# define JUST_AFTER_SETJMP(extra_save, j) ((j)->status ? (void)0 : (extra_save))

elif defined(FreeBSD) && FreeBSD < 7

/*

  • workaround for FreeBSD/i386 getcontext/setcontext bug.
    @@ -205,16 +208,23 @@ static int volatile freebsd_clear_carry_flag = 0;

ifndef POST_GETCONTEXT

define POST_GETCONTEXT 0

endif

+# ifndef JUST_BEFORE_SETJMP
+# define JUST_BEFORE_SETJMP(extra_save, j) (extra_save)
+# endif
+# ifndef JUST_AFTER_SETJMP
+# define JUST_AFTER_SETJMP(extra_save, j) ((void)0)
+# endif

define ruby_longjmp(env, val) rb_jump_context(env, val)

-# define ruby_setjmp(just_before_setjmp, j) ((j)->status = 0, \

  • (just_before_setjmp), \
    

+# define ruby_setjmp(extra_save, j) ((j)->status = 0, \

  • JUST_BEFORE_SETJMP(extra_save, j), \
    PRE_GETCONTEXT, \
    getcontext(&(j)->context), \
    POST_GETCONTEXT, \
    
  • JUST_AFTER_SETJMP(extra_save, j), \
    (j)->status)
    

#else
-# define ruby_setjmp(just_before_setjmp, env) \

  • ((just_before_setjmp), RUBY_SETJMP(env))
    

+# define ruby_setjmp(extra_save, env) \

  • ((extra_save), RUBY_SETJMP(env))
    

define ruby_longjmp(env,val) RUBY_LONGJMP(env,val)

ifdef CYGWIN

ifndef _setjmp

--- Nobu Nakada
=end

Updated by Anonymous over 11 years ago

Nobuyoshi Nakada wrote:

Does this work?
Yes, thank you! But of course you need s/__ia64/PPC64/ following line:

+# elif defined(__ia64)
+# define JUST_BEFORE_SETJMP(extra_save, j) ((void)0)
Cheers,
Kacper Kowalik

Actions #9

Updated by Anonymous over 11 years ago

Could this patch be applied to 1.8 branch?

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

Hi,

At Wed, 18 May 2011 02:23:35 +0900,
Kacper Kowalik wrote in [ruby-core:36277]:

Yes, thank you! But of course you need s/__ia64/PPC64/ following line:

Thank you, I also noticed it just after the post.
Is it all upper case?

--
Nobu Nakada

Updated by Anonymous over 11 years ago

Nobuyoshi Nakada wrote:

Hi,

At Wed, 18 May 2011 02:23:35 +0900,
Kacper Kowalik wrote in [ruby-core:36277]:

Yes, thank you! But of course you need s/__ia64/PPC64/ following line:

Thank you, I also noticed it just after the post.
Is it all upper case?
Yes,

$ echo | gcc -dM -E - | grep -i ppc
#define _ARCH_PPCGR 1
#define PPC64 1
#define _ARCH_PPC 1
#define PPC 1
#define _ARCH_PPC64 1

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Description updated (diff)
  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Fixed at r32542

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0