Skip to content

[JENKINS-71139] XStream2 unable to round-trip ASCII NUL in stdout/stderr in junitResult.xml #18611

Description

@jenkins-infra-bot

It appears that the switch from KXml2Driver to StandardStaxDriver in JENKINS-69129 (included in 2.387.3-rc33338.349f385d65d2 as well as weeklies) broke the ability to round-trip ASCII NUL characters in text. Prior to the change, this character was written as � and (whether correct or not) read back successfully. After the change, it is still written the same way, but cannot be read.

Seems unlikely to affect many users, though it may affect the Jenkins project itself: for example

mvn -pl test surefire:test -Dtest=ExecutorTest#disconnectCause_WithoutTrace -Dmaven.test.redirectTestOutputToFile=true

causes TEST-hudson.model.ExecutorTest.xml to include

<===[JENKINS REMOTING CAPACITY]===>&#0;&#0;&#0;channel started

which looks to be bogus output from Surefire but which does not trigger a problem, whereas hudson.model.ExecutorTest-output.txt contains

<===[JENKINS REMOTING CAPACITY]===>^@^@^@​channel started

(with ^@ standing in for actual ASCII NUL for display). In case the NUL makes it into a stdout field in junitResult.xml, the symptom is that the junit step publishes test results normally (setting the build status, sending checks to GitHub, etc.) but if you visit the testReport/ display in the GUI, it claims there are no tests found (after printing a stack trace to the system log about a parse error). Other plugins looking up test results (such as parallel-test-executor) can also be affected.


Originally reported by jglick, imported from: XStream2 unable to round-trip ASCII NUL in stdout/stderr in junitResult.xml
  • assignee: jglick
  • status: Closed
  • priority: Critical
  • component(s): core
  • label(s): 2.387.3-rejected, 2.401.1-fixed, regression, xml, xstream
  • resolution: Fixed
  • resolved: 2023-04-26T12:20:17+00:00
  • votes: 0
  • watchers: 5
  • imported: 2025-11-24
Raw content of original issue

It appears that the switch from KXml2Driver to StandardStaxDriver in JENKINS-69129 (included in 2.387.3-rc33338.349f385d65d2 as well as weeklies) broke the ability to round-trip ASCII NUL characters in text. Prior to the change, this character was written as &#x0; and (whether correct or not) read back successfully. After the change, it is still written the same way, but cannot be read.

Seems unlikely to affect many users, though it may affect the Jenkins project itself: for example

mvn -pl test surefire:test -Dtest=ExecutorTest#disconnectCause_WithoutTrace -Dmaven.test.redirectTestOutputToFile=true

causes TEST-hudson.model.ExecutorTest.xml to include

<===[JENKINS REMOTING CAPACITY]===>&amp#0;&amp#0;&amp#0;channel started

which looks to be bogus output from Surefire but which does not trigger a problem, whereas hudson.model.ExecutorTest-output.txt contains

<===[JENKINS REMOTING CAPACITY]===>^@^@^@channel started

(with ^@ standing in for actual ASCII NUL for display). In case the NUL makes it into a stdout field in junitResult.xml, the symptom is that the junit step publishes test results normally (setting the build status, sending checks to GitHub, etc.) but if you visit the testReport/ display in the GUI, it claims there are no tests found (after printing a stack trace to the system log about a parse error). Other plugins looking up test results (such as parallel-test-executor) can also be affected.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions