On 8/17/26 1:59 PM, Dumitru Ceara wrote:
> 
> The leak happened when resetting index fields.  This really makes me
> wonder if we shouldn't harden the IDL index implementation to allow
> users to actually reset fields instead of having to use a completely new
> filter.
> 
> It's not really obvious from the API I guess.  CC-ing Ilya for his
> thoughts too on this matter.

Feels like there is a bug in this code:

void
ovsdb_idl_index_write(struct ovsdb_idl_row *const_row,
                       const struct ovsdb_idl_column *column,
                       struct ovsdb_datum *datum,
                       const struct ovsdb_idl_table_class *class)
{
    struct ovsdb_idl_row *row = CONST_CAST(struct ovsdb_idl_row *, const_row);
    size_t column_idx = column - class->columns;

    if (bitmap_is_set(row->written, column_idx)) {
        free(row->new_datum[column_idx].values);
        free(row->new_datum[column_idx].keys);
    } else {
        bitmap_set1(row->written, column_idx);
     }
    row->new_datum[column_idx] = *datum;
    (column->unparse)(row);
    (column->parse)(row, &row->new_datum[column_idx]);
}

The bitmap_set1() should probably be unconditional.  But I didn't look
in too deep.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to