Bug #4566

followup of [ruby-core:32747]

Added by jojelino _ about 3 years ago. Updated almost 3 years ago.

[ruby-core:35683]
Status:Third Party's Issue
Priority:High
Assignee:Nobuyoshi Nakada
Category:core
Target version:1.9.3
ruby -v:revision 31234 Backport:

Description

=begin

Index: vmexec.c
===================================================================
--- vm
exec.c (revision 31234)
+++ vm_exec.c (working copy)
@@ -11,7 +11,7 @@

#include

-#if VMDEBUG > 0
+#if (VMDEBUG > 0) | ((GNUC >= 4) && (GNUC_MINOR >= 6) && (GNUC_PATCHLEVEL >= 0))
#define DECLSCREG(type, r, reg) register type reg_##r

#elif GNUC && x86_64 && !clang

please apply this, it resolves segmentation fault in gcc > 4.6
specifying register name explicitly fails. although it worked in previous version.
if you continue using explicit register name, you gotta find workaround about it ;)
=end

History

#1 Updated by Yui NARUSE about 3 years ago

=begin
The patch seems wrong: first is the way check the gcc version,
and the condition also wrong.

Additional to say, I doubt that this bug is reproduced only on mingw32.
=end

#2 Updated by jojelino _ about 3 years ago

=begin

The patch seems wrong: first is the way check the gcc version, and the condition also wrong.

the definitive solution would be leaving only following line

:#define DECLSCREG(type, r, reg) register type reg_##r

I doubt that this bug is reproduced only on mingw32.

to be honest, it doesn't be reproduced without -O flag. sure it was mingw32.

so i would like to say %edi & %esi is now clobbered for >=gcc 4.6 with optimization option
enabled.
=end

#3 Updated by Yui NARUSE about 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

=begin
FYI, on FreeBSD 8.1 and gcc4.6 -O3, it wokrs.
=end

#4 Updated by Motohiro KOSAKI almost 3 years ago

  • Status changed from Assigned to Third Party's Issue

I'm using Linux Fedora 15 and following gcc version. It also works fine without the patch.
So, this is obviously no ruby issue. Please update gcc.

% LANG=C gcc -v
LANG=C gcc -v
Using built-in specs.
COLLECTGCC=/usr/bin/gcc
COLLECT
LTOWRAPPER=/usr/libexec/gcc/x8664-redhat-linux/4.6.0/lto-wrapper
Target: x8664-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.\
redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib -\
-enable-
cxaatexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c\
,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm\
/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-e\
cj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch32=i686 --build=x8664-redhat-linu\
x
Thread model: posix
gcc version 4.6.0 20110530 (Red Hat 4.6.0-9) (GCC)

Also available in: Atom PDF