Closed Bug 343087 Opened 18 years ago Closed 18 years ago

multiple tfoot cellmap crash [@ nsCellMap::GetCellInfoAt]


(Core :: Layout: Tables, defect)

Windows XP
Not set





(Reporter: bernd_mozilla, Assigned: bernd_mozilla)



(4 keywords, Whiteboard: [sg:critical])

Crash Data


(2 files, 1 obsolete file)

we access deleted memory the testcase "works" only with latest trunk
Attached file testcase
lithium is great :-)
Assignee: nobody → bernd_mozilla
Keywords: crash
Summary: multiple tfoot cellmap crash → multiple tfoot cellmap crash [@ nsCellMap::GetCellInfoAt]
Attached patch patch (obsolete) — Splinter Review
Boris, this another iteration over the patch in bug 339130, I will not promise that it is the last one but the crash frequency is dropping rapidly.
Attachment #228063 - Flags: superreview?(bzbarsky)
Attachment #228063 - Flags: review?(bzbarsky)
I want some documentation about what the new args to this function mean.  I can't even really review this without that documentation...
Attached patch revised patchSplinter Review
Attachment #228063 - Attachment is obsolete: true
Attachment #231597 - Flags: superreview?(bzbarsky)
Attachment #231597 - Flags: review?(bzbarsky)
Attachment #228063 - Flags: superreview?(bzbarsky)
Attachment #228063 - Flags: review?(bzbarsky)
The problem is  that a table can have only one footer all other tfoot tags are treated as tbodies. If you remove one tfoot one the previuosly treated as tbody tfoot tags becomes a really footer. This changes its place in the frame list. Every row has a row index which shows its place in the table. If the above described change happens the rowindices become wrong. They need to be reset. This is what ResetRowIndices does. However if we insert a new tfoot tag then we need to find the new rowindices for the insert. When we determine the position of the rows we need the correct order of the rowgroups (OrderRowGroups) the new tfoot will be already in the list of rowgroups but the reset should be done only on the previuosly existing rowgroups. Then we will find the correct startindex and adjust all following rowgroups and their rows.
 moves the AdjustRowIndices to the rowgroup where it belongs and makes the return value void.

Further it add two args to  ResetRowIndices that are the frames that should be omitted from the reset as they will be inserted later.

Is similiar to the thing that we have done at bug 343778, if we add a cell to the cellmap it is possible that the number of columns shrinks.

Does what has been described in the intro, we need to reset the rowindices earlier than I previously thought just before we insert the new data into the cellmap. So we split the routine and insert the ResetRowIndices together with a cellmap sync.

In order to get the column information right we need to have the correct cellmap information before. As this pretty difficult to get correctly we nuke the cellmap and build it new.

document the routines and the args

shift the routine where it belongs

Blocks: 346980
Comment on attachment 231597 [details] [diff] [review]
revised patch

r+sr=bzbarsky.  Thanks for the explanation; that made this much happier!
Attachment #231597 - Flags: superreview?(bzbarsky)
Attachment #231597 - Flags: superreview+
Attachment #231597 - Flags: review?(bzbarsky)
Attachment #231597 - Flags: review+
fix checked in
Closed: 18 years ago
Resolution: --- → FIXED
By the way, do we need anything like this for thead?
thead/tfoot are handled similiar when they appear multiple times. So my language is not very precise in this bug but I believe what I did here helps also with multiple theads
Ah, ok.  Most excellent. 
Blocks: 347796
No longer blocks: 347796
Depends on: 347796
Depends on: 347725
Flags: blocking1.8.0.8?
Whiteboard: [sg:critical]
fixed on branches by the cellmap branch patch
v.fixed on both branches, no crash with testcase.
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv: Gecko/20060906 Firefox/
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1b2) Gecko/20060907 BonEcho/2.0b2

However, I also do not crash with or 2.0b1, so will leave it to Bernd to explain why that might be. I think he mentioned the crash depended on other bugs/patches...
The blocking nomination got lost in a bugzilla accident, but I think it was left over from when it looked like the cellmap fixes weren't going to make Please re-nominate if I'm missing something
Flags: blocking1.8.0.7+
Group: security
Flags: in-testsuite?
crash test landed
Flags: in-testsuite? → in-testsuite+
Crash Signature: [@ nsCellMap::GetCellInfoAt]
You need to log in before you can comment on or make changes to this bug.