Skip to content

clear[] after loadData crashes since #182: the propagative layer is freed twice #205

Closed

Description

@yanissrairi

@HugoFara, since #182, ~FireDomain deletes propagativeLayer. After loadData, the DataBroker also registers that layer (registerLayer(domain->getPropagativeLayer()->getKey(), ...), DataBroker.cpp:1397), and ~DataBroker deletes every registered layer, so clear[] frees it twice.

From tests/runff, this segfaults on dev (3eb20d5) and passes on 9e06ade, just before #182:

include[params.ff]
loadData[data.nc;2025-02-10T17:35:54Z]
startFire[loc=(35881.873264425,28699.674854985,0);t=0]
goTo[t=60]
clear[]

ASan: heap-use-after-free at FireDomain.cpp:340, freed by ~PropagativeLayer ← ~DataBroker ← ~FireDomain. tests/runff/run.bash fails on rungeojson.ff for the same reason (it passes on 9e06ade). CI runs ff-run.bash, whose two cases (real_case.ff, reload_case.ff) have no clear[], so it stays green.

With addLayer("propagation", ...) (pyforefire) the layer is never registered and ~FireDomain is its only owner, so the delete is needed there. Either loadData should register the layer for lookup without handing it to the broker, or ~DataBroker should skip it.

Activity

  1. HugoFara commented on Oct 22, 2026

    @HugoFara
    Collaborator

    Thanks for signalling @yanissrairi , I opened #206 to fix the issue

  2. added a commit that references this issue on Oct 22, 2026
    db9a619
  3. HugoFara commented on Oct 22, 2026

    @HugoFara
    Collaborator

    Merged, thanks @filippi !

  4. added a commit that references this issue on Oct 28, 2026
    4019a4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed incorrect behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions