Skip to content

MTF copy and assignment  #243

Open
Open

Description

@fredRos

The memory management is broken here. There are leaks and copy construction of an BCMTF leads to double delete. In examples/advanced/mtf/systematics:

...
    // perform analysis
    facility.PerformSingleSystematicAnalyses("systematics");

    // testing copy and assignment
    BCMTF mcopy = m;
...

leads to

PASS: CreateHistograms.C
*** Error in `/home/beaujean/workspace/bat/build_refactor/examples/advanced/mtf/systematics/.libs/lt-runSystematics': double free or corruption (out): 0x0000000002a29510 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f0978bb47e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f0978bbd37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f0978bc153c]
/home/beaujean/workspace/bat/build_refactor/models/mtf/.libs/libBATmtf.so.1(_ZN13BCMTFTemplateD1Ev+0x1d)[0x7f097aa45c7b]
/home/beaujean/workspace/bat/build_refactor/models/mtf/.libs/libBATmtf.so.1(_ZN12BCMTFChannelD1Ev+0x74)[0x7f097aa2dd62]
/home/beaujean/workspace/bat/build_refactor/models/mtf/.libs/libBATmtf.so.1(_ZN5BCMTFD1Ev+0x60)[0x7f097aa33ada]
/home/beaujean/workspace/bat/build_refactor/examples/advanced/mtf/systematics/.libs/lt-runSystematics[0x405eb7]

Fixing this requires changes all over the mtf source and potentially the examples

Activity

  1. added this to the 1.1 milestone on Apr 3, 2018
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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions