Project

General

Profile

Bug #13284

IA64 ruby 2.4 miniruby segfault

Added by ntfshard (Maksim Derbasov) over 1 year ago. Updated 3 months ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:79928]

Description

Hello, I faced with this degradation (2.0.0 work perfect)

[ruby-2.4.0]$ gdb ./miniruby
GNU gdb Red Hat Linux (6.3.0.0-1.143.el4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /tmp/ruby-2.4.0/miniruby
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xa000000000000000
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 28566)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 28566)]
reserve_stack (limit=0x60000ffc000010e0 , size=17179852800) at thread_pthread.c:722
722 limit[0] = 0;
(gdb) print sz
Variable "sz" is not available.

(gdb) bt
#0 reserve_stack (limit=0x60000ffc000010e0 , size=17179852800) at thread_pthread.c:722
#1 0x400000000038ee30 in ruby_init_stack (addr=0x60000fffffffb4a0, bsp=0x60000ffbffffc080) at thread_pthread.c:751
#2 0x4000000000024460 in main (argc=1, argv=0x60000fffffffb4b8) at main.c:34


P.S. I did not get the main idea of a code but it looks a little bit dangerous (http://man7.org/linux/man-pages/man3/alloca.3.html http://stackoverflow.com/questions/1018853/why-is-the-use-of-alloca-not-considered-good-practice)

Associated revisions

Revision 7aa74a0d
Added by takano32 (Mitsuhiro TAKANO) about 1 year ago

a64: fix crash on register stack mark/sweep pass

  • thread_pthread.c: move 'register_stack_start' earlier. [Bug #13284] [Fix GH-1625]

Author: Sergei Trofimovich slyfox@gentoo.org

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59307
Added by takano32 (Mitsuhiro TAKANO) about 1 year ago

a64: fix crash on register stack mark/sweep pass

  • thread_pthread.c: move 'register_stack_start' earlier. [Bug #13284] [Fix GH-1625]

Author: Sergei Trofimovich slyfox@gentoo.org

Revision 59307
Added by takano32 (Mitsuhiro TAKANO) about 1 year ago

a64: fix crash on register stack mark/sweep pass

  • thread_pthread.c: move 'register_stack_start' earlier. [Bug #13284] [Fix GH-1625]

Author: Sergei Trofimovich slyfox@gentoo.org

Revision 66163b77
Added by nagachika (Tomoyuki Chikanaga) about 1 year ago

merge revision(s) 59307: [Backport #13284]

a64: fix crash on register stack mark/sweep pass

* thread_pthread.c: move 'register_stack_start' earlier.
   [Bug #13284] [Fix GH-1625]

Author:    Sergei Trofimovich <slyfox@gentoo.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59405
Added by nagachika (Tomoyuki Chikanaga) about 1 year ago

merge revision(s) 59307: [Backport #13284]

a64: fix crash on register stack mark/sweep pass

* thread_pthread.c: move 'register_stack_start' earlier.
   [Bug #13284] [Fix GH-1625]

Author:    Sergei Trofimovich <slyfox@gentoo.org>

Revision f6d9f6fd
Added by usa (Usaku NAKAMURA) about 1 year ago

merge revision(s) 59307: [Backport #13284]

a64: fix crash on register stack mark/sweep pass

* thread_pthread.c: move 'register_stack_start' earlier.
   [Bug #13284] [Fix GH-1625]

Author:    Sergei Trofimovich <slyfox@gentoo.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59537
Added by usa (Usaku NAKAMURA) about 1 year ago

merge revision(s) 59307: [Backport #13284]

a64: fix crash on register stack mark/sweep pass

* thread_pthread.c: move 'register_stack_start' earlier.
   [Bug #13284] [Fix GH-1625]

Author:    Sergei Trofimovich <slyfox@gentoo.org>

History

#1 [ruby-core:80114] Updated by naruse (Yui NARUSE) over 1 year ago

  • Assignee set to takano32 (Mitsuhiro TAKANO)
  • Status changed from Open to Assigned

#2 Updated by takano32 (Mitsuhiro TAKANO) about 1 year ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r59307.


a64: fix crash on register stack mark/sweep pass

  • thread_pthread.c: move 'register_stack_start' earlier. [Bug #13284] [Fix GH-1625]

Author: Sergei Trofimovich slyfox@gentoo.org

#3 Updated by nagachika (Tomoyuki Chikanaga) about 1 year ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: UNKNOWN, 2.3: REQUIRED, 2.4: REQUIRED

#4 [ruby-core:82134] Updated by nagachika (Tomoyuki Chikanaga) about 1 year ago

  • Backport changed from 2.2: UNKNOWN, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: UNKNOWN, 2.3: REQUIRED, 2.4: DONE

ruby_2_4 r59405 merged revision(s) 59307.

#5 [ruby-core:82298] Updated by usa (Usaku NAKAMURA) about 1 year ago

  • Backport changed from 2.2: UNKNOWN, 2.3: REQUIRED, 2.4: DONE to 2.2: UNKNOWN, 2.3: DONE, 2.4: DONE

ruby_2_3 r59537 merged revision(s) 59307.

#6 [ruby-core:83186] Updated by ntfshard (Maksim Derbasov) 12 months ago

  • Status changed from Closed to Open

Hello
Sorry for delay, but ruby-2.4.2 still has this issue. May be something wrong with size argument?

[ruby-2.4.2]$ gdb ./miniruby
GNU gdb Red Hat Linux (6.3.0.0-1.143.el4rh)
Copyright 2004 Free Software Foundation, Inc.

(gdb) run
Starting program: /tmp/ruby-2.4.2/miniruby
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xa000000000000000
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 22035)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 22035)]
reserve_stack (limit=0x60000ffc000010e0 , size=17179852800) at thread_pthread.c:722
722 limit[0] = 0;
(gdb) bt
#0 reserve_stack (limit=0x60000ffc000010e0 , size=17179852800) at thread_pthread.c:722
#1 0x200000080042bef0 in ruby_init_stack (addr=0x60000fffffffb8f0, bsp=Variable "bsp" is not available.
) at thread_pthread.c:757
#2 0x20000008000870a0 in main (argc=1, argv=0x60000fffffffb908) at main.c:34
(gdb)

#7 Updated by hsbt (Hiroshi SHIBATA) 11 months ago

  • Status changed from Open to Assigned

#8 [ruby-core:87491] Updated by knedlsepp (Josef Kemetmüller) 3 months ago

I tried a few suggestions, which did not work out for me:

  • Configure with --with-setjmp-type=_setjmp
  • Compile using -O0 -fno-omit-frame-pointer -fno-stack-protector

What finally worked for me was to run the build without stack limits: ulimit -s unlimited.

Also available in: Atom PDF