GNOME Bugzilla – Bug 786267
Arbitrary errors "switching encoding : no input " generated by various functions
Last modified: 2017-08-21 12:26:07 UTC
Created attachment 357537 [details] [review] Regression diffs generated by PostgreSQL When running the regression tests of PostgreSQL with libxml2, I am getting many errors using the latest git master, like the following which invokes xmlCtxtReadDoc() using the XML parser, which creates additional error messages on top of the original ones of the stack: ! DETAIL: line 1: switching encoding : no input I have originally seen the error using ArchLinux package 2.9.4+96+gfb56f80e-1 which is based on commit fb56f80e of upstream libxml2, and the errors get away by using 2.9.4+4+g3169602-1, which is based on 3169602. Bisecting manually this issue, I have found that the culprit commit is that one: commit 46dc989080d5d6b7854de8fb3cb3de55ecbf0621 Author: Nick Wellnhofer <wellnhofer@aevum.de> Date: Thu Jun 8 02:24:56 2017 +0200 Don't switch encoding for internal parameter entities This is only needed for external entities. Trying to switch the encoding for internal entities could also cause a memory leak in recovery mode. I don't know much libxml2 code to draw a conclusion by myself, so input would be welcome.
I guess this is caused by the second part of my commit. Can you try to revert only the change to parserInternals.c and see if it helps?
Created attachment 357669 [details] [review] Fix regression of libxml2 error stack.
(In reply to Nick Wellnhofer from comment #1) > I guess this is caused by the second part of my commit. Can you try to > revert only the change to parserInternals.c and see if it helps? If I use the patch of comment #2 the regression goes away.
Fixed with https://git.gnome.org/browse/libxml2/commit/?id=3aca7f31cb9901dc3af449e08dda647898bfc1fe
(In reply to Nick Wellnhofer from comment #4) > Fixed with > https://git.gnome.org/browse/libxml2/commit/ > ?id=3aca7f31cb9901dc3af449e08dda647898bfc1fe Thanks for pushing a fix.