8000 Abort on startup (BAD LEXICON descriptor) · Issue #9 · CadQuery/CQ-editor · GitHub
[go: up one dir, main page]

Skip to content

Abort on startup (BAD LEXICON descriptor) #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
johnbeard opened this issue Sep 5, 2018 · 23 comments
Closed

Abort on startup (BAD LEXICON descriptor) #9

johnbeard opened this issue Sep 5, 2018 · 23 comments

Comments

@johnbeard
Copy link

I get a crash when I start up on the current master (4e13229) on Arch:

python run.py 
INFO:OCC.Display.backend:backend loaded: qt-pyqt5
 ###### 3D rendering pipe initialisation #####
Display3d class initialization starting ...
Aspect_DisplayConnection created.
Graphic_Driver created.
V3d_Viewer created.
AIS_InteractiveContext created.
V3d_View created
Xw_Window created.
Display3d class successfully initialized.
 ########################################
Layer manager created
Layer dimensions: 100, 30
TKOpenGl | Type: Error | ID: 0 | Severity: High | Message:
  Failed to compile shader object. Compilation log:
0:264(2): error: `occFragColor' undeclared
0:264(2): error: value of type vec4 cannot be assigned to variable of type error

TKOpenGl | Type: Error | ID: 0 | Severity: High | Message:
  Error! FBO blitting has failed
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:ipykernel.inprocess.ipkernel:
*** MESSAGE TYPE:kernel_info_request***
DEBUG:ipykernel.inprocess.ipkernel:   Content: {}
   --->
   
DEBUG:ipykernel.inprocess.ipkernel:kernel_info_request: {'header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 655936, tzinfo=tzutc()), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'kernel_info_request', 'msg_id': '3b1d660f-f7ab6b08bc6b55f4c1b21595'}, 'msg_id': '3b1d660f-f7ab6b08bc6b55f4c1b21595', 'msg_type': 'kernel_info_request', 'parent_header': {}, 'metadata': {}, 'content': {}, 'buffers': []}
DEBUG:ipykernel.inprocess.ipkernel:{'header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 661540, tzinfo=datetime.timezone.utc), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'kernel_info_reply', 'msg_id': '56430d19-c1135ee1952d0cf2c0c92052'}, 'msg_id': '56430d19-c1135ee1952d0cf2c0c92052', 'msg_type': 'kernel_info_reply', 'parent_header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 655936, tzinfo=tzutc()), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'kernel_info_request', 'msg_id': '3b1d660f-f7ab6b08bc6b55f4c1b21595'}, 'content': {'status': 'ok', 'protocol_version': '5.1', 'implementation': 'ipython', 'implementation_version': '6.5.0', 'language_info': {'name': 'python', 'version': '3.6.6', 'mimetype': 'text/x-python', 'codemirror_mode': {'name': 'ipython', 'version': 3}, 'pygments_lexer': 'ipython3', 'nbconvert_exporter': 'python', 'file_extension': '.py'}, 'banner': '', 'help_links': [{'text': 'Python Reference', 'url': 'https://docs.python.org/3.6'}, {'text': 'IPython Reference', 'url': 'https://ipython.org/documentation.html'}, {'text': 'NumPy Reference', 'url': 'https://docs.scipy.org/doc/numpy/reference/'}, {'text': 'SciPy Reference', 'url': 'https://docs.scipy.org/doc/scipy/reference/'}, {'text': 'Matplotlib Reference', 'url': 'https://matplotlib.org/contents.html'}, {'text': 'SymPy Reference', 'url': 'http://docs.sympy.org/latest/index.html'}, {'text': 'pandas Reference', 'url': 'https://pandas.pydata.org/pandas-docs/stable/'}]}, 'metadata': {}, 'tracker': <zmq.sugar.tracker.MessageTracker object at 0x7efd3f490c18>}
DEBUG:ipykernel.inprocess.ipkernel:
*** MESSAGE TYPE:kernel_info_request***
DEBUG:ipykernel.inprocess.ipkernel:   Content: {}
   --->
   
DEBUG:ipykernel.inprocess.ipkernel:kernel_info_request: {'header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 664904, tzinfo=tzutc()), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'kernel_info_request', 'msg_id': 'd8aded3b-5a6b66b1eef6c7e6e54b1995'}, 'msg_id': 'd8aded3b-5a6b66b1eef6c7e6e54b1995', 'msg_type': 'kernel_info_request', 'parent_header': {}, 'metadata': {}, 'content': {}, 'buffers': []}
DEBUG:ipykernel.inprocess.ipkernel:{'header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 667502, tzinfo=datetime.timezone.utc), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'kernel_info_reply', 'msg_id': '675f2227-f9bb28ae6315b6524ef285a6'}, 'msg_id': '675f2227-f9bb28ae6315b6524ef285a6', 'msg_type': 'kernel_info_reply', 'parent_header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 664904, tzinfo=tzutc()), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'kernel_info_request', 'msg_id': 'd8aded3b-5a6b66b1eef6c7e6e54b1995'}, 'content': {'status': 'ok', 'protocol_version': '5.1', 'implementation': 'ipython', 'implementation_version': '6.5.0', 'language_info': {'name': 'python', 'version': '3.6.6', 'mimetype': 'text/x-python', 'codemirror_mode': {'name': 'ipython', 'version': 3}, 'pygments_lexer': 'ipython3', 'nbconvert_exporter': 'python', 'file_extension': '.py'}, 'banner': '', 'help_links': [{'text': 'Python Reference', 'url': 'https://docs.python.org/3.6'}, {'text': 'IPython Reference', 'url': 'https://ipython.org/documentation.html'}, {'text': 'NumPy Reference', 'url': 'https://docs.scipy.org/doc/numpy/reference/'}, {'text': 'SciPy Reference', 'url': 'https://docs.scipy.org/doc/scipy/reference/'}, {'text': 'Matplotlib Reference', 'url': 'https://matplotlib.org/contents.html'}, {'text': 'SymPy Reference', 'url': 'http://docs.sympy.org/latest/index.html'}, {'text': 'pandas Reference', 'url': 'https://pandas.pydata.org/pandas-docs/stable/'}]}, 'metadata': {}, 'tracker': <zmq.sugar.tracker.MessageTracker object at 0x7efd3f490c18>}
DEBUG:ipykernel.inprocess.ipkernel:
*** MESSAGE TYPE:history_request***
DEBUG:ipykernel.inprocess.ipkernel:   Content: {'raw': True, 'output': False, 'hist_access_type': 'tail', 'n': 1000}
   --->
   
DEBUG:ipykernel.inprocess.ipkernel:history_request: {'header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 668707, tzinfo=tzutc()), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'history_request', 'msg_id': 'f60beaae-cb8207b52d14bb6745a4febf'}, 'msg_id': 'f60beaae-cb8207b52d14bb6745a4febf', 'msg_type': 'history_request', 'parent_header': {}, 'metadata': {}, 'content': {'raw': True, 'output': False, 'hist_access_type': 'tail', 'n': 1000}, 'buffers': []}
DEBUG:ipykernel.inprocess.ipkernel:{'header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 672181, tzinfo=datetime.timezone.utc), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'history_reply', 'msg_id': '0562323a-08fc4f03869dda3fd38231b1'}, 'msg_id': '0562323a-08fc4f03869dda3fd38231b1', 'msg_type': 'history_reply', 'parent_header': {'version': '5.3', 'date': datetime.datetime(2018, 9, 5, 15, 14, 35, 668707, tzinfo=tzutc()), 'session': '17e1a50c-2ef784919e81f837a8330272', 'username': 'john', 'msg_type': 'history_request', 'msg_id': 'f60beaae-cb8207b52d14bb6745a4febf'}, 'content': {'status': 'ok', 'history': []}, 'metadata': {}, 'tracker': <zmq.sugar.tracker.MessageTracker object at 0x7efd3f490c18>}
Traceback (most recent call last):
  File "/home/john/src/CQ-editor/src/widgets/viewer.py", line 175, in display_many
    context.Display(ais.GetHandle())
RuntimeError: Units_NoSuchType
BAD LEXICON descriptor
Aborted (core dumped)

GDB backtrace:

Thread 1 "python" received signal SIGABRT, Aborted.
0x00007ffff76e5d7f in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff76e5d7f in raise () from /usr/lib/libc.so.6
#1  0x00007ffff76d0672 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff662bc3e in QMessageLogger::fatal(char const*, ...) const () from /home/john/.conda/envs/cqgui/lib/python3.6/site-packages/PyQt5/../../../libQt5Core.so.5
#3  0x00007ffff6cb69e0 in pyqt5_err_print() () from /home/john/.conda/envs/cqgui/lib/python3.6/site-packages/PyQt5/QtCore.so
#4  0x00007ffff6cb51c1 in qt_metacall_worker(_sipSimpleWrapper*, _typeobject*, _sipTypeDef*, QMetaObject::Call, int, void**) () from /home/john/.conda/envs/cqgui/lib/python3.6/site-packages/PyQt5/QtCore.so
#5  0x00007ffff6cb54d2 in qpycore_qobject_qt_metacall(_sipSimpleWrapper*, _sipTypeDef*, QMetaObject::Call, int, void**) () from /home/john/.conda/envs/cqgui/lib/python3.6/site-packages/PyQt5/QtCore.so
#6  0x00007ffff6833d59 in QMetaObject::activate(QObject*, int, int, void**) () from /home/john/.conda/envs/cqgui/lib/python3.6/site-packages/PyQt5/../../../libQt5Core.so.5
#7  0x00007ffff6cb18b9 in pyqtBoundSignal_emit () from /home/john/.conda/envs/cqgui/lib/python3.6/site-packages/PyQt5/QtCore.so
#8  0x00007ffff7b5afee in _PyCFunction_FastCallDict (func_obj=func_obj@entry=0x7fffa93e8e10, args=args@entry=0x3176018, nargs=<optimized out>, kwargs=kwargs@entry=0x0) at Objects/methodobject.c:234
#9  0x00007ffff7b5b315 in _PyCFunction_FastCallKeywords (func=func@entry=0x7fffa93e8e10, stack=stack@entry=0x3176018, nargs=<optimized out>, kwnames=kwnames@entry=0x0) at Objects/methodobject.c:294
#10 0x00007ffff7bf449a in call_function (pp_stack=pp_stack@entry=0x7fffffffd1d0, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:4830
#11 0x00007ffff7bf871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#12 0x00007ffff7bf3730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at Python/ceval.c:4912
#13 0x00007ffff7bf4654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7fffb5812400) at Python/ceval.c:4947
#14 call_function (pp_stack=pp_stack@entry=0x7fffffffd410, oparg=oparg@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#15 0x00007ffff7bf871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#16 0x00007ffff7bf409e in _PyEval_EvalCodeWithName (_co=_co@entry=0x7ffff7226d20, globals=globals@entry=0x7ffff733e7e0, locals=locals@entry=0x0, args=args@entry=0x7fffffffd6a0, argcount=argcount@entry=1, 
    kwnames=kwnames@entry=0x0, kwargs=kwargs@entry=0x0, kwcount=kwcount@entry=0, kwstep=kwstep@entry=2, defs=0x7ffff6fb6db8, defcount=1, kwdefs=0x0, closure=0x7ffff72b8978, name=0x7ffff7a52270, 
    qualname=0x7ffff6fb4300) at Python/ceval.c:4159
#17 0x00007ffff7bfcd55 in _PyFunction_FastCallDict (func=func@entry=0x7fffb5773268, args=args@entry=0x7fffffffd6a0, nargs=1, kwargs=kwargs@entry=0x0) at Python/ceval.c:5063
#18 0x00007ffff7b01abe in _PyObject_FastCallDict (func=func@entry=0x7fffb5773268, args=args@entry=0x7fffffffd6a0, nargs=nargs@entry=1, kwargs=kwargs@entry=0x0) at Objects/abstract.c:2310
#19 0x00007ffff7b01bae in _PyObject_Call_Prepend (func=0x7fffb5773268, obj=0x7ffff6fb80d8, args=0x7ffff7a4f048, kwargs=0x0) at Objects/abstract.c:2373
#20 0x00007ffff7b0186a in PyObject_Call (func=0x7ffff73b9988, args=<optimized out>, kwargs=<optimized out>) at Objects/abstract.c:2261
#21 0x00007ffff7b7a659 in slot_tp_init (self=0x7ffff6fb80d8, args=0x7ffff7a4f048, kwds=0x0) at Objects/typeobject.c:6407
#22 0x00007ffff7b72ed3 in type_call (type=<optimized out>, type@entry=0x254fca8, args=args@entry=0x7ffff7a4f048, kwds=kwds@entry=0x0) at Objects/typeobject.c:915
#23 0x00007ffff7b019cb in _PyObject_FastCallDict (func=0x254fca8, args=<optimized out>, nargs=<optimized out>, kwargs=0x0) at Objects/abstract.c:2331
#24 0x00007ffff7bf4208 in call_function (pp_stack=pp_stack@entry=0x7fffffffd970, oparg=oparg@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:4854
#25 0x00007ffff7bf871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#26 0x00007ffff7bf3730 in _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=0, globals=<optimized out>) at Python/ceval.c:4912
#27 0x00007ffff7bf4654 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7ffff6fad9d8) at Python/ceval.c:4947
#28 call_function (pp_stack=pp_stack@entry=0x7fffffffdbb0, oparg=oparg@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:4851
#29 0x00007ffff7bf871c in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3328
#30 0x00007ffff7bf409e in _PyEval_EvalCodeWithName (_co=_co@entry=0x7ffff733c8a0, globals=globals@entry=0x7ffff737e1f8, locals=locals@entry=0x7ffff737e1f8, args=args@entry=0x0, argcount=argcount@entry=0, 
    kwnames=kwnames@entry=0x0, kwargs=kwargs@entry=0x0, kwcount=kwcount@entry=0, kwstep=kwstep@entry=2, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, 
    name=name@entry=0x0, qualname=qualname@entry=0x0) at Python/ceval.c:4159
#31 0x00007ffff7bf46cd in PyEval_EvalCodeEx (_co=_co@entry=0x7ffff733c8a0, globals=globals@entry=0x7ffff737e1f8, locals=locals@entry=0x7ffff737e1f8, args=args@entry=0x0, argcount=argcount@entry=0, 
    kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0) at Python/ceval.c:4180
#32 0x00007ffff7bf471b in PyEval_EvalCode (co=co@entry=0x7ffff733c8a0, globals=globals@entry=0x7ffff737e1f8, locals=locals@entry=0x7ffff737e1f8) at Python/ceval.c:731
#33 0x00007ffff7c300a2 in run_mod (arena=0x7ffff7399078, flags=0x7fffffffdec0, locals=0x7ffff737e1f8, globals=0x7ffff737e1f8, filename=0x7ffff72b88f0, mod=0x661f48) at Python/pythonrun.c:1025
#34 PyRun_FileExFlags (fp=fp@entry=0x6bcb70, filename_str=filename_str@entry=0x7ffff7221050 "run.py", start=start@entry=257, globals=globals@entry=0x7ffff737e1f8, locals=locals@entry=0x7ffff737e1f8, 
    closeit=closeit@entry=1, flags=flags@entry=0x7fffffffdec0) at Python/pythonrun.c:978
#35 0x00007ffff7c30207 in PyRun_SimpleFileExFlags (fp=fp@entry=0x6bcb70, filename=<optimized out>, closeit=closeit@entry=1, flags=flags@entry=0x7fffffffdec0) at Python/pythonrun.c:420
#36 0x00007ffff7c306a3 in PyRun_AnyFileExFlags (fp=fp@entry=0x6bcb70, filename=<optimized out>, closeit=closeit@entry=1, flags=flags@entry=0x7fffffffdec0) at Python/pythonrun.c:81
#37 0x00007ffff7c4c6fd in run_file (p_cf=0x7fffffffdec0, filename=0x604710 L"run.py", fp=0x6bcb70) at Modules/main.c:340
#38 Py_Main (argc=argc@entry=2, argv=argv@entry=0x602260) at Modules/main.c:810
#39 0x0000000000400bbc in main (argc=2, argv=<optimized out>) at ./Programs/python.c:69

Conda setup:

conda env list
# conda environments:
#
cqgui                 *  /home/john/.conda/envs/cqgui
base                     /usr
# packages in environment at /home/john/.conda/envs/cqgui:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.11                     py_3    conda-forge
asn1crypto                0.24.0                   py36_3    conda-forge
astroid                   2.0.2                    py36_0    conda-forge
babel                     2.6.0                      py_1    conda-forge
backcall                  0.1.0                      py_0    conda-forge
bleach                    2.1.4                      py_1    conda-forge
bzip2                     1.0.6                h470a237_2    conda-forge
ca-certificates           2018.8.24            ha4d7672_0    conda-forge
cadquery-occ              0.1.5             py3.6180e50c0    cadquery
certifi                   2018.8.24                py36_1    conda-forge
cffi                      1.11.5           py36h5e8e0c9_1    conda-forge
chardet                   3.0.4                    py36_3    conda-forge
cloudpickle               0.5.5                      py_0    conda-forge
cryptography              2.3.1            py36hdffb7b8_0    conda-forge
cryptography-vectors      2.3.1                    py36_0    conda-forge
dbus                      1.13.0               h3a4f0e9_0    conda-forge
decorator                 4.3.0                      py_0    conda-forge
docutils                  0.14                     py36_1    conda-forge
entrypoints               0.2.3                    py36_2    conda-forge
expat                     2.2.5                hfc679d8_2    conda-forge
fontconfig                2.12.1                        4    conda-forge
freeimageplus             3.17.0                        0    dlr-sc
freetype                  2.7                           1    conda-forge
gettext                   0.19.8.1             h5e8e0c9_1    conda-forge
gl2ps                     1.3.8                         1    dlr-sc
glib                      2.55.0               h464dc38_2    conda-forge
gmp                       6.1.2                hfc679d8_0    conda-forge
gst-plugins-base          1.12.5               hde13a9d_0    conda-forge
gstreamer                 1.12.5               h61a6719_0    conda-forge
html5lib                  1.0.1                      py_0    conda-forge
icu                       58.2                 hfc679d8_0    conda-forge
idna                      2.7                      py36_2    conda-forge
imagesize                 1.1.0                      py_0    conda-forge
ipykernel                 4.9.0                    py36_0    conda-forge
ipython                   6.5.0                    py36_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
isort                     4.3.4                    py36_0    conda-forge
jedi                      0.12.1                   py36_0    conda-forge
jinja2                    2.10                       py_1    conda-forge
jpeg                      9c                   h470a237_1    conda-forge
jsonschema                2.6.0                    py36_2    conda-forge
jupyter_client            5.2.3                      py_1    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
lazy-object-proxy         1.3.1            py36h470a237_0    conda-forge
libffi                    3.2.1                hfc679d8_5    conda-forge
libgcc-ng                 7.2.0                hdf63c60_3    conda-forge
libgfortran-ng            7.2.0                hdf63c60_3    conda-forge
libiconv                  1.15                 h470a237_3    conda-forge
libopenblas               0.2.20               h9ac9557_7  
libpng                    1.6.35               ha92aebf_1    conda-forge
libsodium                 1.0.16                        0    conda-forge
libstdcxx-ng              7.2.0                hdf63c60_3    conda-forge
libxcb                    1.13                 h470a237_2    conda-forge
libxml2                   2.9.3                         1    dlr-sc
Logbook                   1.4.0                     <pip>
markupsafe                1.0              py36h470a237_1    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
mistune                   0.8.3            py36h470a237_2    conda-forge
nbconvert                 5.3.1                      py_1    conda-forge
nbformat                  4.4.0                      py_1    conda-forge
ncurses                   6.1                  hfc679d8_1    conda-forge
numpy                     1.14.3           py36h28100ab_1  
numpy-base                1.14.3           py36h0ea5e3f_1  
numpydoc                  0.8.0                      py_1    conda-forge
oce                       0.18.2               h49dc8cd_2    oce
openssl                   1.0.2p               h470a237_0    conda-forge
packaging                 17.1                       py_0    conda-forge
pandoc                    2.2.2                         1    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.3.1                      py_0    conda-forge
pcre                      8.41                 hfc679d8_3    conda-forge
pexpect                   4.6.0                    py36_0    conda-forge
pickleshare               0.7.4                    py36_0    conda-forge
pip                       18.0                     py36_1    conda-forge
prompt_toolkit            1.0.15                     py_1    conda-forge
psutil                    5.4.7            py36h470a237_1    conda-forge
pthread-stubs             0.4                  h470a237_1    conda-forge
ptyprocess                0.6.0                    py36_0    conda-forge
pycodestyle               2.4.0                      py_1    conda-forge
pycparser                 2.18                       py_1    conda-forge
pyflakes                  2.0.0                      py_0    conda-forge
pygments                  2.2.0                      py_1    conda-forge
pylint                    2.1.1                    py36_0    conda-forge
pyopenssl                 18.0.0                   py36_0    conda-forge
pyparsing                 2.2.0                      py_1    conda-forge
pyqt                      5.6.0            py36h8210e8a_7    conda-forge
pyqtgraph                 0.10.0                     py_3    conda-forge
pysocks                   1.6.8                    py36_2    conda-forge
python                    3.6.6                h5001a0f_0    conda-forge
python-dateutil           2.7.3                      py_0    conda-forge
pythonocc-core            0.18.1          py36hdfe9f0f_110    pythonocc
pytz                      2018.5                     py_0    conda-forge
pyzmq                     17.1.2           py36hae99301_0    conda-forge
qt                        5.6.2                         3    conda-forge
qtawesome                 0.4.4              pyh8a2030e_1    conda-forge
qtconsole                 4.4.1                    py36_1    conda-forge
qtpy                      1.5.0              pyh8a2030e_0    conda-forge
readline                  7.0                  haf1bffa_1    conda-forge
requests                  2.19.1                   py36_1    conda-forge
rope                      0.10.7                     py_1    conda-forge
setuptools                40.2.0                   py36_0    conda-forge
simplegeneric             0.8.1                      py_1    conda-forge
sip                       4.18.1           py36hfc679d8_0    conda-forge
six                       1.11.0                   py36_1    conda-forge
smesh                     6.7.5                         0    pythonocc
snowballstemmer           1.2.1                      py_1    conda-forge
sphinx                    1.7.8                    py36_0    conda-forge
sphinxcontrib-websupport  1.1.0                      py_1    conda-forge
spyder                    3.2.8                    py36_0    conda-forge
sqlite                    3.24.0               h2f33b56_1    conda-forge
tbb                       2017_20170226                 0    conda-forge
testpath                  0.3.1                    py36_1    conda-forge
tk                        8.6.8                         0    conda-forge
tornado                   5.1              py36h470a237_1    conda-forge
traitlets                 4.3.2                    py36_0    conda-forge
typed-ast                 1.1.0                    py36_0    conda-forge
urllib3                   1.23                     py36_1    conda-forge
wcwidth                   0.1.7                      py_1    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.31.1                   py36_1    conda-forge
wrapt                     1.10.11                  py36_0    conda-forge
xorg-libxau               1.0.8                h470a237_6    conda-forge
xorg-libxdmcp             1.1.2                h470a237_7    conda-forge
xz                        5.2.4                h470a237_1    conda-forge
zeromq                    4.2.5                hfc679d8_5    conda-forge
zlib                      1.2.11               h470a237_3    conda-forge

Let me know if I can provide more details!

@adam-urbanczyk
Copy link
Member

Thanks for trying and giving such a detailed bug report. Looking at this part

Layer manager created
Layer dimensions: 100, 30
TKOpenGl | Type: Error | ID: 0 | Severity: High | Message:
  Failed to compile shader object. Compilation log:
0:264(2): error: `occFragColor' undeclared
0:264(2): error: value of type vec4 cannot be assigned to variable of type error

