Skip to content

Access traces are not finalized #28

Description

@hwalinga

Normally in flexfringe, when a trace is created, it is finalized with a sentinel tail. This is a tail with symbol -1. The trace olds an end_tail member that points to this tail.

To finalize a trace, trace::finalize must be called. However, this does not happen when input_data::access_trace is called. This might be a bug. It at least give rise to a potentially dangerous memory-corrupting function I found in Robert's branch: trace::get_input_sequence. (You need to give it correct flags for the kind of trace it is called on. Robert calls it performance oriented, I think it is a potential footgun.)

Nevertheless, better would be to be consistent. Sicco thinks all traces should be properly finalized. (Does not like nullptr.) This is good, but is easily forgotten. Finalizing with a nullptr is always done. On the other hand. Finalizing with a end_tail reference (with or without symbol -1) gives you the flexibility to reuse existing traces. (Every node is created from an existing input trace. If you want the access trace of that node, you only have to create a new trace that reuses the tails from the input trace and set a start tail and end tail.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions