Project

General

Profile

Bug #728

Segmentation fault with Ruby 1.8.7-p22 from st_lookup

Added by mkrauskopf (Martin Krauskopf) almost 11 years ago. Updated over 8 years ago.

Status:
Third Party's Issue
Priority:
Normal
ruby -v:
ruby-debug-ide-0.4.2
[ruby-core:19746]

Description

=begin
Details are described in the:

http://rubyforge.org/tracker/?func=detail&atid=1698&aid=21185&group_id=426

I was asked to (re)file it into the new tracker.

Still reproducible with ruby 1.8.7, patchlevel 72 as described there. Let me know if you can't reproduce and/or want a new backtrace.
=end


Files

backtrace.txt (12.4 KB) backtrace.txt enDal (Dennis Ushakov), 11/05/2010 10:39 PM

History

#1

Updated by matz (Yukihiro Matsumoto) almost 11 years ago

=begin
Hi,

In message "Re: [ruby-core:19746] [Bug #728] Segmentation fault with Ruby 1.8.7-p22 from st_lookup"
on Sun, 9 Nov 2008 01:34:32 +0900, Martin Krauskopf redmine@ruby-lang.org writes:

|Still reproducible with ruby 1.8.7, patchlevel 72 as described there. Let me know if you can't reproduce and/or want a new backtrace.

I couldn't reproduce the problem. Do I have to use version 0.2.1 of
ruby-debug-ide? I used 0.4.0.

                        matz.

=end

#2

Updated by mkrauskopf (Martin Krauskopf) almost 11 years ago

=begin
Hi Matz,

I still can with the latest 1.8.7 and ruby-debug-ide-0.4.2 (latest).

First terminal:

 emdot@ubuntbook:~/tmp/segfault$ cat tester.rb 
 class IterativeFibonacci
   def value(n)
     iterative_fib(n, 0, 1)
   end
   def iterative_fib(n, f1, f2)
     return f2 if n < 2
     iterative_fib(n - 1, f2, (f1 + f2))
   end
 end

 p IterativeFibonacci.new.value(24)

 emdot@ubuntbook:~/tmp/segfault$ ruby `which rdebug-ide` -p 12345 -- tester.rb 
 Fast Debugger (ruby-debug-ide 0.4.2) listens on localhost:12345
 /space/ruby/gem-repo/gems/ruby-debug-ide-0.4.2/lib/ruby-debug/xml_printer.rb:106: [BUG] Segmentation fault
 ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

 Aborted

Second terminal:

 emdot@ubuntbook:~$ telnet localhost 12345
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
 b tester.rb:7
 <breakpointAdded no="1" location="tester.rb:7"/>start
 <breakpoint file="tester.rb" line="7" threadId="1"/>c
 <breakpoint file="tester.rb" line="7" threadId="1"/>c
 <breakpoint file="tester.rb" line="7" threadId="1"/>c
 <breakpoint file="tester.rb" line="7" threadId="1"/>frame 5; v l
 <variables><variable name="self" kind="local" value="#&lt;IterativeFibonacci:0xb7b09598&gt;" type="IterativeFibonacci" hasChildren="false" objectId="-0x2427b534"/>Connection closed by foreign host.

As soon as I do 'frame 5; v l' the debugger backend in the first terminal segfaults. Let me know if I can provide more information.
(sorry for late response, I was not notified abou the update of the issue, will try to fix my account)

=end

#3

Updated by shyouhei (Shyouhei Urabe) over 10 years ago

  • Assignee set to matz (Yukihiro Matsumoto)

=begin

=end

#5

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Status changed from Open to Third Party's Issue
  • ruby -v set to ruby-debug-ide-0.4.2

=begin

=end

#6

Updated by enDal (Dennis Ushakov) almost 9 years ago

=begin
The problem is still reproducible with ruby-debug-ide 0.4.11 and ruby 1.8.7 p302. Please have a look at gdb backtrace attached
=end

#7

Updated by enDal (Dennis Ushakov) almost 9 years ago

=begin
Actually this problems happens because ruby-debug-base gem gets values from local variables which are not yet initialized. Ruby allocates memory for local variables without doing cleanup of that memory, so when trying to invoke == method on some garbage for uninitialized variable we get segfault. Can I tell Ruby to assign nil for variables when allocating from ruby-debug gem side? Or may be there's some way to check that local variable is not yet initialized?
=end

Also available in: Atom PDF