I conclude that something goes wrong with initialization of the 3d display pipeline of PythonOCC and then I do not handle it well later in my code.

Could you give some details on your graphics card and the driver used? Also running

qtdiag --gl-extensions

might be useful.

@johnbeard
Copy link
Author

GTX card is:

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Redwood XT [Radeon HD 5670/5690/5730] (prog-if 00 [VGA controller])
	Subsystem: XFX Pine Group Inc. Redwood XT [Radeon HD 5670/5690/5730]
	Flags: bus master, fast devsel, latency 0, IRQ 27, NUMA node 0
	Memory at d0000000 (64-bit, prefetchable) [size=256M]
	Memory at fdec0000 (64-bit, non-prefetchable) [size=128K]
	I/O ports at ee00 [size=256]
	[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: radeon
	Kernel modules: radeon

Some moaning about Vulkan in qtdiag - could be relevant?

$qtdiag --gl-extensions
Failed to create Vulkan instance: -9
Failed to create platform Vulkan instance
Qt 5.11.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.2.0) on "xcb" 
OS: Antergos Linux [linux version 4.18.5-arch1-1-ARCH]

Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX

Environment:

Features: QT_NO_EXCEPTIONS

Library info:
  PrefixPath: /usr
  DocumentationPath: /usr/share/doc/qt
  HeadersPath: /usr/include/qt
  LibrariesPath: /usr/lib
  LibraryExecutablesPath: /usr/lib/qt/libexec
  BinariesPath: /usr/bin
  PluginsPath: /usr/lib/qt/plugins
  ImportsPath: /usr/lib/qt/imports
  Qml2ImportsPath: /usr/lib/qt/qml
  ArchDataPath: /usr/lib/qt
  DataPath: /usr/share/qt
  TranslationsPath: /usr/share/qt/translations
  ExamplesPath: /usr/share/doc/qt/examples
  TestsPath: /usr/tests
  SettingsPath: /etc/xdg

