[undertow-dev] Deadlock in JSP page on Wilflfy 8.0 Alpha 4 with umlauts

Bill Burke bburke at redhat.com
Thu Aug 29 09:38:23 EDT 2013


I think I remember seeing other containers just writing the unmappable 
characters directly to output, but my memory is usually foggy.

On 8/29/2013 5:00 AM, Stuart Douglas wrote:
> This should be fixed in Undertow upstream. The writer will now error out properly on unmappable characters. You will need to set a response charset of UTF8 (or some other appropriate charset) in order for this to work correctly.
>
> The only thing I am not sure about is if this should be a fatal error, or if we should just write the unmappable characters directly to the output.
>
> Stuart
>
> ----- Original Message -----
>> From: "Stuart Douglas" <sdouglas at redhat.com>
>> To: "Wolfgang Knauf" <wolfgang.knauf at gmx.de>
>> Cc: undertow-dev at lists.jboss.org
>> Sent: Wednesday, 28 August, 2013 10:33:35 PM
>> Subject: Re: [undertow-dev] Deadlock in JSP page on Wilflfy 8.0 Alpha 4	with	umlauts
>>
>> Thanks for reporting this, I will look into it.
>>
>> Stuart
>>
>> ----- Original Message -----
>>> From: "Wolfgang Knauf" <wolfgang.knauf at gmx.de>
>>> To: undertow-dev at lists.jboss.org
>>> Sent: Wednesday, 28 August, 2013 10:28:24 PM
>>> Subject: [undertow-dev] Deadlock in JSP page on Wilflfy 8.0 Alpha 4 with
>>> 	umlauts
>>>
>>> Hi all,
>>>
>>> hope this is the right place and the correct component to post a
>>> possible Undertow bug:
>>> I have a simple EAR application, used to test the JavaEE feature of a
>>> one-to-many-relationship. It contains an EJB jar and a WAR file, bundled
>>> in an EAR file.
>>>
>>> Whenever I add an umlaut in an input field and submit the form, WildFly
>>> hangs up while processing the request to display the result page (which
>>> should display a list of my entities). As this happens when generating
>>> the JSP page, I assume an Undertow issue.
>>>
>>> To reproduce:
>>> 1) deploy "KuchenZutat.ear" to WildFly (it uses the
>>> "java:jboss/datasources/ExampleDS", so no configuration changes needed).
>>> 2) browse to "http://localhost:8080/KuchenZutatWeb/"
>>> 3) Klick "Neu"
>>> 4) enter something with an umlaut, e.g. "Käsekuchen"
>>> 5) click OK
>>> Now the server hangs.
>>>
>>> It works when avoiding umlauts.
>>>
>>> Here are two stack traces, which I took by debugging the server with
>>> Eclipse and breaking into debugger at random times. Note that the thread
>>> name is different in the two stack traces - I took them at different
>>> server runs.
>>> "CoderResult.unmappableForLength()" seems to be the place for the
>>> endless loop.
>>>
>>>
>>> Thread [default task-3] (Suspended)
>>> 	owns: CoderResult$2  (id=285)
>>> 	HashMap<K,V>.hash(Object) line: not available
>>> 	HashMap<K,V>.getEntry(Object) line: not available
>>> 	HashMap<K,V>.get(Object) line: not available
>>> 	CoderResult$2(CoderResult$Cache).get(int) line: not available
>>> 	CoderResult$Cache.access$200(CoderResult$Cache, int) line: not available
>>> 	CoderResult.unmappableForLength(int) line: not available
>>> 	Surrogate$Parser.unmappableResult() line: not available
>>> 	ISO_8859_1$Encoder.encodeBufferLoop(CharBuffer, ByteBuffer) line: not
>>> available
>>> 	ISO_8859_1$Encoder.encodeLoop(CharBuffer, ByteBuffer) line: not available
>>> 	ISO_8859_1$Encoder(CharsetEncoder).encode(CharBuffer, ByteBuffer,
>>> boolean) line: not available
>>> 	ServletPrintWriter.write(CharBuffer) line: 58
>>> 	ServletPrintWriter.write(char[], int, int) line: 76
>>> 	ServletPrintWriterDelegate.write(char[], int, int) line: 96
>>> 	JspWriterImpl.flushBuffer() line: 120
>>> 	PageContextImpl.release() line: 188
>>> 	JspFactoryImpl.internalReleasePageContext(PageContext) line: 115
>>> 	JspFactoryImpl.releasePageContext(PageContext) line: 74
>>> 	index.jsp line: not available
>>> 	index_jsp(HttpJspBase).service(HttpServletRequest, HttpServletResponse)
>>> line: 69
>>> 	index_jsp(HttpServlet).service(ServletRequest, ServletResponse) line: 790
>>> 	JspServletWrapper.service(HttpServletRequest, HttpServletResponse,
>>> boolean) line: 365
>>> 	JspServlet.serviceJspFile(HttpServletRequest, HttpServletResponse,
>>> String, Throwable, boolean) line: 321
>>> 	JspServlet.service(HttpServletRequest, HttpServletResponse) line: 254
>>> 	JspServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 790
>>> 	ServletHandler.handleRequest(HttpServerExchange) line: 87
>>> 	FilterHandler.handleRequest(HttpServerExchange) line: 82
>>> 	ServletSecurityRoleHandler.handleRequest(HttpServerExchange) line: 54
>>> 	ServletDispatchingHandler.handleRequest(HttpServerExchange) line: 36
>>> 	SecurityContextAssociationHandler.handleRequest(HttpServerExchange)
>>> line: 78
>>> 	PredicateHandler.handleRequest(HttpServerExchange) line: 25
>>> 	PredicateHandler.handleRequest(HttpServerExchange) line: 25
>>> 	ServletInitialHandler.dispatchRequest(HttpServerExchange,
>>> ServletRequestContext, ServletChain, DispatcherType) line: 196
>>> 	ServletInitialHandler.dispatchToPath(HttpServerExchange,
>>> ServletPathMatch, DispatcherType) line: 139
>>> 	RequestDispatcherImpl.forward(ServletRequest, ServletResponse) line: 156
>>> 	KuchenEdit.jsp line: 40
>>> 	KuchenEdit_jsp(HttpJspBase).service(HttpServletRequest,
>>> HttpServletResponse) line: 69
>>> 	KuchenEdit_jsp(HttpServlet).service(ServletRequest, ServletResponse)
>>> line: 790
>>> 	JspServletWrapper.service(HttpServletRequest, HttpServletResponse,
>>> boolean) line: 365
>>> 	JspServlet.serviceJspFile(HttpServletRequest, HttpServletResponse,
>>> String, Throwable, boolean) line: 321
>>> 	JspServlet.service(HttpServletRequest, HttpServletResponse) line: 254
>>> 	JspServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 790
>>> 	ServletHandler.handleRequest(HttpServerExchange) line: 87
>>> 	FilterHandler$FilterChainImpl.doFilter(ServletRequest, ServletResponse)
>>> line: 130
>>> 	JsrWebSocketFilter.doFilter(ServletRequest, ServletResponse,
>>> FilterChain) line: 136
>>> 	ManagedFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
>>> line: 56
>>> 	FilterHandler$FilterChainImpl.doFilter(ServletRequest, ServletResponse)
>>> line: 132
>>> 	JsrWebSocketFilter.doFilter(ServletRequest, ServletResponse,
>>> FilterChain) line: 136
>>> 	ManagedFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
>>> line: 56
>>> 	FilterHandler$FilterChainImpl.doFilter(ServletRequest, ServletResponse)
>>> line: 132
>>> 	FilterHandler.handleRequest(HttpServerExchange) line: 85
>>> 	ServletSecurityRoleHandler.handleRequest(HttpServerExchange) line: 56
>>> 	ServletDispatchingHandler.handleRequest(HttpServerExchange) line: 36
>>> 	SecurityContextAssociationHandler.handleRequest(HttpServerExchange)
>>> line: 78
>>> 	SSLInformationAssociationHandler.handleRequest(HttpServerExchange)
>>> line: 113
>>> 	AuthenticationCallHandler.handleRequest(HttpServerExchange) line: 52
>>> 	ServletConfidentialityConstraintHandler(AbstractConfidentialityHandler).handleRequest(HttpServerExchange)
>>> 	line: 45
>>> 	CachedAuthenticatedSessionHandler.handleRequest(HttpServerExchange)
>>> line: 65
>>> 	SecurityInitialHandler.handleRequest(HttpServerExchange) line: 70
>>> 	PredicateHandler.handleRequest(HttpServerExchange) line: 25
>>> 	SecurityContextCreationHandler.handleRequest(HttpServerExchange) line: 54
>>> 	PredicateHandler.handleRequest(HttpServerExchange) line: 25
>>> 	ServletInitialHandler.handleFirstRequest(HttpServerExchange,
>>> ServletChain, ServletRequestContext, ServletRequest, ServletResponse)
>>> line: 207
>>> 	ServletInitialHandler.dispatchRequest(HttpServerExchange,
>>> ServletRequestContext, ServletChain, DispatcherType) line: 194
>>> 	ServletInitialHandler.access$000(ServletInitialHandler,
>>> HttpServerExchange, ServletRequestContext, ServletChain, DispatcherType)
>>> line: 72
>>> 	ServletInitialHandler$1.handleRequest(HttpServerExchange) line: 128
>>> 	HttpHandlers.executeRootHandler(HttpHandler, HttpServerExchange,
>>> boolean) line: 36
>>> 	HttpServerExchange$1.run() line: 628
>>> 	XnioWorker$TaskPool(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker)
>>> 	line: not available
>>> 	ThreadPoolExecutor$Worker.run() line: not available
>>> 	Thread.run() line: not available
>>>
>>>
>>>
>>>
>>>
>>>
>>> Thread [default task-8] (Suspended)
>>> 	CoderResult$Cache.access$200(CoderResult$Cache, int) line: not available
>>> 	CoderResult.unmappableForLength(int) line: not available
>>> 	Surrogate$Parser.unmappableResult() line: not available
>>> 	ISO_8859_1$Encoder.encodeBufferLoop(CharBuffer, ByteBuffer) line: not
>>> available
>>> 	ISO_8859_1$Encoder.encodeLoop(CharBuffer, ByteBuffer) line: not available
>>> 	ISO_8859_1$Encoder(CharsetEncoder).encode(CharBuffer, ByteBuffer,
>>> boolean) line: not available
>>> 	ServletPrintWriter.write(CharBuffer) line: 58
>>> 	ServletPrintWriter.write(char[], int, int) line: 76
>>> 	ServletPrintWriterDelegate.write(char[], int, int) line: 96
>>> 	JspWriterImpl.flushBuffer() line: 120
>>> 	PageContextImpl.release() line: 188
>>> 	JspFactoryImpl.internalReleasePageContext(PageContext) line: 115
>>> 	JspFactoryImpl.releasePageContext(PageContext) line: 74
>>> 	Kuchen.jsp line: not available
>>> 	Kuchen_jsp(HttpJspBase).service(HttpServletRequest,
>>> HttpServletResponse) line: 69
>>> 	Kuchen_jsp(HttpServlet).service(ServletRequest, ServletResponse) line: 790
>>> 	JspServletWrapper.service(HttpServletRequest, HttpServletResponse,
>>> boolean) line: 365
>>> 	JspServlet.serviceJspFile(HttpServletRequest, HttpServletResponse,
>>> String, Throwable, boolean) line: 321
>>> 	JspServlet.service(HttpServletRequest, HttpServletResponse) line: 254
>>> 	JspServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 790
>>> 	ServletHandler.handleRequest(HttpServerExchange) line: 87
>>> 	FilterHandler.handleRequest(HttpServerExchange) line: 82
>>> 	ServletSecurityRoleHandler.handleRequest(HttpServerExchange) line: 54
>>> 	ServletDispatchingHandler.handleRequest(HttpServerExchange) line: 36
>>> 	SecurityContextAssociationHandler.handleRequest(HttpServerExchange)
>>> line: 78
>>> 	PredicateHandler.handleRequest(HttpServerExchange) line: 25
>>> 	PredicateHandler.handleRequest(HttpServerExchange) line: 25
>>> 	ServletInitialHandler.dispatchRequest(HttpServerExchange,
>>> ServletRequestContext, ServletChain, DispatcherType) line: 196
>>> 	ServletInitialHandler.dispatchToPath(HttpServerExchange,
>>> ServletPathMatch, DispatcherType) line: 139
>>> 	RequestDispatcherImpl.forward(ServletRequest, ServletResponse) line: 156
>>> 	KuchenEdit.jsp line: 43
>>> 	KuchenEdit_jsp(HttpJspBase).service(HttpServletRequest,
>>> HttpServletResponse) line: 69
>>> 	KuchenEdit_jsp(HttpServlet).service(ServletRequest, ServletResponse)
>>> line: 790
>>> 	JspServletWrapper.service(HttpServletRequest, HttpServletResponse,
>>> boolean) line: 365
>>> 	JspServlet.serviceJspFile(HttpServletRequest, HttpServletResponse,
>>> String, Throwable, boolean) line: 321
>>> 	JspServlet.service(HttpServletRequest, HttpServletResponse) line: 254
>>> 	JspServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 790
>>> 	ServletHandler.handleRequest(HttpServerExchange) line: 87
>>> 	FilterHandler$FilterChainImpl.doFilter(ServletRequest, ServletResponse)
>>> line: 130
>>> 	JsrWebSocketFilter.doFilter(ServletRequest, ServletResponse,
>>> FilterChain) line: 136
>>> 	ManagedFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
>>> line: 56
>>> 	FilterHandler$FilterChainImpl.doFilter(ServletRequest, ServletResponse)
>>> line: 132
>>> 	JsrWebSocketFilter.doFilter(ServletRequest, ServletResponse,
>>> FilterChain) line: 136
>>> 	ManagedFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
>>> line: 56
>>> 	FilterHandler$FilterChainImpl.doFilter(ServletRequest, ServletResponse)
>>> line: 132
>>> 	FilterHandler.handleRequest(HttpServerExchange) line: 85
>>> 	ServletSecurityRoleHandler.handleRequest(HttpServerExchange) line: 56
>>> 	ServletDispatchingHandler.handleRequest(HttpServerExchange) line: 36
>>> 	SecurityContextAssociationHandler.handleRequest(HttpServerExchange)
>>> line: 78
>>> 	SSLInformationAssociationHandler.handleRequest(HttpServerExchange)
>>> line: 113
>>> 	AuthenticationCallHandler.handleRequest(HttpServerExchange) line: 52
>>> 	ServletConfidentialityConstraintHandler(AbstractConfidentialityHandler).handleRequest(HttpServerExchange)
>>> 	line: 45
>>> 	CachedAuthenticatedSessionHandler.handleRequest(HttpServerExchange)
>>> line: 65
>>> 	SecurityInitialHandler.handleRequest(HttpServerExchange) line: 70
>>> 	PredicateHandler.handleRequest(HttpServerExchange) line: 25
>>> 	SecurityContextCreationHandler.handleRequest(HttpServerExchange) line: 54
>>> 	PredicateHandler.handleRequest(HttpServerExchange) line: 25
>>> 	ServletInitialHandler.handleFirstRequest(HttpServerExchange,
>>> ServletChain, ServletRequestContext, ServletRequest, ServletResponse)
>>> line: 207
>>> 	ServletInitialHandler.dispatchRequest(HttpServerExchange,
>>> ServletRequestContext, ServletChain, DispatcherType) line: 194
>>> 	ServletInitialHandler.access$000(ServletInitialHandler,
>>> HttpServerExchange, ServletRequestContext, ServletChain, DispatcherType)
>>> line: 72
>>> 	ServletInitialHandler$1.handleRequest(HttpServerExchange) line: 128
>>> 	HttpHandlers.executeRootHandler(HttpHandler, HttpServerExchange,
>>> boolean) line: 36
>>> 	HttpServerExchange$1.run() line: 628
>>> 	XnioWorker$TaskPool(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker)
>>> 	line: not available
>>> 	ThreadPoolExecutor$Worker.run() line: not available
>>> 	Thread.run() line: not available
>>>
>>>
>>> Best regards
>>>
>>> Wolfgang Knauf
>>>
>>> _______________________________________________
>>> undertow-dev mailing list
>>> undertow-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/undertow-dev
>>
>> _______________________________________________
>> undertow-dev mailing list
>> undertow-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/undertow-dev
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com


More information about the undertow-dev mailing list