Skip to content

'gets' method not working in mruby-3.2.0 #5991

Closed

Description

@masahino

I'm having an issue with the '$stdin.gets' method in mruby-3.2.0.
It doesn't seem to be responding to any input and the program appears to be stuck.

Activity

  1. matz commented on Apr 25, 2023

    @matz
    Member

    It works on my box. To reproduce the issue, could you provide more information, please?
    Start from the output from mruby-config --cflags.

  2. masahino commented on Apr 25, 2023

    @masahino
    ContributorAuthor

    In my environment, I have problems with both MacOS and Ubuntu.
    No problem with mruby-3.1.0.

    result of running mruby-config on MacOS.

    % bin/mruby-config --cflags
    -std=gnu99 -g -O3 -Wall -Wundef -Werror-implicit-function-declaration -Wwrite-strings -Wzero-length-array -DMRB_USE_RATIONAL -DMRB_USE_COMPLEX -DMRB_USE_BIGINT -I/Users/masahino/tmp/mruby-3.2.0/include -I/Users/masahino/tmp/mruby-3.2.0/build/host/include -I/Users/masahino/tmp/mruby-3.2.0/mrbgems/mruby-time/include -I/Users/masahino/tmp/mruby-3.2.0/mrbgems/mruby-io/include
    
  3. matz commented on Apr 25, 2023

    @matz
    Member

    Hmm, I don't see any problem from your configuration.
    On your environments, gets does not work at all? I mean, it does not work on any situation, or does not work on specific input?

  4. masahino commented on Apr 25, 2023

    @masahino
    ContributorAuthor

    It does not work on any situation.

    For example,

    mruby-3.2.0 % bin/mirb
    mirb - Embeddable Interactive Ruby Shell
    
    > gets
    abc
    

    No response is received.

    With mruby-3.1.0

    mruby-3.1.0 % bin/mirb
    mirb - Embeddable Interactive Ruby Shell
    
    > gets
    abc
     => "abc\n"
    >
    
  5. matz commented on Apr 26, 2023

    @matz
    Member

    ah, I found a bug in io_find_index. Thank you for the report.

  6. added a commit that references this issue on Feb 7, 2024
    68d67ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions