Closed Bug 343087 Opened 16 years ago Closed 15 years ago
multiple tfoot cellmap crash [@ ns
Cell Map::Get Cell Info At]
we access deleted memory the testcase "works" only with latest trunk
lithium is great :-)
Assignee: nobody → bernd_mozilla
Status: NEW → ASSIGNED
Summary: multiple tfoot cellmap crash → multiple tfoot cellmap crash [@ nsCellMap::GetCellInfoAt]
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.
I want some documentation about what the new args to this function mean. I can't even really review this without that documentation...
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. https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableFrame.cpp_sec1 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. https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableFrame.cpp_sec2 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. https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableFrame.cpp_sec3 https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableFrame.cpp_sec4 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. https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableFrame.cpp_sec5 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. https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableFrame.h_sec1 https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableFrame.h_sec2 document the routines and the args https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableRowGroupFrame.cpp_sec1 https://bugzilla.mozilla.org/attachment.cgi?id=231597&action=diff#mozilla/layout/tables/nsTableRowGroupFrame.h_sec1 shift the routine where it belongs
Comment on attachment 231597 [details] [diff] [review] revised patch r+sr=bzbarsky. Thanks for the explanation; that made this much happier!
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 15 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.
v.fixed on both branches, no crash with testcase. Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:184.108.40.206) Gecko/20060906 Firefox/220.127.116.11 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 18.104.22.168 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 22.214.171.124 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 126.96.36.199. Please re-nominate if I'm missing something
crash test landed http://hg.mozilla.org/mozilla-central/rev/34a34a0b550e
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.