Opened 5 years ago

Last modified 3 years ago

#57786 assigned defect

py37-graph-tool graph_draw throws segmentation fault without XQuartz running

Reported by: ssllmit (ss) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: mamoll (Mark Moll)
Port: py-graph-tool

Description

py37-graph-tool's method graph_draw throws a segmentation fault without an X11 server running (also an issue with previous versions).

This may be an upstream issue, but throwing a segmentation fault is almost always a bad idea.

First, make sure X11 isn't running. Everything works fine when it is.

ps -ef | grep XQuartz | grep -v grep
import graph_tool.all as gt
g = gt.Graph()
v0 = g.add_vertex(); v1 = g.add_vertex(); v2 = g.add_vertex();
e01 = g.add_edge(v0,v1); e12 = g.add_edge(v1,v2); e20 = g.add_edge(v2,v0);
gt.graph_draw(g)


Segmentation fault: 11

Versions:

$ port installed py37-graph-tool depof:py37-graph-tool
The following ports are currently installed:
  boost @1.66.0_3+no_single+no_static+python37 (active)
  cairomm @1.12.2_0+x11 (active)
  cgal @4.13_0 (active)
  clang-7.0 @7.0.0_1+analyzer+libstdcxx (active)
  expat @2.2.6_1 (active)
  graphviz @2.40.1_1+pangocairo+x11 (active)
  libomp @7.0.0_0+universal (active)
  pkgconfig @0.29.2_0 (active)
  py37-cairo @1.18.0_0 (active)
  py37-gobject3 @3.28.3_0 (active)
  py37-graph-tool @2.27_2+clang70+openmp (active)
  py37-numpy @1.15.4_0+gfortran (active)
  py37-scipy @1.1.0_1+gfortran (active)
  python37 @3.7.1_0 (active)
  sparsehash @2.0.3_1 (active)

Change History (4)

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Owner: set to count0
Port: py-graph-tool added; py37-graph-tool removed
Status: newassigned

comment:2 Changed 5 years ago by mamoll (Mark Moll)

This is very odd. If I don't have X11 running and run the python code above, it works, but I do get this error:

** (.:50936): WARNING **: 10:09:54.255: Failed to load shared library 'libcairo-gobject.2.dylib' referenced by the typelib: dlopen(libcairo-gobject.2.dylib, 9): image not found

(and the X11 server is automatically launched in the background.) If I launch python like so:

env DYLD_LIBRARY_PATH=/opt/local/lib python

then things crash right after the import statement:

env DYLD_LIBRARY_PATH=/opt/local/lib python
Python 3.7.1 (default, Oct 23 2018, 09:39:32) 
[Clang 10.0.0 (clang-1000.11.45.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import graph_tool.all as gt
/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graph_tool/draw/cairo_draw.py:39: RuntimeWarning: Error importing cairo. Graph drawing will not work.
  warnings.warn(msg, RuntimeWarning)
/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graph_tool/draw/cairo_draw.py:39: RuntimeWarning: Error importing cairo. Graph drawing will not work.
  warnings.warn(msg, RuntimeWarning)
Segmentation fault: 11

I have py37-graph-tool @2.27_2+clang70+gtk3+openmp installed.

comment:3 Changed 5 years ago by mamoll (Mark Moll)

Some more detailed info when just importing Cairo:

env DYLD_LIBRARY_PATH=/opt/local/lib python
Python 3.7.1 (default, Oct 23 2018, 09:39:32) 
[Clang 10.0.0 (clang-1000.11.45.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cairo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cairo/__init__.py", line 1, in <module>
    from ._cairo import *  # noqa: F401,F403
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cairo/_cairo.cpython-37m-darwin.so, 2): Symbol not found: _iconv
  Referenced from: /usr/lib/libmecab.1.0.0.dylib
  Expected in: /opt/local/lib/libiconv.2.dylib
 in /usr/lib/libmecab.1.0.0.dylib

That same command works fine without the env DYLD_LIBRARY_PATH=/opt/local/lib bit.

Last edited 5 years ago by mamoll (Mark Moll) (previous) (diff)

comment:4 Changed 3 years ago by mf2k (Frank Schima)

Owner: count0 deleted
Note: See TracTickets for help on using tickets.