Standard paths [*...* denote writable entry]:
  DesktopLocation: "Desktop" */home/john/Desktop*
  DocumentsLocation: "Documents" */home/john/Documents*
  FontsLocation: "Fonts" */home/john/.local/share/fonts* /home/john/.fonts
  ApplicationsLocation: "Applications" */home/john/.local/share/applications* /usr/local/share/applications /usr/share/applications
  MusicLocation: "Music" */home/john/Music*
  MoviesLocation: "Movies" */home/john/Videos*
  PicturesLocation: "Pictures" */home/john/Pictures*
  TempLocation: "Temporary Directory" */tmp*
  HomeLocation: "Home" */home/john*
  AppLocalDataLocation: "Application Data" */home/john/.local/share/QtProject/qtdiag* /usr/local/share/QtProject/qtdiag /usr/share/QtProject/qtdiag
  CacheLocation: "Cache" */home/john/.cache/QtProject/qtdiag*
  GenericDataLocation: "Shared Data" */home/john/.local/share* /usr/local/share /usr/share
  RuntimeLocation: "Runtime" */run/user/1000*
  ConfigLocation: "Configuration" */home/john/.config* /etc/xdg
  DownloadLocation: "Download" */home/john/Downloads*
  GenericCacheLocation: "Shared Cache" */home/john/.cache*
  GenericConfigLocation: "Shared Configuration" */home/john/.config* /etc/xdg
  AppDataLocation: "Application Data" */home/john/.local/share/QtProject/qtdiag* /usr/local/share/QtProject/qtdiag /usr/share/QtProject/qtdiag
  AppConfigLocation: "Application Configuration" */home/john/.config/QtProject/qtdiag* /etc/xdg/QtProject/qtdiag

