Bug 1621274 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

This is a patch to print relevant values when the error occurs.

This is a dump of the relevant values when an assertion was triggered.
Simply invoking DEBUG version of C-C TB causes the assertion.
The value dump is done by local mod by this patch.

```
{debug}:ASSERTION aISizeType=2, BTLS_FINALSIZE=2
aISize=0, guess_min=13764, guess_pref=13764
[3934, Main Thread] ###!!! ASSERTION: Table inline-size is less than the sum of its columns' min inline-sizes: '!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 767
{debug}:ASSERTION
space=-13764, nscoord_MAX=1073741823
l2t=0, FLEX_PCT_LARGE=6
basis.c=0, nscoord_MAX=1073741823, basis.f=0.000000
[3934, Main Thread] ###!!! ASSERTION: didn't subtract all that we added: '(space == 0 || space == nscoord_MAX) && ((l2t == FLEX_PCT_LARGE) ? (-0.001f < basis.f && basis.f < 0.001f) : (basis.c == 0 || basis.c == nscoord_MAX))', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 1004
{debug}:ASSERTION aISizeType=2, BTLS_FINALSIZE=2
aISize=0, guess_min=13764, guess_pref=13764
[3934, Main Thread] ###!!! ASSERTION: Table inline-size is less than the sum of its columns' min inline-sizes: '!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 767
{debug}:ASSERTION
space=-13764, nscoord_MAX=1073741823
l2t=0, FLEX_PCT_LARGE=6
```

The line number got shifted a bit due to the dump statement.

Are we sure if the assert condition on the line
https://searchfox.org/comm-central/source/mozilla/layout/tables/BasicTableLayoutStrategy.cpp#758
correct?

I mean, the condition is negated in NS_ASSERTION(). Is it intended ?

```
if (aISize < guess_pref) {
    if (aISizeType != BTLS_FINAL_ISIZE && aISize <= guess_min) {
      // Return early -- we don't have any extra space to distribute.
      return;
    }
    NS_ASSERTION(!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min),   <===
                 "Table inline-size is less than the "
                 "sum of its columns' min inline-sizes");
    if (aISize < guess_min_pct) {
```

As for space=-13764, it certainly looks suspicious.
This is a patch to print relevant values when the error occurs.

This is a dump of the relevant values when an assertion was triggered.
Simply invoking DEBUG version of C-C TB causes the assertion.
The value dump is done by local mod by this patch.

```
{debug}:ASSERTION aISizeType=2, BTLS_FINALSIZE=2
aISize=0, guess_min=13764, guess_pref=13764
[3934, Main Thread] ###!!! ASSERTION: Table inline-size is less than the sum of its columns' min inline-sizes: '!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 767
{debug}:ASSERTION
space=-13764, nscoord_MAX=1073741823
l2t=0, FLEX_PCT_LARGE=6
basis.c=0, nscoord_MAX=1073741823, basis.f=0.000000
[3934, Main Thread] ###!!! ASSERTION: didn't subtract all that we added: '(space == 0 || space == nscoord_MAX) && ((l2t == FLEX_PCT_LARGE) ? (-0.001f < basis.f && basis.f < 0.001f) : (basis.c == 0 || basis.c == nscoord_MAX))', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 1004
{debug}:ASSERTION aISizeType=2, BTLS_FINALSIZE=2
aISize=0, guess_min=13764, guess_pref=13764
[3934, Main Thread] ###!!! ASSERTION: Table inline-size is less than the sum of its columns' min inline-sizes: '!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 767
{debug}:ASSERTION
space=-13764, nscoord_MAX=1073741823
l2t=0, FLEX_PCT_LARGE=6
```

The line number got shifted a bit due to the dump statement.

Are we sure if the assert condition on the line
https://searchfox.org/comm-central/source/mozilla/layout/tables/BasicTableLayoutStrategy.cpp#758
correct?

I mean, the condition is negated in NS_ASSERTION(). Is it intended ?

```
if (aISize < guess_pref) {
    if (aISizeType != BTLS_FINAL_ISIZE && aISize <= guess_min) {
      // Return early -- we don't have any extra space to distribute.
      return;
    }
    NS_ASSERTION(!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min),   <===
                 "Table inline-size is less than the "
                 "sum of its columns' min inline-sizes");
    if (aISize < guess_min_pct) {
```

As for the other dump, space=-13764  certainly looks suspicious.

```
space=-13764, nscoord_MAX=1073741823
l2t=0, FLEX_PCT_LARGE=6
basis.c=0, nscoord_MAX=1073741823, basis.f=0.000000
```
https://searchfox.org/comm-central/source/mozilla/layout/tables/BasicTableLayoutStrategy.cpp#983
```
  NS_ASSERTION(
      (space == 0 || space == nscoord_MAX) &&
          ((l2t == FLEX_PCT_LARGE) ? (-0.001f < basis.f && basis.f < 0.001f)
                                   : (basis.c == 0 || basis.c == nscoord_MAX)),
      "didn't subtract all that we added");
```

Back to Bug 1621274 Comment 3