gsub! segmentation fault

I

Innes MacKenzie

Hi all,
I've managed to make irb blow up: when I call gsub! on a string and
then evaluate the string I get a segmentation fault, depending on the
variable name of the receiving string:

Examples: (ruby 1.8.2 (2004-12-25) [i386-mswin32]):

String named 's' - works okay:
-------------------------------------------
D:\Documents and Settings\innes>irb
irb(main):001:0> s = "select * from tablenamehere"
=> "select * from tablenamehere"
irb(main):002:0> s.gsub!(/tablenamehere/, 'test')
=> "select * from test"
irb(main):003:0> s
=> "select * from test"
irb(main):004:0> exit
D:\Documents and Settings\innes>

String named 'create_table_script' - throws an error:
--------------------------------------------------------------------------
D:\Documents and Settings\innes>irb
irb(main):001:0> create_table_script = "select * from tablenamehere"
=> "select * from tablenamehere"
irb(main):002:0> create_table_script.gsub!(/tablenamehere/, 'test')
=> "select * from test"
irb(main):003:0> create_table_script
c:/ruby/lib/ruby/1.8/irb/input-method.rb:97: [BUG] Segmentation fault
ruby 1.8.2 (2004-12-25) [i386-mswin32]


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
D:\Documents and Settings\innes>

I've tried it with a couple of other names for 's/create_table_script'
and have found only the latter causes the segmentation fault. Has
anyone else seen this problem, or have I cocked something up?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top