File selectors (increasing order of precedence):
  en_GB unix linux antergos

Network:
  Using "OpenSSL 1.1.0i  14 Aug 2018", version: 0x1010009f

Platform capabilities: ThreadedPixmaps OpenGL WindowMasks MultipleWindows ForeignWindows NonFullScreenWindows NativeWidgets WindowManagement SyncState RasterGLSurface SwitchableWidgetComposition

Style hints:
  mouseDoubleClickInterval: 400
  mousePressAndHoldInterval: 800
  startDragDistance: 10
  startDragTime: 500
  startDragVelocity: 0
  keyboardInputInterval: 400
  keyboardAutoRepeatRate: 30
  cursorFlashTime: 1000
  showIsFullScreen: 0
  showIsMaximized: 0
  passwordMaskDelay: 0
  passwordMaskCharacter: U+25CF
  fontSmoothingGamma: 1.7
  useRtlExtensions: 0
  setFocusOnTouchRelease: 0
  tabFocusBehavior: Qt::TabFocusBehavior(TabFocusAllControls) 
  singleClickActivation: 0

Additional style hints (QPlatformIntegration):
  Rep
8000
layMousePressOutsidePopup: 0

Theme:
  Platforms requested : i3,generic
            available : flatpak,gtk3
  Styles requested    : Fusion,Windows
         available    : Windows,Fusion
  System font         : "Sans Serif" 9

