ramanathan1504 commented on PR #51719: URL: https://github.com/apache/spark/pull/51719#issuecomment-4680817205
### **Subject: Upstream Fix for Log4j Stack Trace Rendering Crashes (AIOOBE/NPE)** Hi @pan3793 , I am a committer for **Apache Log4j**. I noticed this PR implements a workaround for stack trace rendering crashes (AIOOBE/NPE) that occur when using Log4j 2.x. I wanted to inform you that we have just merged a definitive fix for the root cause of these crashes into our **`2.x`** branch. This work resolves [LOG4J2-3933](https://github.com/apache/logging-log4j2/issues/3933) and [LOG4J2-4143](https://github.com/apache/logging-log4j2/issues/4143). #### **The Technical Fix** Previously, the Log4j renderer used a standard `HashMap` to cache exception metadata, which was vulnerable to "identity malfunctions": * **ArrayIndexOutOfBoundsException:** Caused by custom `equals()` collisions in exception chains. * **NullPointerException:** Caused by mutating `hashCode()` values (highly common in Scala, Spark, and distributed environments). We have migrated the internal metadata caching to an **`IdentityHashMap`**. By relying strictly on object identity (`==`), the renderer is now fully resilient to custom equality logic and unstable hash codes. #### **Status & Availability** * **Merge Commit:** https://github.com/apache/logging-log4j2/commit/019a92865a9bcfcceb2e56a21ae9356eedc736eb * **Target Release:** Log4j **2.27.0** * **Branch:** Currently available in the Log4j **`2.x`** branch. **Invitation to Verify:** We invite you to verify this fix against the current Log4j **`2.x`** branch within your project's test suite. Your confirmation helps us ensure that the transition to identity-based rendering covers your specific edge cases before the official release. Once your project upgrades to Log4j 2.27.0+, you should be able to safely revert the local workarounds implemented here. Thank you for your patience while we resolved this upstream! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
