Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

pure virtual function call crash

Discussion in 'Editor & General Support' started by pavlito, Aug 26, 2016.

  1. pavlito

    pavlito

    Joined:
    Nov 27, 2007
    Posts:
    136
    Hello!

    We are currently having problems with a "pure virtual function call" crash of the editor. The crash is intermittent and cannot be reproduced at will.

    I can't be sure whether it is MY code that's causing it or some other 3rd party script.
    Could you please give some guidance on what to look for in C# code that might be causing the crash?

    It hasn't been seen prior to 5.3.6 so I thought one of the patches might fix it. Currently we are on 5.3.6p3 (still happens). I am quite sure that I haven't introduced code that is very different from the code I've been writing prior to 5.3.6 so I am confident it's not C#.

    I would be grateful if you'd prove me wrong so I can go fix it.

    Thanks a ton!
    Cheers!
     
  2. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    962
    Same crashes in 5.6f3 -- what did you ever do to fix this?

     
  3. CleverNickname

    CleverNickname

    Joined:
    Aug 18, 2015
    Posts:
    16
    I'm getting the same thing in 5.5, seems to happen randomly every few hours without being triggered by any particular thing I can find. I think I remember seeing it happen once or twice in previous versions but it's a lot more common now. Has anyone found the cause of this yet?
     
  4. UziMonkey

    UziMonkey

    Joined:
    Nov 7, 2012
    Posts:
    206
    This is a C++ error and I don't think there's anything you're doing that triggers it or anything you can do to avoid it. It's a bug in the Unity editor and/or engine. This occurs when a C++ function tries to call a pure virtual function (one declared virtual and with the = 0 marker signifying it has no implementation in this class) on an uninitialized object. For example, from the constructor of a base class.