Ruby Forum Ruby-core > BUS error in string manip

Posted by ara howard (Guest)
on 22.04.2008 07:01
(Received via mailing list)
Posted by Marc Haisenko (Guest)
on 22.04.2008 09:59
(Received via mailing list)
On Tuesday 22 April 2008, ara howard wrote:
> http://p.ramaze.net/1188

I can confirm this with Ruby 1.8.6 (OpenSuSE 10.3):

marc@tetsuo:~/tmp> ruby 1188.txt
1188.txt:3: [BUG] Segmentation fault
ruby 1.8.6 (2007-06-07) [x86_64-linux]

Aborted

--
Marc Haisenko

Comdasys AG
Rüdesheimer Str. 7
80686 München
Germany

Tel.: +49 (0)89 548 433 321
Posted by Robert Dober (Guest)
on 22.04.2008 21:20
(Received via mailing list)
On Tue, Apr 22, 2008 at 7:00 AM, ara howard <ara.t.howard@gmail.com> 
wrote:
>
>  http://p.ramaze.net/1188
>
>
>  a @ http://codeforpeople.com/
>  --
>  we can deny everything, except that we have the possibility of being
> better. simply reflect on that.
>  h.h. the 14th dalai lama
>
I have the code down to this

560/60 > uname -a && cat bus_error.rb && ruby -v bus_error.rb
Linux roma 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 
GNU/Linux
class String
  def snake_case
    gsub(/\B/, '')
  end
end


"".gsub('', '').gsub('::', '/').snake_case

ruby 1.8.6 (2008-04-11 patchlevel 5000) [i686-linux]
bus_error.rb:3: [BUG] Segmentation fault
ruby 1.8.6 (2008-04-11) [i686-linux]

Aborted (core dumped)

Please note that the two gsub seem to be necessary as well as the /\B/

HTH
Robert
Posted by Luis Lavena (luislavena)
on 22.04.2008 21:30
(Received via mailing list)
On Tue, Apr 22, 2008 at 4:19 PM, Robert Dober <robert.dober@gmail.com> 
wrote:
>
> On Tue, Apr 22, 2008 at 7:00 AM, ara howard <ara.t.howard@gmail.com> wrote:
>  >
>  >  http://p.ramaze.net/1188
>  >

One-Click Installer:
ruby 1.8.6 (2008-03-03 patchlevel 114) [i386-mswin32]

t.rb:3: [BUG] Segmentation fault
ruby 1.8.6 (2008-03-03) [i386-mswin32]

new One-Click Installer (MinGW, ruby_1_8 branch):
t.rb:3: [BUG] Segmentation fault
ruby 1.8.6 (2008-04-11) [i386-mingw32]

--
Luis Lavena
Multimedia systems
-
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams
Posted by Akinori MUSHA (Guest)
on 23.04.2008 07:36
(Received via mailing list)
At Tue, 22 Apr 2008 14:00:17 +0900,
ara howard wrote:
> http://p.ramaze.net/1188

Thanks.  It has been fixed in the ruby_1_8 and ruby_1_8_7 branches.
The ruby_1_8_6 branch will be taken care of later.