Fonts:
  General font : "Sans Serif" 9
  Fixed font   : "monospace" 9
  Title font   : "Bitstream Vera Sans" 12
  Smallest font: "Bitstream Vera Sans" 12

Palette:
  WindowText: #ff000000
  Button: #ffefefef
  Light: #ffffffff
  Midlight: #ffcbcbcb
  Dark: #ff9f9f9f
  Mid: #ffb8b8b8
  Text: #ff000000
  BrightText: #ffffffff
  ButtonText: #ff000000
  Base: #ffffffff
  Window: #ffefefef
  Shadow: #ff767676
  Highlight: #ff308cc6
  HighlightedText: #ffffffff
  Link: #ff0000ff
  LinkVisited: #ffff00ff
  AlternateBase: #fff7f7f7
  NoRole: #ff000000
  ToolTipBase: #ffffffdc
  ToolTipText: #ff000000

Screens: 2, High DPI scaling: inactive
# 0 "HDMI-0" Depth: 24 Primary: yes
  Manufacturer: Dell Inc.
  Model: DELL E228WFP
  Serial number: KU31172R1AYM
  Geometry: 1680x1050+0+0 Available: 1680x1050+0+0
  Virtual geometry: 3600x1080+0+0 Available: 3600x1080+0+0
  2 virtual siblings
  Physical size: 473x296 mm  Refresh: 59 Hz Power state: 0
  Physical DPI: 90.2156,90.1014 Logical DPI: 96.0504,96.2526 Subpixel_None
  DevicePixelRatio: 1 Pixel density: 1
  Primary orientation: 2 Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0

# 1 "VGA-0" Depth: 24 Primary: no
  Manufacturer: Samsung Electric Company
  Model: S27C450
  Serial number: HTPF500583
  Geometry: 1920x1080+1680+0 Available: 1920x1080+1680+0
  Virtual geometry: 3600x1080+0+0 Available: 3600x1080+0+0
  2 virtual siblings
  Physical size: 598x336 mm  Refresh: 60 Hz Power state: 0
  Physical DPI: 81.5518,81.6429 Logical DPI: 96.0504,96.2526 Subpixel_None
  DevicePixelRatio: 1 Pixel density: 1
  Primary orientation: 2 Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0

LibGL Vendor: X.Org
Renderer: AMD REDWOOD (DRM 2.50.0 / 4.18.5-arch1-1-ARCH, LLVM 6.0.1)
Version: 3.1 Mesa 18.1.7
Shading language: 1.40
Format: Version: 3.1 Profile: 0 Swap behavior: 0 Buffer size (RGB): 8,8,8
Profile: None (QOpenGLFunctions_3_1), Core (QOpenGLFunctions_3_1_Core), Compatibility (QOpenGLFunctions_3_1_Compatibility)
 
