irb: Segmentation fault

Discussion in 'Ruby' started by Pavel Smerk, Aug 2, 2006.

  1. Pavel Smerk

    Pavel Smerk Guest

    Hello folks,

    in the following two cases irb fails (I've removed spaces from the
    =~/^irb/ lines to prevent line breaks):

    $ irb
    irb(main):001:0>"ahoj".split(//).join('|')
    => "a|h|o|j"
    irb(main):002:0>"ahoj".split(/(?<=(?![Cc][Hh]).)/).join('|')
    SyntaxError: compile error
    (irb):2: undefined (?...) sequence: /(?<=(?![Cc][Hh]).)/
    from (irb):2
    irb(main):003:0>"ahoj".split(/(?!ch)/).join('|')
    => "a|h|o|j"
    irb(main):004:0>"achoj".split(/(?!ch)/).join('|')
    => "ac|h|o|j"
    irb(main):005:0>"achoj".gsub(/([Cc])([Hh])/,'$1_$2').split(/(?!_[Hh])/).join('|')
    => "a|$|1|_|$|2|o|j"
    irb(main):006:0>"achoj".gsub(/([Cc])([Hh])/,'\1_\2').split(/(?!_[Hh])/).join('|')
    /usr/lib/ruby/1.8/irb/ruby-lex.rb:979: [BUG] Segmentation fault
    ruby 1.8.2 (2005-04-11) [i386-linux]

    Neúspì¹nì ukonèen (SIGABRT)
    $

    $ irb
    irb(main):001:0>"ahoj".split(//).join('|')
    => "a|h|o|j"
    irb(main):002:0>"ahoj".split(/(?<=(?![Cc][Hh]).)/).join('|')
    SyntaxError: compile error
    (irb):2: undefined (?...) sequence: /(?<=(?![Cc][Hh]).)/
    from (irb):2
    irb(main):003:0>"ahoj".split(/(?!ch)/).join('|')
    => "a|h|o|j"
    irb(main):004:0>"achoj".gsub(/([Cc])([Hh])/,'$1_$2').split(/(?!_[Hh])/).join('|')
    => "a|$|1|_|$|2|o|j"
    irb(main):005:0>"achoj".gsub(/([Cc])([Hh])/,'\1_\2').split(/(?!_[Hh])/).join('|')
    => "a|c_|h|o|j"
    /usr/lib/ruby/1.8/irb.rb:265: [BUG] Segmentation fault
    ruby 1.8.2 (2005-04-11) [i386-linux]

    Neúspì¹nì ukonèen (SIGABRT)
    $

    ["Neúspì¹nì ukonèen" is perhaps some Czech translation of SIGABRT]

    If I repeat it exactly as shown, irb fails. I've tried to skip some
    statements, but only the fourth could be skipped to get Segmentation
    fault --- and even in this case the error message differed (and return
    value was got compared to the first case). Skipping whichever else does
    not lead to failure. I haven't tried simplifying of the statements too
    much (only a bit, but unsuccessfully with respect to retain the irb
    failure).

    Please, could someone test it with current version of ruby/irb?

    Where should one post such bugreports?

    Regards,

    P.
    Pavel Smerk, Aug 2, 2006
    #1
    1. Advertising

  2. Pavel Smerk wrote:
    > Hello folks,
    >
    > in the following two cases irb fails (I've removed spaces from the
    > =~/^irb/ lines to prevent line breaks):
    >
    > $ irb
    > irb(main):001:0>"ahoj".split(//).join('|')
    > => "a|h|o|j"
    > irb(main):002:0>"ahoj".split(/(?<=(?![Cc][Hh]).)/).join('|')
    > SyntaxError: compile error
    > (irb):2: undefined (?...) sequence: /(?<=(?![Cc][Hh]).)/
    > from (irb):2
    > irb(main):003:0>"ahoj".split(/(?!ch)/).join('|')
    > => "a|h|o|j"
    > irb(main):004:0>"achoj".split(/(?!ch)/).join('|')
    > => "ac|h|o|j"
    > irb(main):005:0>"achoj".gsub(/([Cc])([Hh])/,'$1_$2').split(/(?!_[Hh])/).join('|')
    >
    > => "a|$|1|_|$|2|o|j"
    > irb(main):006:0>"achoj".gsub(/([Cc])([Hh])/,'\1_\2').split(/(?!_[Hh])/).join('|')
    >
    > /usr/lib/ruby/1.8/irb/ruby-lex.rb:979: [BUG] Segmentation fault
    > ruby 1.8.2 (2005-04-11) [i386-linux]
    >
    > Neúspì¹nì ukonèen (SIGABRT)
    > $
    >

    Works for me:

    $ irb -v
    irb 0.9(02/07/03)
    $ ruby -v
    ruby 1.8.2 (2004-12-25) [i586-linux-gnu]
    $ irb
    irb(main):001:0> "ahoj".split(//).join('|')
    => "a|h|o|j"
    irb(main):002:0> "ahoj".split(/(?<=(?![Cc][Hh]).)/).join('|')
    SyntaxError: compile error
    (irb):2: undefined (?...) sequence: /(?<=(?![Cc][Hh]).)/
    from (irb):2
    irb(main):003:0> "ahoj".split(/(?!ch)/).join('|')
    => "a|h|o|j"
    irb(main):004:0> "achoj".split(/(?!ch)/).join('|')
    => "ac|h|o|j"
    irb(main):005:0>
    "achoj".gsub(/([Cc])([Hh])/,'$1_$2').split(/(?!_[Hh])/).join('|')
    => "a|$|1|_|$|2|o|j"
    irb(main):006:0>
    "achoj".gsub(/([Cc])([Hh])/,'\1_\2').split(/(?!_[Hh])/).join('|')
    => "a|c_|h|o|j"
    irb(main):007:0> quit

    > $ irb
    > irb(main):001:0>"ahoj".split(//).join('|')
    > => "a|h|o|j"
    > irb(main):002:0>"ahoj".split(/(?<=(?![Cc][Hh]).)/).join('|')
    > SyntaxError: compile error
    > (irb):2: undefined (?...) sequence: /(?<=(?![Cc][Hh]).)/
    > from (irb):2
    > irb(main):003:0>"ahoj".split(/(?!ch)/).join('|')
    > => "a|h|o|j"
    > irb(main):004:0>"achoj".gsub(/([Cc])([Hh])/,'$1_$2').split(/(?!_[Hh])/).join('|')
    >
    > => "a|$|1|_|$|2|o|j"
    > irb(main):005:0>"achoj".gsub(/([Cc])([Hh])/,'\1_\2').split(/(?!_[Hh])/).join('|')
    >
    > => "a|c_|h|o|j"
    > /usr/lib/ruby/1.8/irb.rb:265: [BUG] Segmentation fault
    > ruby 1.8.2 (2005-04-11) [i386-linux]
    >
    > Neúspì¹nì ukonèen (SIGABRT)
    > $
    >

    Works for me:
    $ irb
    irb(main):001:0> "ahoj".split(//).join('|')
    => "a|h|o|j"
    irb(main):002:0> "ahoj".split(/(?<=(?![Cc][Hh]).)/).join('|')
    SyntaxError: compile error
    (irb):2: undefined (?...) sequence: /(?<=(?![Cc][Hh]).)/
    from (irb):2
    irb(main):003:0> "ahoj".split(/(?!ch)/).join('|')
    => "a|h|o|j"
    irb(main):004:0>
    "achoj".gsub(/([Cc])([Hh])/,'$1_$2').split(/(?!_[Hh])/).join('|')
    => "a|$|1|_|$|2|o|j"
    irb(main):005:0>
    "achoj".gsub(/([Cc])([Hh])/,'\1_\2').split(/(?!_[Hh])/).join('|')
    => "a|c_|h|o|j"
    irb(main):006:0>

    > ["Neúspì¹nì ukonèen" is perhaps some Czech translation of SIGABRT]
    >
    > If I repeat it exactly as shown, irb fails. I've tried to skip some
    > statements, but only the fourth could be skipped to get Segmentation
    > fault --- and even in this case the error message differed (and return
    > value was got compared to the first case). Skipping whichever else
    > does not lead to failure. I haven't tried simplifying of the
    > statements too much (only a bit, but unsuccessfully with respect to
    > retain the irb failure).
    >
    > Please, could someone test it with current version of ruby/irb?
    >
    > Where should one post such bugreports?
    >
    > Regards,
    >
    > P.
    >


    Maybe you just need a slightly newer version?

    -Justin
    Justin Collins, Aug 2, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Hunsley
    Replies:
    17
    Views:
    849
  2. Pud
    Replies:
    0
    Views:
    563
  3. Sam Stephenson
    Replies:
    1
    Views:
    213
    Andrew Walrond
    Jun 18, 2005
  4. Replies:
    1
    Views:
    150
    Florian Groß
    Oct 26, 2005
  5. anne001
    Replies:
    1
    Views:
    255
    anne001
    Jun 27, 2006
Loading...

Share This Page