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

Stuart Douglas sdouglas at redhat.com
Thu Aug 29 09:05:37 EDT 2013


Ok, fixed for real this time. The form parser was defaulting to UTF-8 when no charset was present in the request.

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: Thursday, 29 August, 2013 2:39:35 PM
> Subject: Re: [undertow-dev] Deadlock in JSP page on Wilflfy 8.0 Alpha	4	with umlauts
> 
> 
> 
> ----- Original Message -----
> > From: "Wolfgang Knauf" <wolfgang.knauf at gmx.de>
> > To: "Stuart Douglas" <sdouglas at redhat.com>
> > Cc: undertow-dev at lists.jboss.org
> > Sent: Thursday, 29 August, 2013 2:30:20 PM
> > Subject: Aw: Re: [undertow-dev] Deadlock in JSP page on Wilflfy 8.0 Alpha	4
> > 	with umlauts
> > 
> > Hi Stuart,
> > thanks for the fast fix! The question mark is probably some kind of
> > standard
> > for non displayable strings ;-). Maybe also a log message, to trace down
> > the
> > error better?
> > Any chance for me to test this against WildFly 8 Alpha 4 (without building
> > it
> > myself)?
> 
> Unfortunatly not yet. Once I release Undertow (probably next week) it will be
> possible to get a nightly build.
> 
> > I assume that on my JSP page which handles the request, I have to do
> > something like this:
> > request.setCharacterEncoding ("ISO-8859-1");
> 
> This is the default character set. Hmm, I need to investigate what is going
> on here, this is just using the standard charset encoder for ISO-8859-1, so
> I am not sure why it is reporting those characters as unmappable.
> 
> Stuart
> 
> > This should hopefully write the correct characters to the database. I will
> > do
> > more testing this evening.
> > On previous JBoss versions, my sample worked without those modifications.
> > Did
> > the Undertow migration include some change to character encoding handling?
> 
> Hmm, I will need to investigate this, and see how this was handled in
> previous versions.
> 
> > If yes this might be an issue with backwards compatibility.
> > Best regards
> > Wolfgang
> > Gesendet: Donnerstag, 29. August 2013 um 11:16 Uhr
> > Von: "Stuart Douglas" <sdouglas at redhat.com>
> > An: "Wolfgang Knauf" <wolfgang.knauf at gmx.de>
> > Cc: undertow-dev at lists.jboss.org
> > Betreff: Re: [undertow-dev] Deadlock in JSP page on Wilflfy 8.0 Alpha 4
> > with
> > umlauts
> > I have thought about this a bit, and changed it so now it just writes a
> > question mark on unmappable characters.
> > 
> > It seems that this would be the most user friendly behaviour.
> > 
> > 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: Thursday, 29 August, 2013 11:00:14 AM
> > > Subject: Re: [undertow-dev] Deadlock in JSP page on Wilflfy 8.0 Alpha 4
> > > with umlauts
> > > 
> > > 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
> >
> 
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev



More information about the undertow-dev mailing list