Version: 12.0.0-dev-31
Build #: 27086
Build Date: 2012-May-24 01:18:54 PM
$cat PHP.odt
gives NPE in error log. File is attached
java.lang.NullPointerException
at org.netbeans.lib.terminalemulator.InterpDumb.processChar(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.fꈵꃣꃍᡭ.processChar(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Fꋔ⢼ꋅᠲ int while.processChar(Unknown Source)
at org.netbeans.lib.terminalemulator.Term.putc_work(Unknown Source)
at org.netbeans.lib.terminalemulator.Term.access$500(Unknown Source)
at org.netbeans.lib.terminalemulator.Term$BaseTermStream.putChars(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.cꁂ⣵ꌗꈋ 8 extends.putChars(Unknown Source)
at org.netbeans.lib.terminalemulator.Term.putChars(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.h⢎⣽ᢛᢁ.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.u⡘ꃅꈖꇘ.loop(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Sꊼꈞꇒꂱ 10.run(Unknown Source)
89 KB
This file is not a regular file and below is the stack trace, can you please take a look:
<2012-05-24 16:37:51,718> ERROR [fluid terminal] <com.aquafold.datastudio.tools.shell.FluidTerminalPanel$7>
java.lang.NullPointerException
at org.netbeans.lib.terminalemulator.InterpDumb.processChar(InterpDumb.java:248)
at com.common.terminal.impl.InterpVt100.processChar(InterpVt100.java:437)
at com.common.terminal.impl.InterpXterm.processChar(InterpXterm.java:266)
at org.netbeans.lib.terminalemulator.Term.putc_work(Term.java:5043)
at org.netbeans.lib.terminalemulator.Term.access$5(Term.java:5042)
at org.netbeans.lib.terminalemulator.Term$BaseTermStream.putChars(Term.java:423)
at com.aquafold.datastudio.tools.shell.FluidTerminalLineDiscipline.putChars(FluidTerminalLineDiscipline.java:30)
at org.netbeans.lib.terminalemulator.Term.putChars(Term.java:3493)
at com.common.terminal.api.AbstractTerminalWrapper._scanServerResponseInLoop(AbstractTerminalWrapper.java:274)
at com.aquafold.datastudio.tools.shell.FluidTerminalWrapper.loop(FluidTerminalWrapper.java:87)
at com.aquafold.datastudio.tools.shell.FluidTerminalWrapper$1.run(FluidTerminalWrapper.java:54)
You should ensure that C0/C1 control chars from ISO-8859 (extended ASCII) table are not sent to the terminal unless they are part of an escape sequence etc. Otherwise the vt220/xterm interpreter will mess its state and unexpected behavior will result. Control chars coming from binary files should be filtered out either at the command level (\cat, \more, \tail etc) or you should build a wrapper for the OutputStreamWriter ( the cli.getOutput() instance ) and write two methods here:
public void writeCSI(String sequence) { // CSI stands for Common Sequence Introducer in VTxxx parlance
output.write(ESC + "[" + sequence);
}
Thus methods like FluidEditor.clear() would be refactored to
public void clear() {
((Term)this.componentEditor).clearHistory();
wrapper.writeCSI("2J");
wrapper.writeCSI("H");
}
You should ensure that C0/C1 control chars from ISO-8859 (extended ASCII) table are not sent to the terminal unless they are part of an escape sequence etc. Otherwise the vt220/xterm interpreter will mess its state and unexpected behavior will result. Control chars coming from binary files should be filtered out either at the command level (\cat, \more, \tail etc) or you should build a wrapper for the OutputStreamWriter ( the cli.getOutput() instance ) and write two methods here:
public void writeCSI(String sequence) { // CSI stands for Common Sequence Introducer in VTxxx parlance
output.write(ESC + "[" + sequence);
}
Thus methods like FluidEditor.clear() would be refactored to
public void clear() {
((Term)this.componentEditor).clearHistory();
wrapper.writeCSI("2J");
wrapper.writeCSI("H");
}
Thanks for you input. I will look into fluid i/o implementation to see how to get around this problem.
Thanks for you input. I will look into fluid i/o implementation to see how to get around this problem.
Fixed in SVN r27133.
Note that after 'cat binary.file' is done, the prompt usually won't be displayed at the left-most column; this is because there is no new line character at the end of the file.
--- notes for developer ---
This problem cannot be handled at the command level. This is because the output of a command can be redirected, and command does not know what is the final destination of its output.
For example, in the pipeline below, after pipeline is executed, the content of binary.output should be the same as binary.input:
cat binary.input | tee | cat | cat > binary.output
while in this example:
cat binary.input | tee
before the binary contents of binary.input is written to the terminal, control characters should have been filtered out.
We get around this problem by introducing filter in ShellPipe.write(byte[] bytes), this API will be called by those commands that read/write their input in bytes when the output to be written to terminal.
--- notes for QA ---
At the moment, passing binary file to 'tail' and 'more' will crash the terminal; cat, tee and grep should be ok. Please give it a try.
Fixed in SVN r27133.
Note that after 'cat binary.file' is done, the prompt usually won't be displayed at the left-most column; this is because there is no new line character at the end of the file.
--- notes for developer ---
This problem cannot be handled at the command level. This is because the output of a command can be redirected, and command does not know what is the final destination of its output.
For example, in the pipeline below, after pipeline is executed, the content of binary.output should be the same as binary.input:
cat binary.input | tee | cat | cat > binary.output
while in this example:
cat binary.input | tee
before the binary contents of binary.input is written to the terminal, control characters should have been filtered out.
We get around this problem by introducing filter in ShellPipe.write(byte[] bytes), this API will be called by those commands that read/write their input in bytes when the output to be written to terminal.
--- notes for QA ---
At the moment, passing binary file to 'tail' and 'more' will crash the terminal; cat, tee and grep should be ok. Please give it a try.
>> At the moment, passing binary file to 'tail' and 'more' will crash the terminal; cat, tee and grep should be ok. Please give it a try.
Just logged issue 7014 for more and tail:
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/7014
>> At the moment, passing binary file to 'tail' and 'more' will crash the terminal; cat, tee and grep should be ok. Please give it a try.
Just logged issue 7014 for more and tail:
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/7014
Verified with ADStudio 12 Dev 89.
* no NPE in GUI FluidShell;
* written content is valid in situations as below:
cat /tmp/file.mp3 > /tmp/file_out.mp3
cat /tmp/file.mp3 | tee > /tmp/file_out.mp3
grep "" /tmp/file.mp3 > /tmp/file_out.mp3 (equivalent in Bash: grep -a "" /tmp/file.mp3 > /tmp/file_out.mp3)
Closed.
Verified with ADStudio 12 Dev 89.
* no NPE in GUI FluidShell;
* written content is valid in situations as below:
cat /tmp/file.mp3 > /tmp/file_out.mp3
cat /tmp/file.mp3 | tee > /tmp/file_out.mp3
grep "" /tmp/file.mp3 > /tmp/file_out.mp3 (equivalent in Bash: grep -a "" /tmp/file.mp3 > /tmp/file_out.mp3)
Closed.
Issue #7009 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build trunk/27133 |
No time estimate |
1 issue link |
relates to #14236
Issue #14236FluidShell source command doesn't handle specific control characters which prevent importing data |
This file is not a regular file and below is the stack trace, can you please take a look:
<2012-05-24 16:37:51,718> ERROR [fluid terminal] <com.aquafold.datastudio.tools.shell.FluidTerminalPanel$7>
java.lang.NullPointerException
at org.netbeans.lib.terminalemulator.InterpDumb.processChar(InterpDumb.java:248)
at com.common.terminal.impl.InterpVt100.processChar(InterpVt100.java:437)
at com.common.terminal.impl.InterpXterm.processChar(InterpXterm.java:266)
at org.netbeans.lib.terminalemulator.Term.putc_work(Term.java:5043)
at org.netbeans.lib.terminalemulator.Term.access$5(Term.java:5042)
at org.netbeans.lib.terminalemulator.Term$BaseTermStream.putChars(Term.java:423)
at com.aquafold.datastudio.tools.shell.FluidTerminalLineDiscipline.putChars(FluidTerminalLineDiscipline.java:30)
at org.netbeans.lib.terminalemulator.Term.putChars(Term.java:3493)
at com.common.terminal.api.AbstractTerminalWrapper._scanServerResponseInLoop(AbstractTerminalWrapper.java:274)
at com.aquafold.datastudio.tools.shell.FluidTerminalWrapper.loop(FluidTerminalWrapper.java:87)
at com.aquafold.datastudio.tools.shell.FluidTerminalWrapper$1.run(FluidTerminalWrapper.java:54)