Bug 1203997

Summary: [GSS](6.4.z) Using ? as control character in .inputrc causes CLI to terminate immediately.
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jay SenSharma <jsenshar>
Component: CLIAssignee: baranowb <bbaranow>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.2CC: bbaranow, bmaxwell, cdewolf, jawilson, mkopecky, rpelisse, rsvoboda, sjadhav, spederse
Target Milestone: CR1   
Target Release: EAP 6.4.2   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-17 10:12:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1210556, 1219165    

Description Jay SenSharma 2015-03-20 06:11:38 UTC
Description of problem:
=======================
When user has a '.inputrc' in the user home directory with the following content:

{code}
# Control characters
"\C-?":   backward-delete-char
{code}

- The it fails with the the following Stack Trace:
{code}
$JBOSS_HOME/bin/jboss-cli.sh
java.lang.RuntimeException: ERROR parsing ? keys to aesh. Check your inputrc.
        at org.jboss.aesh.edit.mapper.KeyMapper.convertRandomControlKeys(KeyMapper.java:161)
        at org.jboss.aesh.edit.mapper.KeyMapper.mapRandomKeys(KeyMapper.java:138)
        at org.jboss.aesh.edit.mapper.KeyMapper.mapKeys(KeyMapper.java:108)
        at org.jboss.aesh.edit.mapper.KeyMapper.mapQuoteKeys(KeyMapper.java:49)
        at org.jboss.aesh.console.Config.parseInputrc(Config.java:127)
        at org.jboss.aesh.console.Console.reset(Console.java:150)
        at org.jboss.aesh.console.Console.<init>(Console.java:105)
        at org.jboss.aesh.console.Console.<init>(Console.java:101)
        at org.jboss.as.cli.impl.Console$Factory.getConsole(Console.java:85)
        at org.jboss.as.cli.impl.Console$Factory.getConsole(Console.java:78)
        at org.jboss.as.cli.impl.CommandContextImpl.initBasicConsole(CommandContextImpl.java:354)
        at org.jboss.as.cli.impl.CommandContextImpl.<init>(CommandContextImpl.java:294)
        at org.jboss.as.cli.impl.CommandContextFactoryImpl.newCommandContext(CommandContextFactoryImpl.java:76)
        at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:279)
        at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:262)
        at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.jboss.modules.Module.run(Module.java:312)
        at org.jboss.modules.Main.main(Main.java:460)
{code}



Version-Release number of selected component (if applicable):


How reproducible:
Steps to Reproduce:
1.  Create a file in user home directory with name ".inputrc"

2.  Add the following entry inside the file ".inputrc"
{code}
# Control characters
"\C-?":   backward-delete-char
{code}

3. Start jboss cli script.


Actual results:
================
- Mentioned stackTrace is shown


Expected results:
================
- CLI should not have terminated suddenly rather the exception should have been handled in a proper way.


Additional info:

Comment 1 Romain Pelisse 2015-04-01 06:46:00 UTC
I'll take a look at this one. Let me know if you have input or are already working on it.

Comment 2 Alexey Loubyansky 2015-04-01 06:49:54 UTC
WFCORE-608 has been resolved upstream. But thanks!

Comment 3 Romain Pelisse 2015-04-01 07:09:16 UTC
Gosh, forgot again to check the upstream issue ! Well, good to know anyway :)

Comment 5 JBoss JIRA Server 2015-04-09 09:19:56 UTC
Bartosz Baranowski <bbaranow> updated the status of jira WFCORE-608 to Reopened

Comment 8 Ståle W. Pedersen 2015-04-09 09:36:26 UTC
it was fixed upstream a version or two ago, but eap is not using the upstream versino but an older version 0.33.*.
the pr you did was only for master so not for the 0.33.* which im guessing was what you were targeting?
there is a branch called eap which the 0.33.* versions are.

Comment 11 JBoss JIRA Server 2015-04-13 09:35:05 UTC
Ståle Pedersen <stale.pedersen> updated the status of jira AESH-316 to Resolved

Comment 12 Ståle W. Pedersen 2015-04-14 12:13:58 UTC
æsh 0.33.15 has been tagged and released.

Comment 20 Marek Kopecky 2015-06-23 12:31:39 UTC
Verified on EAP 6.4.2.CP.CR1

Comment 22 Petr Penicka 2017-01-17 10:12:21 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.