Skip to content
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

on OS X, unrecognized selector crash with Julia 0.5 and PyPlot 2.2.4 #253

Closed
protogeezer opened this issue Oct 18, 2016 · 9 comments
Closed

Comments

@protogeezer
Copy link

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-apple-darwin15.6.0

julia> using Gadfly, PyCall, PyPlot
/Users/sjbespa/anaconda2/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

julia> fig = PyPlot.plt[:figure]()
2016-10-18 14:25:59.951 julia[1413:193212] -[__NSCFType symbolicTraits]: unrecognized selector sent to instance 0x7fe289562d00

If Gadfly is referenced after PyCall and PyPlot, the error doesn't happen...

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-apple-darwin15.6.0

julia> using PyCall, PyPlot, Gadfly
/Users/sjbespa/anaconda2/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

julia> fig = PyPlot.plt[:figure]()
PyPlot.Figure(PyObject <matplotlib.figure.Figure object at 0x32cfd2d50>)
@stevengj
Copy link
Member

Presumably there is no problem if you don't use Gadfly at all?

@tlnagy, any idea why there would be a Gadfly/PyPlot conflict?

@protogeezer
Copy link
Author

The literal answer to your question is no - there are frequent crashes with PyPlot and PyCall whether Gadfly is loaded or not. I filed this issue because the crash was reproducible.

So, it's the other way around. I'm trying to figure out how to eliminate the need for Python, or matplotlib in particular. Gadfly is gaining altitude again, and since Gadfly graphics are so much nicer than marplotlib, that's where I'm going to invest my time.

@tlnagy

@tlnagy
Copy link

tlnagy commented Oct 27, 2016

Huh. This is really weird. What's your versioninfo()?

@protogeezer
Copy link
Author

Spooky is how i’d describe it. If you need me to jettison all the parts of Gallium I installed in a vain attempt to get the debugger working, let me know.

Aside: When you are able and willing, I’d like to correspond about my interest in building a high performance/full featured graphics backend (or middle layer) for Gadfly. One thought is to sub-in Qt for the quasi-gnome julia seems to favor now. The other thought is to to distinguish Macs with a no-holds-barred Cocoa backend. Either would allow direct use of the window system to manage layouts, and utilize something like VTK and ITK as the 2d/3d engines.

In any event, there isn’t much of a rush - this will be a hobby with the intent of having something by julia 1.0…

The tricky part that I need to make sure I’m totally in sync with is that anything that is truly cross platform and pro-grade will require a redo of the julia runtime - most specifically getting rid of libUV. That is not something that is worth doing if there isn’t much interest in a better graphics engine.

Stephen

et-imac-retina:~ sjbespa$ julia
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "?help" for help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.5.0 (2016-09-19 18:14 UTC)
/ |_'|||__'| |
|__/ | x86_64-apple-darwin15.6.0

julia> VERSION
v"0.5.0"

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin15.6.0)
CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

