Closed tlnagy closed 7 years ago
What does Pkg.test("Gtk")
do? If it doesn't pass (and esp. if it gives a segfault), that's where to focus your energies: it's a required package for ProfileView.
It seems that they pass:
INFO: Testing Gtk
2016-04-28 19:53:05.650 julia[70192:1985934] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
WARNING: Method definition g_type(Type{##9#T<:Gtk.GtkWidget}) in module Gtk at /Users/tamasnagy/.julia/v0.4/Gtk/src/GLib/gtype.jl:181 overwritten in module Test at /Users/tamasnagy/.julia/v0.4/Gtk/src/GLib/gtype.jl:181.
The following messages:
WARNING: Error in @guarded callback
are expected and a sign of normal operation.
WARNING: Error in @guarded callback
ERROR: UndefVarError: k not defined
[inlined code] from /Users/tamasnagy/.julia/v0.4/Gtk/test/misc.jl:8
in anonymous at /Users/tamasnagy/.julia/v0.4/Gtk/src/base.jl:88
in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in process_options at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in _start at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
WARNING: Error in @guarded callback
ERROR: UndefVarError: k not defined
[inlined code] from /Users/tamasnagy/.julia/v0.4/Gtk/test/misc.jl:10
in bar2 at /Users/tamasnagy/.julia/v0.4/Gtk/src/base.jl:88
in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in process_options at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in _start at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
WARNING: Error in @guarded callback
ERROR: UndefVarError: k not defined
[inlined code] from /Users/tamasnagy/.julia/v0.4/Gtk/test/misc.jl:15
in bar3 at /Users/tamasnagy/.julia/v0.4/Gtk/src/base.jl:88
in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in process_options at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in _start at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
WARNING: Error in @guarded callback
ERROR: UndefVarError: k not defined
[inlined code] from /Users/tamasnagy/.julia/v0.4/Gtk/test/misc.jl:18
in bar4 at /Users/tamasnagy/.julia/v0.4/Gtk/src/base.jl:88
in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in process_options at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
in _start at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
INFO: Gtk tests passed
I tried using ProfileView
from within IJulia
and that works great, using it from the command line is what is causing the issue (probably something with gtk).
Boy, that's a tough one then. Fundamentally difficult for me to debug, since it doesn't doesn't happen for me. I might start by commenting out lines, e.g., these. It might help to at least know at which stage it crashes.
just adding that this also happens for me, also Mac. I have found that it crashes only when I also load PyPlot and actually plot something. What is this warning telling us, if anything? *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
julia> using ProfileView
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/ProfileView.ji for module ProfileView.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/Colors.ji for module Colors.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/FixedPointNumbers.ji for module FixedPointNumbers.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/ColorTypes.ji for module ColorTypes.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/GtkUtilities.ji for module GtkUtilities.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/Cairo.ji for module Cairo.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/Graphics.ji for module Graphics.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/Gtk.ji for module Gtk.
2016-05-24 17:42:14.108 julia[9275:1572183] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
2016-05-24 17:42:15.726 julia[9270:1571494] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/ProfileViewGtk.ji for module ProfileViewGtk.
2016-05-24 17:42:18.445 julia[9279:1573562] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/FileIO.ji for module FileIO.
julia> using PyPlot
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/PyPlot.ji for module PyPlot.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/PyCall.ji for module PyCall.
INFO: Recompiling stale cache file /Users/florian.oswald/.julia/lib/v0.4/LaTeXStrings.ji for module LaTeXStrings.
julia> f(x) = x.^2
f (generic function with 1 method)
julia> @profile [f(i) for i=1:10000000]
10000000-element Array{Int64,1}:
1
4
9
16
25
36
49
64
81
100
121
144
169
196
225
256
289
324
361
400
441
484
529
576
625
676
729
784
841
900
961
1024
1089
1156
1225
⋮
99999320001156
99999340001089
99999360001024
99999380000961
99999400000900
99999420000841
99999440000784
99999460000729
99999480000676
99999500000625
99999520000576
99999540000529
99999560000484
99999580000441
99999600000400
99999620000361
99999640000324
99999660000289
99999680000256
99999700000225
99999720000196
99999740000169
99999760000144
99999780000121
99999800000100
99999820000081
99999840000064
99999860000049
99999880000036
99999900000025
99999920000016
99999940000009
99999960000004
99999980000001
100000000000000
julia> ProfileView.view()
Gtk.GtkWindowLeaf(name="", parent, width-request=-1, height-request=-1, visible=TRUE, sensitive=TRUE, app-paintable=FALSE, can-focus=FALSE, has-focus=FALSE, is-focus=FALSE, can-default=FALSE, has-default=FALSE, receives-default=FALSE, composite-child=FALSE, style, events=0, no-show-all=FALSE, has-tooltip=FALSE, tooltip-markup=NULL, tooltip-text=NULL, window, opacity=1.000000, double-buffered, halign=GTK_ALIGN_FILL, valign=GTK_ALIGN_FILL, margin-left, margin-right, margin-start=0, margin-end=0, margin-top=0, margin-bottom=0, margin=0, hexpand=FALSE, vexpand=FALSE, hexpand-set=FALSE, vexpand-set=FALSE, expand=FALSE, scale-factor=2, border-width=0, resize-mode, child, type=GTK_WINDOW_TOPLEVEL, title="Profile", role=NULL, resizable=TRUE, modal=FALSE, window-position=GTK_WIN_POS_NONE, default-width=-1, default-height=-1, destroy-with-parent=FALSE, hide-titlebar-when-maximized=FALSE, icon, icon-name=NULL, screen, type-hint=GDK_WINDOW_TYPE_HINT_NORMAL, skip-taskbar-hint=FALSE, skip-pager-hint=FALSE, urgency-hint=FALSE, accept-focus=TRUE, focus-on-map=TRUE, decorated=TRUE, deletable=TRUE, gravity=GDK_GRAVITY_NORTH_WEST, transient-for, attached-to, has-resize-grip, resize-grip-visible, application, is-active=FALSE, has-toplevel-focus=FALSE, startup-id, mnemonics-visible=FALSE, focus-visible=FALSE, is-maximized=FALSE)
julia> plot(1:10)
2016-05-24 17:45:05.910 julia[9270:1571494] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fd3fd0690f0
2016-05-24 17:45:05.911 julia[9270:1571494] An uncaught exception was raised
2016-05-24 17:45:05.911 julia[9270:1571494] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fd3fd0690f0
2016-05-24 17:45:05.911 julia[9270:1571494] (
0 CoreFoundation 0x00007fff8af7403c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8503876e objc_exception_throw + 43
2 CoreFoundation 0x00007fff8af770ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff8aebce24 ___forwarding___ + 1028
4 CoreFoundation 0x00007fff8aebc998 _CF_forwarding_prep_0 + 120
5 Tk 0x000000031ad9d527 TkpInit + 476
6 Tk 0x000000031ad17aca Tk_Init + 1788
7 _tkinter.so 0x000000031abf4b95 Tcl_AppInit + 82
8 _tkinter.so 0x000000031abeff7f init_tkinter + 2961
9 Python 0x0000000319e65d8c PyEval_EvalFrameEx + 14342
10 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
11 Python 0x0000000319e065de PyFunction_SetClosure + 826
12 Python 0x0000000319de850a PyObject_Call + 99
13 Python 0x0000000319df32f7 PyMethod_New + 1210
14 Python 0x0000000319de850a PyObject_Call + 99
15 Python 0x0000000319e683df PyEval_CallObjectWithKeywords + 93
16 Python 0x0000000319df1571 PyInstance_New + 126
17 Python 0x0000000319de850a PyObject_Call + 99
18 Python 0x0000000319e65399 PyEval_EvalFrameEx + 11795
19 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
20 Python 0x0000000319e68bf1 _PyEval_SliceIndex + 757
21 Python 0x0000000319e659a6 PyEval_EvalFrameEx + 13344
22 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
23 Python 0x0000000319e065de PyFunction_SetClosure + 826
24 Python 0x0000000319de850a PyObject_Call + 99
25 Python 0x0000000319e64f82 PyEval_EvalFrameEx + 10748
26 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
27 Python 0x0000000319e68bf1 _PyEval_SliceIndex + 757
28 Python 0x0000000319e659a6 PyEval_EvalFrameEx + 13344
29 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
30 Python 0x0000000319e68bf1 _PyEval_SliceIndex + 757
31 Python 0x0000000319e659a6 PyEval_EvalFrameEx + 13344
32 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
33 Python 0x0000000319e68bf1 _PyEval_SliceIndex + 757
34 Python 0x0000000319e659a6 PyEval_EvalFrameEx + 13344
35 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
36 Python 0x0000000319e065de PyFunction_SetClosure + 826
37 Python 0x0000000319de850a PyObject_Call + 99
38 ??? 0x00000003208464ff 0x0 + 13430449407
39 libjulia.dylib 0x000000010204cdf6 jl_apply_generic + 422
40 libjulia.dylib 0x0000000102054ca5 jl_f_apply + 1173
41 ??? 0x0000000320845cb3 0x0 + 13430447283
42 libjulia.dylib 0x000000010204cdf6 jl_apply_generic + 422
43 libjulia.dylib 0x0000000102054ca5 jl_f_apply + 1173
44 ??? 0x00000003208458e0 0x0 + 13430446304
45 libjulia.dylib 0x000000010204cdf6 jl_apply_generic + 422
46 libjulia.dylib 0x0000000102054ca5 jl_f_apply + 1173
47 ??? 0x00000003208452cb 0x0 + 13430444747
48 libjulia.dylib 0x000000010204cdf6 jl_apply_generic + 422
49 libjulia.dylib 0x00000001020b1734 do_call + 244
50 libjulia.dylib 0x00000001020afbcf eval + 1823
51 libjulia.dylib 0x00000001020c3f19 jl_toplevel_eval_flex + 1321
52 libjulia.dylib 0x0000000102055465 jl_toplevel_eval_in + 789
53 ??? 0x00000003065dd1db 0x0 + 12991713755
54 ??? 0x00000003065dcdb7 0x0 + 12991712695
55 libjulia.dylib 0x000000010204cd83 jl_apply_generic + 307
56 ??? 0x00000003065d7852 0x0 + 12991690834
57 libjulia.dylib 0x00000001020b7d38 start_task + 392
)
2016-05-24 17:45:05.912 julia[9270:1571494] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fd3fd0690f0'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8af7403c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8503876e objc_exception_throw + 43
2 CoreFoundation 0x00007fff8af770ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff8aebce24 ___forwarding___ + 1028
4 CoreFoundation 0x00007fff8aebc998 _CF_forwarding_prep_0 + 120
5 Tk 0x000000031ad9d527 TkpInit + 476
6 Tk 0x000000031ad17aca Tk_Init + 1788
7 _tkinter.so 0x000000031abf4b95 Tcl_AppInit + 82
8 _tkinter.so 0x000000031abeff7f init_tkinter + 2961
9 Python 0x0000000319e65d8c PyEval_EvalFrameEx + 14342
10 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
11 Python 0x0000000319e065de PyFunction_SetClosure + 826
12 Python 0x0000000319de850a PyObject_Call + 99
13 Python 0x0000000319df32f7 PyMethod_New + 1210
14 Python 0x0000000319de850a PyObject_Call + 99
15 Python 0x0000000319e683df PyEval_CallObjectWithKeywords + 93
16 Python 0x0000000319df1571 PyInstance_New + 126
17 Python 0x0000000319de850a PyObject_Call + 99
18 Python 0x0000000319e65399 PyEval_EvalFrameEx + 11795
19 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
20 Python 0x0000000319e68bf1 _PyEval_SliceIndex + 757
21 Python 0x0000000319e659a6 PyEval_EvalFrameEx + 13344
22 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
23 Python 0x0000000319e065de PyFunction_SetClosure + 826
24 Python 0x0000000319de850a PyObject_Call + 99
25 Python 0x0000000319e64f82 PyEval_EvalFrameEx + 10748
26 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
27 Python 0x0000000319e68bf1 _PyEval_SliceIndex + 757
28 Python 0x0000000319e659a6 PyEval_EvalFrameEx + 13344
29 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
30 Python 0x0000000319e68bf1 _PyEval_SliceIndex + 757
31 Python 0x0000000319e659a6 PyEval_EvalFrameEx + 13344
32 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
33 Python 0x0000000319e68bf1 _PyEval_SliceIndex + 757
34 Python 0x0000000319e659a6 PyEval_EvalFrameEx + 13344
35 Python 0x0000000319e62352 PyEval_EvalCodeEx + 1409
36 Python 0x0000000319e065de PyFunction_SetClosure + 826
37 Python 0x0000000319de850a PyObject_Call + 99
38 ??? 0x00000003208464ff 0x0 + 13430449407
39 libjulia.dylib 0x000000010204cdf6 jl_apply_generic + 422
40 libjulia.dylib 0x0000000102054ca5 jl_f_apply + 1173
41 ??? 0x0000000320845cb3 0x0 + 13430447283
42 libjulia.dylib 0x000000010204cdf6 jl_apply_generic + 422
43 libjulia.dylib 0x0000000102054ca5 jl_f_apply + 1173
44 ??? 0x00000003208458e0 0x0 + 13430446304
45 libjulia.dylib 0x000000010204cdf6 jl_apply_generic + 422
46 libjulia.dylib 0x0000000102054ca5 jl_f_apply + 1173
47 ??? 0x00000003208452cb 0x0 + 13430444747
48 libjulia.dylib 0x000000010204cdf6 jl_apply_generic + 422
49 libjulia.dylib 0x00000001020b1734 do_call + 244
50 libjulia.dylib 0x00000001020afbcf eval + 1823
51 libjulia.dylib 0x00000001020c3f19 jl_toplevel_eval_flex + 1321
52 libjulia.dylib 0x0000000102055465 jl_toplevel_eval_in + 789
53 ??? 0x00000003065dd1db 0x0 + 12991713755
54 ??? 0x00000003065dcdb7 0x0 + 12991712695
55 libjulia.dylib 0x000000010204cd83 jl_apply_generic + 307
56 ??? 0x00000003065d7852 0x0 + 12991690834
57 libjulia.dylib 0x00000001020b7d38 start_task + 392
)
libc++abi.dylib: terminating with uncaught exception of type NSException
signal (6): Abort trap: 6
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
[1] 9270 abort julia
I have found that it crashes only when I also load PyPlot and actually plot something.
Nice detective work! @tlnagy, does that apply for you, too?
Which PyPlot GUI toolkit are you using? It would be worth experimenting with alternate choices to see if that fixes or exacerbates the problem.
What is this warning telling us, if anything? *\ WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
My guess is that's from libgtk
itself; grepping for userSpaceScaleFactor
in either Gtk.jl or ProfileView.jl yields nothing.
I have the same experience - crashing when combining PyPlot and ProfileView in a session - on a couple of Linux installations (Julia 0.4.x, python via Anaconda). On my systems, the Gtk.jl tests pass, and ProfileView runs fine by itself. I haven't succeeded in setting up the Gtk toolkit for PyPlot (which uses Qt instead), so can't say if that makes them compatible. Perhaps you can change the title of this issue, since it's not an OS X problem? In fact, it should probably be a Gtk.jl issue, but I don't know how to make a good test case to show that. Using separate sessions for PyPlot and ProfileView is only a minor inconvenience.
Just to note that this happens with just Gtk, for example with this script. https://github.com/JuliaGraphics/Gtk.jl/issues/193 suggests this should be solvable by changing the PyPlot backend.
I think this isn't an issue if you use https://github.com/JuliaGraphics/Gtk.jl/issues/193, so closing.
here's my
versioninfo
: