Menu

#190 TC crash on creating BOM for hierarchical designs

Reproducible
closed
nobody
None
1
2017-04-24
2015-12-08
No

Hello - I've reproduced this on 4 computers (1 running Win7 pro, 1 running Win10 home, 2 running Win10 pro) with the #631 production release of TC. Whenever I insert a design as a symbol, the parts generator crashes the program and I lose all work done so far. The design has 12 instances of a circuit block that is identical.

Thinking that a different number would work, I tried this down to 2 identical blocks - no luck, still the crash. That's when I tried all my computers running different versions of Windows.

My workaround was to copy & paste the blocks 12 times - which is a step backwards.

Discussion

  • Niccola Torres

    Niccola Torres - 2017-04-22

    It seems that BOM Generator tries to assign the reference context of an empty parent, but tries to access an invalid index of an empty collection.

    Workaround:
    @ Net.h :: const T& getObjectWithDefault(const T& defaultValue) const
    add:
    if (collection->size() == 0) {
    return NULL;
    }

    before return (*collection)[index];

     
  • Don Lucas

    Don Lucas - 2017-04-23

    Thank you Niccola Torres for your solution to this bug. It will be incorporated in release 1.90 and is in the trunk of the repository now.

     
  • Don Lucas

    Don Lucas - 2017-04-23
    • status: open --> closed
     
  • Mark Langezaal

    Mark Langezaal - 2017-04-23

    Why return NULL and not defaultValue?

     
  • Don Lucas

    Don Lucas - 2017-04-23

    I already changed it to return defaultValue.
    Returning NULL generated warnings about returning the address of a local variable.

     
  • Niccola Torres

    Niccola Torres - 2017-04-24

    You're always welcome! It was suposed to return defaultValue, though.
    I have generated a release for my friend (which asked me to take a look on this issue) because it was really important for him. And on this release I generated it was returning defaultValue. lol
    My mistake guys, sorry!

    For more elegance, I did the following:

            if ((collection == NULL) || (collection->size() == 0)) {
                return defaultValue;
            }
    

    P.S.: I must say that the project is compiling nicely on VS2017, just saying fyk.

     

    Last edit: Niccola Torres 2017-04-24

Log in to post a comment.

Auth0 Logo