julia> Pkg.status()
16 required packages:

  • CLBLAS 0.1.0+ refactor-for-0.5
  • Cairo 0.2.35
  • DataArrays 0.3.9
  • Fontconfig 0.1.1
  • GLM 0.6.1
  • GSL 0.3.5
  • Gadfly 0.5.2
  • Gallium 0.0.4+ master
  • MixedModels 0.6.2
  • NLopt 0.3.3
  • OpenCL 0.5.0
  • Polynomials 0.1.0
  • PyCall 1.7.2
  • PyPlot 2.2.4
  • RCall 0.6.0
  • RData 0.0.4
    68 additional packages:
  • ASTInterpreter 0.0.4+ master
  • AbstractTrees 0.0.4+ master
  • ArgParse 0.4.0
  • AxisAlgorithms 0.1.5
  • BinDeps 0.4.5
  • COFF 0.0.2+ master
  • CRC 1.2.0
  • Calculus 0.1.15
  • CategoricalArrays 0.1.0
  • ChebyshevApprox 0.0.0- master (unregistered)
  • ColorTypes 0.2.12
  • Colors 0.6.9
  • Combinatorics 0.3.2
  • Compat 0.9.3
  • Compose 0.4.4
  • Conda 0.3.2
  • Contour 0.2.0
  • DWARF 0.1.0 master
  • DataFrames 0.8.4
  • DataStructures 0.4.6
  • Distances 0.3.2
  • Distributions 0.11.0
  • ELF 0.1.0+ master
  • FileIO 0.2.0
  • FixedPointNumbers 0.2.1
  • FixedSizeArrays 0.2.4
  • ForwardDiff 0.2.5
  • GZip 0.2.20
  • Graphics 0.1.3
  • Hexagons 0.0.4
  • Hiccup 0.0.3
  • Homebrew 0.4.0
  • Interpolations 0.3.6
  • Iterators 0.2.0
  • JSON 0.8.0
  • JuliaParser 0.7.4+ master
  • Juno 0.2.3
  • KernelDensity 0.3.0
  • LaTeXStrings 0.2.0
  • Lazy 0.11.4
  • Loess 0.1.0
  • MachO 0.0.4 master
  • MacroTools 0.3.2
  • MathProgBase 0.5.7
  • Measures 0.0.3
  • Media 0.2.3
  • NaNMath 0.2.1
  • NamedArrays 0.5.2
  • NullableArrays 0.0.10
  • ObjFileBase 0.0.4 master
  • Optim 0.6.1
  • PDMats 0.5.0
  • PositiveFactorizations 0.0.2
  • Ratios 0.0.4
  • Reactive 0.3.6 master
  • Reexport 0.0.3
  • Rmath 0.1.4
  • SHA 0.2.1
  • Showoff 0.0.7
  • SortingAlgorithms 0.1.0
  • StatsBase 0.11.1
  • StatsFuns 0.3.1
  • StructIO 0.0.2+ master
  • TerminalUI 0.0.2+ master
  • TextWrap 0.1.6
  • URIParser 0.1.6
  • VT100 0.0.2+ master
  • WoodburyMatrices 0.2.0

julia>

On Oct 27, 2016, at 12:49 PM, Tamas Nagy [email protected] wrote:

Huh. This is really weird. What's your versioninfo()?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@tlnagy
Copy link

tlnagy commented Oct 28, 2016

I don't think I could dedicate much time to such a project, but it would be cool to have. You can email me at my email address on my github profile. And to be honest, I don't know what is going on here. I agree that it seems spooky, maybe @shashi knows?

@protogeezer
Copy link
Author

What I’m asking for is maybe exchanging a dozen or two emails to make sure what I go off and work on is ultimately valuable. I don’t believe that I need much help once I have a clear vision of what I’m setting out to accomplish.

Really, you have brought Gadfly back from the brink. That’s huge! My intent is to build a more capable framework to make it even better.

I’ll do more digging to see if I can narrow down what’s going on wrt PyPlot vs Gadfly.

Stephen

On Oct 28, 2016, at 12:02 PM, Tamas Nagy [email protected] wrote:

I don't think I could dedicate much time to such a project, but it would be cool to have. And to be honest, I don't know what is going on here. I agree that it seems spooky, maybe @shashi knows?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@cstjean
Copy link

cstjean commented Nov 25, 2018