Found 247 extensions:
  GL_AMD_conservative_depth
  GL_AMD_draw_buffers_blend
  GL_AMD_performance_monitor
  GL_AMD_pinned_memory
  GL_AMD_seamless_cubemap_per_texture
  GL_AMD_shader_stencil_export
  GL_AMD_shader_trinary_minmax
  GL_ANGLE_texture_compression_dxt3
  GL_ANGLE_texture_compression_dxt5
  GL_APPLE_packed_pixels
  GL_ARB_ES2_compatibility
  GL_ARB_ES3_compatibility
  GL_ARB_arrays_of_arrays
  GL_ARB_base_instance
  GL_ARB_blend_func_extended
  GL_ARB_buffer_storage
  GL_ARB_clear_buffer_object
  GL_ARB_clear_texture
  GL_ARB_clip_control
  GL_ARB_color_buffer_float
  GL_ARB_compatibility
  GL_ARB_compressed_texture_pixel_storage
  GL_ARB_compute_shader
  GL_ARB_conditional_render_inverted
  GL_ARB_conservative_depth
  GL_ARB_copy_buffer
  GL_ARB_copy_image
  GL_ARB_cull_distance
  GL_ARB_debug_output
  GL_ARB_depth_buffer_float
  GL_ARB_depth_clamp
  GL_ARB_depth_texture
  GL_ARB_derivative_control
  GL_ARB_draw_buffers
  GL_ARB_draw_buffers_blend
  GL_ARB_draw_elements_base_vertex
  GL_ARB_draw_instanced
  GL_ARB_enhanced_layouts
  GL_ARB_explicit_attrib_location
  GL_ARB_explicit_uniform_location
  GL_ARB_fragment_coord_conventions
  GL_ARB_fragment_program
  GL_ARB_fragment_program_shadow
  GL_ARB_fragment_shader
  GL_ARB_framebuffer_no_attachments
  GL_ARB_framebuffer_object
  GL_ARB_framebuffer_sRGB
  GL_ARB_get_program_binary
  GL_ARB_get_texture_sub_image
  GL_ARB_half_float_pixel
  GL_ARB_half_float_vertex
  GL_ARB_instanced_arrays
  GL_ARB_internalformat_query
  GL_ARB_internalformat_query2
  GL_ARB_invalidate_subdata
  GL_ARB_map_buffer_alignment
  GL_ARB_map_buffer_range
  GL_ARB_multi_bind
  GL_ARB_multisample
  GL_ARB_multitexture
  GL_ARB_occlusion_query
  GL_ARB_occlusion_query2
  GL_ARB_pipeline_statistics_query
  GL_ARB_pixel_buffer_object
  GL_ARB_point_parameters
  GL_ARB_point_sprite
  GL_ARB_polygon_offset_clamp
  GL_ARB_program_interface_query
  GL_ARB_provoking_vertex
  GL_ARB_query_buffer_object
  GL_ARB_robust_buffer_access_behavior
  GL_ARB_robustness
  GL_ARB_sample_shading
  GL_ARB_sampler_objects
  GL_ARB_seamless_cube_map
  GL_ARB_seamless_cubemap_per_texture
  GL_ARB_separate_shader_objects
  GL_ARB_shader_atomic_counter_ops
  GL_ARB_shader_atomic_counters
  GL_ARB_shader_bit_encoding
  GL_ARB_shader_clock
  GL_ARB_shader_image_load_store
  GL_ARB_shader_image_size
  GL_ARB_shader_objects
  GL_ARB_shader_precision
  GL_ARB_shader_stencil_export
  GL_ARB_shader_storage_buffer_object
  GL_ARB_shader_texture_image_samples
  GL_ARB_shader_texture_lod
  GL_ARB_shading_language_100
  GL_ARB_shading_language_420pack
  GL_ARB_shading_language_packing
  GL_ARB_shadow
  GL_ARB_stencil_texturing
  GL_ARB_sync
  GL_ARB_texture_barrier
  GL_ARB_texture_border_clamp
  GL_ARB_texture_buffer_object
  GL_ARB_texture_buffer_object_rgb32
  GL_ARB_texture_buffer_range
  GL_ARB_texture_compression
  GL_ARB_texture_compression_bptc
  GL_ARB_texture_compression_rgtc
  GL_ARB_texture_cube_map
  GL_ARB_texture_cube_map_array
  GL_ARB_texture_env_add
  GL_ARB_texture_env_combine
  GL_ARB_texture_env_crossbar
  GL_ARB_texture_env_dot3
  GL_ARB_texture_filter_anisotropic
  GL_ARB_texture_float
  GL_ARB_texture_gather
  GL_ARB_texture_mirror_clamp_to_edge
  GL_ARB_texture_mirrored_repeat
  GL_ARB_texture_multisample
  GL_ARB_texture_non_power_of_two
  GL_ARB_texture_query_levels
  GL_ARB_texture_query_lod
  GL_ARB_texture_rectangle
  GL_ARB_texture_rg
  GL_ARB_texture_rgb10_a2ui
  GL_ARB_texture_stencil8
  GL_ARB_texture_storage
  GL_ARB_texture_storage_multisample
  GL_ARB_texture_swizzle
  GL_ARB_texture_view
  GL_ARB_timer_query
  GL_ARB_transform_feedback2
  GL_ARB_transform_feedback3
  GL_ARB_transform_feedback_instanced
  GL_ARB_transpose_matrix
  GL_ARB_uniform_buffer_object
  GL_ARB_vertex_array_bgra
  GL_ARB_vertex_array_object
  GL_ARB_vertex_attrib_binding
  GL_ARB_vertex_buffer_object
  GL_ARB_vertex_program
  GL_ARB_vertex_shader
  GL_ARB_vertex_type_10f_11f_11f_rev
  GL_ARB_vertex_type_2_10_10_10_rev
  GL_ARB_window_pos
  GL_ATI_blend_equation_separate
  GL_ATI_draw_buffers
  GL_ATI_fragment_shader
  GL_ATI_meminfo
  GL_ATI_separate_stencil
  GL_ATI_texture_compression_3dc
  GL_ATI_texture_env_combine3
  GL_ATI_texture_float
  GL_ATI_texture_mirror_once
  GL_EXT_abgr
  GL_EXT_bgra
  GL_EXT_blend_color
  GL_EXT_blend_equation_separate
  GL_EXT_blend_func_separate
  GL_EXT_blend_minmax
  GL_EXT_blend_subtract
  GL_EXT_compiled_vertex_array
  GL_EXT_copy_texture
  GL_EXT_draw_buffers2
  GL_EXT_draw_instanced
  GL_EXT_draw_range_elements
  GL_EXT_fog_coord
  GL_EXT_framebuffer_blit
  GL_EXT_framebuffer_multisample
  GL_EXT_framebuffer_multisample_blit_scaled
  GL_EXT_framebuffer_object
  GL_EXT_framebuffer_sRGB
  GL_EXT_gpu_program_parameters
  GL_EXT_multi_draw_arrays
  GL_EXT_packed_depth_stencil
  GL_EXT_packed_float
  GL_EXT_packed_pixels
  GL_EXT_pixel_buffer_object
  GL_EXT_point_parameters
  GL_EXT_polygon_offset
  GL_EXT_polygon_offset_clamp
  GL_EXT_provoking_vertex
  GL_EXT_rescale_normal
  GL_EXT_secondary_color
  GL_EXT_separate_specular_color
  GL_EXT_shader_integer_mix
  GL_EXT_shadow_funcs
  GL_EXT_stencil_two_side
  GL_EXT_stencil_wrap
  GL_EXT_subtexture
  GL_EXT_texture
  GL_EXT_texture3D
  GL_EXT_texture_array
  GL_EXT_texture_compression_dxt1
  GL_EXT_texture_compression_latc
  GL_EXT_texture_compression_rgtc
  GL_EXT_texture_compression_s3tc
  GL_EXT_texture_cube_map
  GL_EXT_texture_edge_clamp
  GL_EXT_texture_env_add
  GL_EXT_texture_env_combine
  GL_EXT_texture_env_dot3
  GL_EXT_texture_filter_anisotropic
  GL_EXT_texture_integer
  GL_EXT_texture_lod_bias
  GL_EXT_texture_mirror_clamp
  GL_EXT_texture_object
  GL_EXT_texture_rectangle
  GL_EXT_texture_sRGB
  GL_EXT_texture_sRGB_decode
  GL_EXT_texture_shared_exponent
  GL_EXT_texture_snorm
  GL_EXT_texture_swizzle
  GL_EXT_timer_query
  GL_EXT_transform_feedback
  GL_EXT_vertex_array
  GL_EXT_vertex_array_bgra
  GL_IBM_multimode_draw_arrays
  GL_IBM_rasterpos_clip
  GL_IBM_texture_mirrored_repeat
  GL_INGR_blend_func_separate
  GL_KHR_context_flush_control
  GL_KHR_debug
  GL_KHR_no_error
  GL_KHR_robust_buffer_access_behavior
  GL_KHR_robustness
  GL_MESA_pack_invert
  GL_MESA_shader_integer_functions
  GL_MESA_texture_signed_rgba
  GL_MESA_window_pos
  GL_NVX_gpu_memory_info
  GL_NV_blend_square
  GL_NV_conditional_render
  GL_NV_depth_clamp
  GL_NV_fog_distance
  GL_NV_light_max_exponent
  GL_NV_packed_depth_stencil
  GL_NV_primitive_restart
  GL_NV_texgen_reflection
  GL_NV_texture_barrier
  GL_NV_texture_env_combine4
  GL_NV_texture_rectangle
  GL_NV_vdpau_interop
  GL_OES_EGL_image
  GL_OES_read_format
  GL_S3_s3tc
  GL_SGIS_generate_mipmap
  GL_SGIS_texture_border_clamp
  GL_SGIS_texture_edge_clamp
  GL_SGIS_texture_lod
  GL_SUN_multi_draw_arrays


