Page MenuHomePhabricator

Fully fix a bad rule object aliasing issue custom remarkup rules
ClosedPublic

Authored by epriestley on Mar 28 2016, 5:24 PM.
Tags
None
Referenced Files
F19304498: D15535.diff
Wed, Dec 24, 12:02 PM
F18931852: D15535.diff
Nov 10 2025, 3:42 AM
F18824605: D15535.id37458.diff
Oct 23 2025, 4:45 PM
F18749370: D15535.id.diff
Oct 4 2025, 3:35 AM
F18737321: D15535.id37451.diff
Oct 1 2025, 10:07 AM
F18507385: D15535.id.diff
Sep 5 2025, 2:10 AM
F17993880: D15535.id.diff
Aug 2 2025, 2:50 AM
F17993876: D15535.id37458.diff
Aug 2 2025, 2:50 AM

Details

Summary

Fixes T10234. This is a more thorough fix.

Root issue is that some time around D13589, we started hitting an object cache for loadCustomInlineRules(), but didn't adjust the code to account for that.

So if a page created multiple similar engines, we'd return the same $rule object for multiple engines, call setEngine() on it with different engines, and then possibly try to render using an already-expired engine the second time through.

Instead, create a separate $rule object for each separate $engine.

Test Plan

Repro is something like this:

  • Create a custominlinerule which uses an engine.
  • Purge the remarkup cache.
  • Load a page which uses the rule in two engines (e.g., in a revision description, and also in an inline comment).
  • Before change: second one could fatal. After change: clean load.

Diff Detail

Repository
rP Phabricator
Branch
remarkupx
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 11316
Build 14075: Run Core Tests
Build 14074: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Fully fix a bad rule object aliasing issue custom remarkup rules.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
thoughtpolice added a reviewer: thoughtpolice.
thoughtpolice added subscribers: eadler, thoughtpolice.

I've confirmed this fixed our instance of T10234 on phabricator.haskell.org

(/cc @eadler, who may want to note this for Wikimedia?)

I've confirmed this fixed our instance of T10234 on phabricator.haskell.org

(/cc @eadler, who may want to note this for Wikimedia?)

I deal with FreeBSD, my employers, and a few other small instances, but appreciate the CC nonetheless.

chad edited edge metadata.

¯\_(ツ)_/¯

This revision is now accepted and ready to land.Mar 28 2016, 6:20 PM
This revision was automatically updated to reflect the committed changes.