Call stack is not deep enough (QT 5.15 + OCCT 7.5.1 (VTK 9.0.1))

Having trouble installing or compiling FreeCAD? Get help here.
illuusio
Posts: 11
Joined: Mon Mar 01, 2021 10:00 am

Call stack is not deep enough (QT 5.15 + OCCT 7.5.1 (VTK 9.0.1))

Postby illuusio » Mon Mar 01, 2021 10:32 am

Hello,
I'm currently using FreeCAD 0.19 from GIT compiled with QT 5.15 and OCCT 7.5.1 (VTK 9.0.1) build on openSUSE Tubleweed GCC 10 with C++ std C++17 enabled as to get VTK 9.0 working (also applied patch to SalomeMesh for VTK 9.0 from wwmayer vtk-9.0 branch).

Problem I'm facing problem with Arrays. If array is created and then just alter X or Y distances or try to make for example mirror or that array then result is something like this:

Code: Select all

11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftobjects.array.Array'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_array.ViewProviderDraftArray'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_draftlink.ViewProviderDraftLink'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
11:56:02  PropertyPythonObject::toString(): failed for <class 'draftviewproviders.view_draftlink.ViewProviderDraftLink'>
11:56:02  <class 'ValueError'>: call stack is not deep enough
After this one can't alter any Array stuff or it does not do anything. I looked PropertyPythonObject-objects toString-method and noticed that problem arises in this string

Code: Select all

        if (pickle.isNull())
Somehow JSON Unserialized pickle is NULL.. If there is some other discussion about this I would contribute to that but I couldn't find similar.
Last edited by Kunda1 on Mon Mar 01, 2021 9:26 pm, edited 1 time in total.
Reason: Updated topic thread to show dependencies
User avatar
Kunda1
Posts: 10389
Joined: Thu Jan 05, 2017 9:03 pm

Re: Call stack is not deep enough

Postby Kunda1 » Mon Mar 01, 2021 9:22 pm

I haven't consciously seen anybody running FC with those dependencies yet. But that's where we're headed. thanks for posting
Edit: moved to Install/Compile subforum because it is dependency related
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
illuusio
Posts: 11
Joined: Mon Mar 01, 2021 10:00 am

Re: Call stack is not deep enough (QT 5.15 + OCCT 7.5.1 (VTK 9.0.1))

Postby illuusio » Tue Mar 02, 2021 7:21 am

Running rolling distro ain't fun always as you have manage problems which normal developer with more static system has. Do someone have idea where to start debugging this one?
wmayer
Site Admin
Posts: 17296
Joined: Thu Feb 19, 2009 10:32 am

Re: Call stack is not deep enough (QT 5.15 + OCCT 7.5.1 (VTK 9.0.1))

Postby wmayer » Tue Mar 02, 2021 9:24 am

The exception "call stack is not deep enough" is raised inside sys._getframe() and it occurs when the passed parameter is higher than the depth of the call stack.
Problem I'm facing problem with Arrays. If array is created and then just alter X or Y distances or try to make for example mirror or that array then result is something like this:
Can you describe step by step what you do? This may help others to reproduce the problem.
Do someone have idea where to start debugging this one?
If it's important to figure out which function calls sys._getframe() you can try to install the debug symbols for Python and the source code. In the file sysmodule.c you will find the C function sys__getframe_impl.
If this is not an option for you then you can try to replace sys._getframe() with your own function where you add some extra output messages.

Code: Select all

sys._getframe_old = sys._getframe

def _getframe(depth=0):
    import traceback
    try:
        return sys._getframe_old(depth)
    except Exception as e:
        print (str(e))
        print(traceback.format_exc())
        raise
        
sys._getframe = _getframe
illuusio
Posts: 11
Joined: Mon Mar 01, 2021 10:00 am

Re: Call stack is not deep enough (QT 5.15 + OCCT 7.5.1 (VTK 9.0.1))

Postby illuusio » Thu Mar 04, 2021 11:26 am

If it's important to figure out which function calls sys._getframe() you can try to install the debug symbols for Python and the source code. In the file sysmodule.c you will find the C function sys__getframe_impl.
If this is not an option for you then you can try to replace sys._getframe() with your own function where you add some extra output messages.

Code: Select all

sys._getframe_old = sys._getframe

def _getframe(depth=0):
    import traceback
    try:
        return sys._getframe_old(depth)
    except Exception as e:
        print (str(e))
        print(traceback.format_exc())
        raise
        
sys._getframe = _getframe
I build Python from SRPM and placed some output on 'sys__getframe_impl'. I did use 'tp_name' but it only prints 'module' for name which is not very good. Where I can but that other code as my Python-fu skills are good as C/C++. I try to make minimal example which makes this happen (I have tried to but it's kind of problem you do long enough it happens).

I fount that if I try to load any STP file from command line. I get error:

Code: Select all

Exception while processing file: example.stp [call stack is not deep enough]
which dies on src/App/Application.cpp where variable mods.front.c_str() is 'ImportGui'

Code: Select all

Base::Interpreter().loadModule(mods.front().c_str())
I don't know if these are connected but if I understand correctly this is kind of stack problem. BTW same STEP loads well from GUI (besides one that works 0.18 but not 0.19pre)