I'm getting this error on a fresh julia 1.0.2 session

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2 (2018-11-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using PyPlot

julia> plot([1,2])
2018-11-25 17:30:28.874 julia[664:9436] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fac1dca1b00
2018-11-25 17:30:28.882 julia[664:9436] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fac1dca1b00'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff3285c23b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fff59adbc76 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff328f4d94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff327d2700 ___forwarding___ + 1456
	4   CoreFoundation                      0x00007fff327d20c8 _CF_forwarding_prep_0 + 120
	5   libtk8.6.dylib                      0x0000000135bf731d TkpInit + 413
	6   libtk8.6.dylib                      0x0000000135b4f17e Initialize + 2622
	7   _tkinter.cpython-37m-darwin.so      0x0000000135138a0f _tkinter_create + 1183
	8   libpython3.7m.dylib                 0x0000000123eea2b9 _PyMethodDef_RawFastCallKeywords + 681
	9   libpython3.7m.dylib                 0x0000000123eea3bd _PyCFunction_FastCallKeywords + 45
	10  libpython3.7m.dylib                 0x0000000123ff3c4b call_function + 603
	11  libpython3.7m.dylib                 0x0000000123feae45 _PyEval_EvalFrameDefault + 7893
	12  libpython3.7m.dylib                 0x0000000123fe8ad9 _PyEval_EvalCodeWithName + 3305
	13  libpython3.7m.dylib                 0x0000000123ee91b1 _PyFunction_FastCallDict + 481
	14  libpython3.7m.dylib                 0x0000000123eeaba4 _PyObject_Call_Prepend + 164
	15  libpython3.7m.dylib                 0x0000000123f525aa slot_tp_init + 298
	16  libpython3.7m.dylib                 0x0000000123f5bca7 type_call + 295
	17  libpython3.7m.dylib                 0x0000000123ee9e73 _PyObject_FastCallKeywords + 691
	18  libpython3.7m.dylib                 0x0000000123ff3cb4 call_function + 708
	19  libpython3.7m.dylib                 0x0000000123feaf6c _PyEval_EvalFrameDefault + 8188
	20  libpython3.7m.dylib                 0x0000000123ee9a6e function_code_fastcall + 254
	21  libpython3.7m.dylib                 0x0000000123ff3cbe call_function + 718
	22  libpython3.7m.dylib                 0x0000000123feae45 _PyEval_EvalFrameDefault + 7893
	23  libpython3.7m.dylib                 0x0000000123fe8ad9 _PyEval_EvalCodeWithName + 3305
	24  libpython3.7m.dylib                 0x0000000123ee91b1 _PyFunction_FastCallDict + 481
	25  libpython3.7m.dylib                 0x0000000123eeaba4 _PyObject_Call_Prepend + 164
	26  libpython3.7m.dylib                 0x0000000123eec5b4 method_call + 36
	27  libpython3.7m.dylib                 0x0000000123eea5b6 PyObject_Call + 246
	28  libpython3.7m.dylib                 0x0000000123feb1b5 _PyEval_EvalFrameDefault + 8773
	29  libpython3.7m.dylib                 0x0000000123fe8ad9 _PyEval_EvalCodeWithName + 3305
	30  libpython3.7m.dylib                 0x0000000123ee91b1 _PyFunction_FastCallDict + 481
	31  ???                                 0x000000010bf38aba 0x0 + 4495477434
	32  ???                                 0x000000010bf3e547 0x0 + 4495500615
	33  ???                                 0x000000010bf5c978 0x0 + 4495624568
	34  libjulia.1.0.dylib                  0x0000000106b1aba3 jl_fptr_trampoline + 51
	35  ???                                 0x000000010bf5c886 0x0 + 4495624326
	36  libjulia.1.0.dylib                  0x0000000106b2b592 jl_f__apply + 1218
	37  libjulia.1.0.dylib                  0x0000000106b2ba2f jl_f__apply_latest + 63
	38  ???                                 0x000000010bf5c455 0x0 + 4495623253
	39  ???                                 0x000000010bf5a25e 0x0 + 4495614558
	40  ???                                 0x000000010bf5a384 0x0 + 4495614852
	41  ???                                 0x000000010bf59c77 0x0 + 4495613047
	42  ???                                 0x000000010bf07b8c 0x0 + 4495276940
)
libc++abi.dylib: terminating with uncaught exception of type NSException

signal (6): Abort trap: 6
in expression starting at no file:0
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 23709184 (Pool: 23704428; Big: 4756); GC: 52

[Process completed]

julia> versioninfo()
Julia Version 1.0.2
Commit d789231e99 (2018-11-08 20:11 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)

@tkf
Copy link
Member

tkf commented Nov 26, 2018

@cstjean Probably it's yet another #410 (just by pattern matching TkpInit). It looks like pygui(:qt5) after installing dependencies works.

@stevengj
Copy link
Member

stevengj commented May 8, 2019

Closing as a dup of #410

@stevengj stevengj closed this as completed May 8, 2019
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