New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing in command line arguments containing "%20n" causes jruby to abort with error "%n in writable segment detected" #3711

Closed
ptepper opened this Issue Mar 4, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@ptepper

ptepper commented Mar 4, 2016

Environment

Version: jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 25.74-b02 on 1.8.0_74-b02 +jit [linux-amd64]

OS & platform: Ubuntu 15.10 (GNU/Linux 4.2.0-27-generic x86_64))

Expected Behavior

jruby should accept the command line arguments containing the substring "%20n" as a normal string.

Actual Behavior

Immediate failure and abort:

> jruby -S script.rb -a "Foo%20nar"
*** %n in writable segment detected ***
Aborted (core dumped)

The script contents can be anything, e.g. a script containing puts "Hello, world!" alone will trigger this behavior.

@Lan5432

This comment has been minimized.

Show comment
Hide comment
@Lan5432

Lan5432 Mar 9, 2016

Contributor

Could we recreate this on Windows command line? What should be "%20n" in the invocation?

Contributor

Lan5432 commented Mar 9, 2016

Could we recreate this on Windows command line? What should be "%20n" in the invocation?

@BanzaiMan

This comment has been minimized.

Show comment
Hide comment
@BanzaiMan

BanzaiMan Mar 9, 2016

Member

I don't see this:

$ jruby -v                         
jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 25.66-b17 on 1.8.0_66-b17 +jit [darwin-x86_64]
$ cat script.rb                                                                                                                                                                   
puts "Hello, World!"
$ jruby -S script.rb -a "Foo%20nar"
Hello, World!
Member

BanzaiMan commented Mar 9, 2016

I don't see this:

$ jruby -v                         
jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 25.66-b17 on 1.8.0_66-b17 +jit [darwin-x86_64]
$ cat script.rb                                                                                                                                                                   
puts "Hello, World!"
$ jruby -S script.rb -a "Foo%20nar"
Hello, World!
@Lan5432

This comment has been minimized.

Show comment
Hide comment
@Lan5432

Lan5432 Mar 9, 2016

Contributor

I also tried creating a file with that as a substring, and it wasn't a problem. But that's why I'm asking if Windows works. I will try it on KUbuntu eventually

Contributor

Lan5432 commented Mar 9, 2016

I also tried creating a file with that as a substring, and it wasn't a problem. But that's why I'm asking if Windows works. I will try it on KUbuntu eventually

@kares

This comment has been minimized.

Show comment
Hide comment
@kares

kares Mar 9, 2016

Member

seems to happen on Linux, 9.0.5.0 is affected as well. but master seems to be doing fine already :

$ bin/jruby -v
jruby 9.1.0.0-SNAPSHOT (2.3.0) 2016-03-08 dc21f62 Java HotSpot(TM) 64-Bit Server VM 24.72-b04 on 1.7.0_72-b14 +jit [linux-amd64]

$ bin/jruby -S script.rb -a "Foo%20nar"
jruby: No such file or directory -- script (LoadError)
Member

kares commented Mar 9, 2016

seems to happen on Linux, 9.0.5.0 is affected as well. but master seems to be doing fine already :

$ bin/jruby -v
jruby 9.1.0.0-SNAPSHOT (2.3.0) 2016-03-08 dc21f62 Java HotSpot(TM) 64-Bit Server VM 24.72-b04 on 1.7.0_72-b14 +jit [linux-amd64]

$ bin/jruby -S script.rb -a "Foo%20nar"
jruby: No such file or directory -- script (LoadError)

@kares kares added this to the JRuby 9.1.0.0 milestone Mar 10, 2016

@kares kares closed this Mar 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment