karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Lichtin (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-2973) Writing to stderr results in a blocked thread
Date Sat, 10 May 2014 22:06:40 GMT
Martin Lichtin created KARAF-2973:
-------------------------------------

             Summary: Writing to stderr results in a blocked thread
                 Key: KARAF-2973
                 URL: https://issues.apache.org/jira/browse/KARAF-2973
             Project: Karaf
          Issue Type: Bug
    Affects Versions: 2.3.4
            Reporter: Martin Lichtin


An innocent-looking e.printStackTrace() resulted in a blocked thread.

{noformat}
"Camel (CamelContext) thread #0 - JmsConsumer[myname]" daemon prio=10 tid=0x00002aaab886d000
nid=0x3396 in Object.wait() [0x000000004963d000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000ce040a38> (a org.apache.sshd.common.channel.Window)
	at java.lang.Object.wait(Object.java:503)
	at org.apache.sshd.common.channel.Window.waitForSpace(Window.java:146)
	- locked <0x00000000ce040a38> (a org.apache.sshd.common.channel.Window)
	at org.apache.sshd.common.channel.ChannelOutputStream.flush(ChannelOutputStream.java:104)
	- locked <0x00000000cdfac4a0> (a org.apache.sshd.common.channel.ChannelOutputStream)
	at org.apache.sshd.common.channel.ChannelOutputStream.write(ChannelOutputStream.java:75)
	- locked <0x00000000cdfac4a0> (a org.apache.sshd.common.channel.ChannelOutputStream)
	at org.apache.sshd.common.channel.ChannelOutputStream.write(ChannelOutputStream.java:57)
	- locked <0x00000000cdfac4a0> (a org.apache.sshd.common.channel.ChannelOutputStream)
	at org.apache.karaf.shell.ssh.ShellFactoryImpl$LfToCrLfFilterOutputStream.write(ShellFactoryImpl.java:215)
	at java.io.FilterOutputStream.write(FilterOutputStream.java:125)
	at java.io.PrintStream.write(PrintStream.java:480)
	- locked <0x00000000ce500078> (a java.io.PrintStream)
	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
	at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:104)
	- locked <0x00000000ce5064c0> (a java.io.OutputStreamWriter)
	at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:185)
	at java.io.PrintStream.write(PrintStream.java:527)
	- locked <0x00000000ce500078> (a java.io.PrintStream)
	at java.io.PrintStream.print(PrintStream.java:669)
	at java.io.PrintStream.println(PrintStream.java:823)
	- locked <0x00000000ce500078> (a java.io.PrintStream)
	at org.apache.felix.gogo.runtime.threadio.ThreadPrintStream.println(ThreadPrintStream.java:205)
	at java.lang.Throwable$WrappedPrintStream.println(Throwable.java:747)
	at java.lang.Throwable.printStackTrace(Throwable.java:657)
	- locked <0x00000000cd8f9110> (a org.apache.felix.gogo.runtime.threadio.ThreadPrintStream)
	at java.lang.Throwable.printStackTrace(Throwable.java:642)
	at java.lang.Throwable.printStackTrace(Throwable.java:633)
...
{noformat}

What's weird is that it tries to write to a (probably no longer existing) SSH session.

Why does Felix intercept stderr writes from bundles. 

I'd expect printing a stack trace goes directly to fd 3 (which is redirected to data/karaf.out)
and is not affected by some temporary SSH console sessions.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message