Skip to content

Fix TU_DEBUG persistent mutation and EnvVars parsing crash - #1999

Open
gigachadmma69 wants to merge 1 commit into
brunodev85:mainfrom
gigachadmma69:fix/envvars-tudebug-mutation
Open

Fix TU_DEBUG persistent mutation and EnvVars parsing crash#1999
gigachadmma69 wants to merge 1 commit into
brunodev85:mainfrom
gigachadmma69:fix/envvars-tudebug-mutation

Conversation

@gigachadmma69

Copy link
Copy Markdown

Summary

  • Fix TU_DEBUG persistent mutation: On non-Adreno 6xx devices, the sysmem flag injection was calling container.setEnvVars() which permanently mutated the user's saved container configuration on every launch. The default TU_DEBUG=noconform would accumulate ,sysmem in the saved config. Now applies the sysmem flag to the runtime envVars object only, leaving the container's saved configuration untouched.

  • Fix EnvVars.putAll() crash: putAll(String) would throw StringIndexOutOfBoundsException when encountering malformed entries (trailing spaces, entries without =), since indexOf("=") returns -1 which causes substring(0, -1) to crash. Added a guard to skip entries where the = separator is missing or at position 0.

Test plan

  • Launch a container on a non-Adreno 6xx device, verify TU_DEBUG includes sysmem at runtime
  • Close and re-open the container settings, verify the saved TU_DEBUG value is still the user's original (e.g., noconform), not noconform,sysmem
  • Test with a container env var string containing trailing spaces — verify no crash

Two bugs fixed:

1. TU_DEBUG sysmem injection was writing back to container storage via
   container.setEnvVars(), permanently mutating the user's saved config
   on every launch for non-Adreno 6xx devices. The default "noconform"
   would accumulate ",sysmem" permanently. Now applies the sysmem flag
   to the runtime envVars only, leaving the container's saved config
   untouched.

2. EnvVars.putAll(String) would crash with StringIndexOutOfBoundsException
   on malformed entries (e.g. trailing spaces, entries without "=").
   Added a guard to skip entries where indexOf("=") returns <= 0.
Repository owner deleted a comment from ya8171808-hue Jul 28, 2026
Repository owner deleted a comment from ya8171808-hue Jul 28, 2026
Repository owner deleted a comment from ya8171808-hue Jul 28, 2026
Repository owner deleted a comment from ya8171808-hue Jul 28, 2026
Repository owner deleted a comment from ya8171808-hue Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant