Uh oh!
There was an error while loading. Please reload this page.
[3.14] gh-149018: Use XML_SetHashSalt16Bytes in pyexpat/_elementtree when possible (GH-149023) - #149646
Conversation
…lementtree` when possible (pythonGH-149023) (cherry picked from commit 24b8f12) Co-authored-by: Stan Ulbrych <stan@python.org>
StanFromIreland
commented
May 24, 2026
@picnixz I think I had it confused with this one, I think this one needs a review since I fixed conflicts ( |
picnixz
commented
May 24, 2026
Wait, SetBillionLaughsAttackProtectionMaximumAmplification isn't backported? Oh I think I totally forgot about it! |
| XML_Parser parser, unsigned long long activationThresholdBytes); | ||
| XML_Bool (*SetAllocTrackerMaximumAmplification)( | ||
| XML_Parser parser, float maxAmplificationFactor); | ||
| /* might be NULL for expat < 2.8.0 */ |
There was a problem hiding this comment.
ARF! Yes, I totally see now. Ok, we need first to backport the billion laugh stuff otherwise pointesrs will be shifted depending on the versions. Alternative: add a dummy pointer just to offset the structure and retain the layout. I honestly don't have time this w-e because of personal life matters so I couldn't do what I wanted to do now.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
StanFromIreland
commented
May 24, 2026
We're all forgetting backports it seems ;-) |
zpe-lucasc
commented
Jun 5, 2026
Hi! Is there any ETA for a backport to 3.10? |
hugovk
commented
Jun 9, 2026
#150496 has been backported, this now has a conflict and is awaiting review. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11, 3.12, 3.13. |
Sorry, @StanFromIreland, I could not cleanly backport this to |
Sorry, @StanFromIreland, I could not cleanly backport this to |
Sorry, @StanFromIreland, I could not cleanly backport this to |
Sorry, @StanFromIreland, I could not cleanly backport this to |
StanFromIreland
commented
Jun 9, 2026
3.13 and co. blocked by #151151. |
I'm seeing a crash in FreeCAD since I updated to 3.14.6 when I open the CAM workbench (and possibly in other places) and it seems to be related. This did not happen in 3.14.5: Here's gdb when it crashes: |
picnixz
commented
Jun 14, 2026
cc @hartwork |
hartwork
commented
Jun 14, 2026
@picnixz I'm not sure why the call to |
@picnixz@al20ov PS: when I fed these logs to AI for help it was hinting at the parser pointer being corrupted which could mean that libexpat is the explosion site but the cause is prior and outside. Maybe there is a chance to run this instrumented with e.g. AddressSanitizer to get closer to a cause of prior memory corruption. Just thinking aloud here. |
al20ov
commented
Jun 15, 2026
Sorry, I didn't know if this was the best place to report this but I couldn't find any similar issues and the combination of a recent CPython update then XML_SetHashSalt16Bytes and expat in the crash logs led me here. I'll try to run this with instrumentation tomorrow and report back if I find anything of value. |
al20ov
commented
Jun 15, 2026
I installed It's hard to read but the struct doesn't look so great. Some of these addresses look they were overwritten with strings? I'll try to run it with ASan next which means rebuilding FreeCAD with |
hartwork
commented
Jun 15, 2026
@al20ov thanks! Yes, but it needs to be passed to both the compiler and the linker. |
al20ov
commented
Jun 15, 2026
I can't reproduce the issue when compiled and linked with ASan...... (CFLAGS/CXXFLAGS+=" -fsanitize=address -fno-omit-frame-pointer" LDFLAGS+="-fsanitize=address" and libsanitizer-devel). |
LordGrimmauld
commented
Aug 1, 2026
Going by NixOS/nixpkgs#544607 (comment) (slop report, but the finding of the vendored expat in coin3d is valid), supposedly there is symbol collisions between expat used in python and expat vendored in coin3d. Maybe LTO or other linking details or such is messing with the reproducer with asan? I'd be interested in whether anyone can reproduce these issues with a coin built with |
(cherry picked from commit 24b8f12)
pyexpatwith protection against hash flooding #149018