Unable to create a Vulkan instance, error code is-9

@jpmlt
Copy link
jpmlt commented Oct 3, 2018

Hi Adam. I have same issue, running in Manjaro Linux (Arch based)
Attached my log files.

log-condalist.log
log-qtdiag.log
log-runpy.log

justbuchanan added a commit to justbuchanan/CQ-editor that referenced this issue Oct 5, 2018
I don't really know why this works... it seems to be that the call to
addLines() depends on things that havent been setup yet and delaying
those callbacks to a later repaint fixes things. This should be
investigated to determine the root cause.
@justbuchanan
Copy link
Member

I also ran into this issue on Arch Linux. I played around with it for a while and was able to narrow down a minimal change to get things to work. You can try it out at justbuchanan@cb316e0.

I'm not familiar enough with the code to know why this fixes the problem and it's likely just a work around for some side-effects and not addressing the root issue. @adam-urbanczyk any thoughts on why this might fix the problem?

Something else I've noticed that may or not be related is that a lot of "DEBUG:ipykernel.inprocess.ipkernel: ..." messages are printed out at startup that contain content from other ipython notebooks I've run recently, which are independent of cadquery/cq-editor. @jpmlt's log-runpy.log seems to contain similar content.

@adam-urbanczyk
Copy link
Member

Wow thanks. I'll check out your fix during the weekend.

The logging noise is coming from the PythonOCC widget setting logging level to too low value AFAIK. I'll add an issue to track it.

@jpmlt
Copy link
jpmlt commented Oct 5, 2018

Hi Adam
I tried Justin workaround and it works also for me. So I will try you editor, thanks for your great work. @justbuchanan you're right, the file log-runpy.log also shows messages from previous run in jupyter notebook.
Jean-Paul

@adam-urbanczyk
Copy link
Member

Great, please share your experience. I will check if the workaround is ok for CI too.

@adam-urbanczyk
Copy link
Member

@johnbeard does the workaround proposed by @justbuchanan work for you too?

I investigated briefly and moving this line up

self.components['object_tree'].addLines()

actually prevents adding the helper X,Y,Z lines to the view. Somehow this addition seems to trigger the error (on your PCs, I cannot unfortunately reproduce it).

@justbuchanan could you share what is your graphics card? I'm trying to find some common denominator here...

@justbuchanan
Copy link
Member
justbuchanan commented Oct 7, 2018

