Open Bug 2071071 Opened 2 months ago Updated 2 months ago

Consider enabling XML_LARGE_SIZE

Categories

(Core :: XML, enhancement)

enhancement

Tracking

()

People

(Reporter: mccr8, Unassigned)

References

Details

Attachments

(1 external file)

Expat 2.8.3 (which we'll upgrade to in bug 2062690) changes some internal calculations to use 64-bit values to avoid overflows. However, the values being passed out through the API can get squished back down to 32-bit values because they don't want to break ABI. We can get the more precise values by enabling XML_LARGE_SIZE.

I think Claude says this change could avoid turning a graceful YSOD into a crash:

In 2.8.2, if (len > XML_INDEX_MAX - m_parseEndByteIndex) with XML_INDEX_MAX == LONG_MAX == 2^31-1 made expat return XML_STATUS_ERROR / XML_ERROR_NO_MEMORY at ~2 GiB — a graceful parse error and a YSOD. In 2.8.3 that check is against UINT64_MAX, so it never fires; instead the getter truncates to a negative XML_Index and we MOZ_CRASH. A graceful error became a controlled abort.

Although honestly I'd kind of prefer a crash given the pain it has been to track down YSOD issues...

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: