Skip to content
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

ptepper opened this issue Mar 4, 2016 · 4 comments


Copy link

@ptepper ptepper commented Mar 4, 2016


Version: jruby (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.

Copy link

@Lan5432 Lan5432 commented Mar 9, 2016

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

Copy link

@BanzaiMan BanzaiMan commented Mar 9, 2016

I don't see this:

$ jruby -v                         
jruby (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!
Copy link

@Lan5432 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

Copy link

@kares kares commented Mar 9, 2016

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

$ bin/jruby -v
jruby (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 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.