I looked into this some more and found similar issues (tpaviot/pythonocc-core#279) reported in the pythonocc-core repo. It seems to be an issue with OCC finding data files that contain definitions of units for different locales.

I got this working on the master branch (without the hack I posted above) just by setting the CASROOT environment variable. With my setup this is:

export CASROOT=/home/justin/.conda/envs/cqgui/share/oce-0.18/

Everything works great, including drawing of the helper axis lines!

@adam-urbanczyk , did you already have CASROOT set in your environment?

@adam-urbanczyk
Copy link
Member

@justbuchanan this is very interesting. I do not have CASROOT set in my env. If you have time, could you post strace output with and without CASROOT set?

If this is indeed the solution for everyone, I will change run.py accordingly.

@justbuchanan
Copy link
Member
justbuchanan commented Oct 7, 2018

I'm looking at this again and the default value I have for CASROOT is /usr. I'm not actually sure where this is exported from since I don't have it in my bashrc and don't see any relevant files pulled in that might define it. If I do unset CASROOT, it seems to work just as well as setting it to the path I mentioned above.

Here are strace logs with CASROOT=/home/justin/.conda/envs/cqgui/share/oce-0.18/ and with it set to the default of /usr/:
strace-run-casroot.log
strace-run-no-casroot.log

Also output from qtdiag:
qtdiag.log

@justbuchanan
Copy link
Member

The relevant lines from strace-run-no-casroot.log (where CASROOT=/usr) seem to be:

openat(AT_FDCWD, "/usr/src/UnitsAPI/Lexi_Expr.dat", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/src/UnitsAPI/Units.dat", O_RDONLY) = -1 ENOENT (No such file or directory)

@justbuchanan
Copy link
Member

It looks like the export CASROOT=/usr is coming from /etc/profile.d/opencascade.sh from the opencascade package, which is a dependency of freecad.

@adam-urbanczyk
Copy link
Member

Great, getting to the bottom of it. Does it work if you unset the environment variable?

@justbuchanan
Copy link
Membe 8000 r

Yes, if I unset the environment variable, everything works. Same for setting the variable to the correct path under ~/.conda/envs.

The problem here seems to be that there's a bad interaction between cq-editor and the opencascade package on Arch Linux (and maybe others?). I don't think there's much you can do in cq-editor to fix this since CASROOT is an occ/opencascade option.

Probably the best fix for myself and others with this problem would be to add unset CASROOT to .bashrc/.zshrc, which will undo the incompatible export set by /etc/profile.d/opencascade.sh.

@adam-urbanczyk
Copy link
Member

OK, I just committed a workaround (run.py unsets CASROOT) : 1060362

@johnbeard @jpmlt could you confirm that this works for you too?

@justbuchanan does this sound like Arch Linux bug to you? Any idea where to submit it?

@justbuchanan
Copy link
Member
justbuchanan commented Oct 10, 2018

That workaround looks good to me 👍

I'm not sure if this is a bug in the opencascade Arch Linux package or not. I have version 7.3.0-3 (latest as of now) and it doesn't have the Lexi_Expr.dat file that cq-editor fails to find. This might just be an incompatibility between the latest versions of opencascade (which sets the env variable) and oce (which pythonocc uses).

@adam-urbanczyk
Copy link
Member

I looked quickly at the sources of 7.3 and the following fragment is quite revealing

// =======================================================================
// function : ShadersFolder
// purpose  :
// =======================================================================
const TCollection_AsciiString& Graphic3d_ShaderProgram::ShadersFolder()
{
  static Standard_Boolean        THE_IS_DEFINED = Standard_False;
  static TCollection_AsciiString THE_SHADERS_FOLDER;
  if (!THE_IS_DEFINED)
  {
    THE_IS_DEFINED = Standard_True;
    OSD_Environment aDirEnv ("CSF_ShadersDirectory");
    THE_SHADERS_FOLDER = aDirEnv.Value();
    if (THE_SHADERS_FOLDER.IsEmpty())
    {
      OSD_Environment aCasRootEnv ("CASROOT");
      THE_SHADERS_FOLDER = aCasRootEnv.Value();
      if (!THE_SHADERS_FOLDER.IsEmpty())
      {
        THE_SHADERS_FOLDER += "/src/Shaders";
      }

(...)

So to my understanding $CASROOT/src/shaders should contain the shader codes of OCCT. I think that in that case CASROOT=\usr is not the correct value (should be smth like \usr\OCCT\...; I do not have ARCH linux locally). Anyhow that does not mean that CASROOT pointing to OCCT7.3 would not result in an issue. On the other hand I am not sure if CASROOT should be set at all. From the code above it seems that it is some kind of fallback.

@johnbeard @jpmlt would be great if you could confirm that this workaround is OK for you too.

@justbuchanan
Copy link
Member

Below is what /etc/profile.d/opencascade.sh file looks like. I agree that CASROOT=/usr is weird and it seems like it should be something like /usr/OCCT, however it looks like opencascade 7.3 just uses different paths. For example, CSF_ShadersDirectory expands to /usr/share/opencascade/resources/Shaders, which has the expected files in it.

# /etc/profile.d/opencascade.sh from opencascade 7.3.0-3

export CASROOT=/usr

export CSF_LANGUAGE=us
export MMGT_CLEAR=1
export CSF_EXCEPTION_PROMPT=1

export CSF_OCCTResourcePath=$CASROOT/share/opencascade/resources
export CSF_SHMessage=$CSF_OCCTResourcePath/SHMessage
export CSF_MDTVTexturesDirectory=$CSF_OCCTResourcePath/Textures
export CSF_ShadersDirectory=$CSF_OCCTResourcePath/Shaders
export CSF_XSMessage=$CSF_OCCTResourcePath/XSMessage
export CSF_TObjMessage=$CSF_OCCTResourcePath/TObj
export CSF_StandardDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_PluginDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_XCAFDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_TObjDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_StandardLiteDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_IGESDefaults=$CSF_OCCTResourcePath/XSTEPResource
export CSF_STEPDefaults=$CSF_OCCTResourcePath/XSTEPResource
export CSF_XmlOcafResource=$CSF_OCCTResourcePath/XmlOcafResource
export CSF_MIGRATION_TYPES=$CSF_OCCTResourcePath/StdResource/MigrationSheet.txt
export CSF_DrawPluginDefaults=$CSF_OCCTResourcePath/DrawResources
export DRAWHOME=$CSF_OCCTResourcePath/DrawResources
export DRAWDEFAULT=$CSF_OCCTResourcePath/DrawResources/DrawDefault

@jpmlt
Copy link
jpmlt commented Oct 13, 2018

Hi Adam
Sorry not answering sooner, I was traveling those days. I confirm that the workaround works for me too.

Note that by unsettling CASROOT it runs even with the GTK issue, even if the result is ugly:

QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries.
So I have also to set as mention in another issue report:
export QT_STYLE_OVERRIDE=fusion
Maybe it could also be setup in run.py.

@adam-urbanczyk
Copy link
Member

Great, good to hear! I'll think about permanently adding the QT_STYLE_OVERRIDE=fusion to run.py but for now I am closing the issue. Thanks for trying out CQ-editor and for your extensive feedback!

@njourdane
Copy link
njourdane commented Aug 6, 2019

I'm facing to a similar issue. When I execute the ./runtests_locally.sh script, putting aside some warnings, almost all tests passes, except one that fails:

_______________________________________________________________________ ERROR at setup of test_render ________________________________________________________________________
SETUP ERROR: Qt exceptions in virtual methods:
________________________________________________________________________________
Traceback (most recent call last):
  File "/home/nath/divers/CQ-editor/cq_editor/widgets/viewer.py", line 162, in display_many
    context.Display(ais)
RuntimeError: Units_NoSuchType
BAD LEXICON descriptor

(complete stacktrace here)

I have the same error when I run the cq-editor command directly.

I also use Manjaro Arch, with the last version of CQ-editor, and the CASROOT environment variable is set to /usr.

If I unset it, cq-editor doesn't start: the process is still alive, taking 100% of the cpu, but nothing append.

I tried to export CASROOT to /usr/share/opencascade/, /usr/include/opencascade and /usr/local/include/oce without more success. I don't know which path I'm supposed to use here and how to find it.

@adam-urbanczyk
Copy link
Member

I vaguely remember seeing this before. Could you try compiling oce exactly like here:
https://raw.githubusercontent.com/CadQuery/conda-packages/master/oce-0.18.3/build.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
0