timholy / ProfileView.jl

Visualization of Julia profiling data
MIT License
357 stars 39 forks source link

ProfileView + PyPlot can lead to segfaults #53

Closed tlnagy closed 7 years ago

tlnagy commented 8 years ago
ProfileView.view()
2016-04-28 16:21:57.183 julia[68300:1933305] -[__NSCFType symbolicTraits]: unrecognized selector sent to instance 0x7fa30eeb90d0
2016-04-28 16:21:57.196 julia[68300:1933305] An uncaught exception was raised
2016-04-28 16:21:57.196 julia[68300:1933305] -[__NSCFType symbolicTraits]: unrecognized selector sent to instance 0x7fa30eeb90d0
2016-04-28 16:21:57.196 julia[68300:1933305] (
    0   CoreFoundation                      0x00007fff82f7dae2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff98c41f7e objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff82f80b9d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00007fff82eb9601 ___forwarding___ + 1009
    4   CoreFoundation                      0x00007fff82eb9188 _CF_forwarding_prep_0 + 120
    5   UIFoundation                        0x00007fff95b867c0 -[__NSFontTypefaceInfo _postscriptName] + 345
    6   UIFoundation                        0x00007fff95b85b23 +[__NSFontTypefaceInfo typefaceInfoForPostscriptName:options:] + 949
    7   UIFoundation                        0x00007fff95b8c56f __NSGetMetaFontInstance + 983
    8   libgdk-3.0.dylib                    0x000000031fa45796 _gdk_quartz_screen_get_setting + 392
    9   libgtk-3.dylib                      0x0000000320934549 gtk_settings_get_property + 198
    10  libgobject-2.0.dylib                0x00000003122c6c92 g_object_get_valist + 254
    11  libgobject-2.0.dylib                0x00000003122c7130 g_object_get + 177
    12  libgtk-3.dylib                      0x0000000320839459 _gtk_css_font_size_get_default + 50
    13  libgtk-3.dylib                      0x0000000320839c56 gtk_css_value_font_size_compute + 80
    14  libgtk-3.dylib                      0x000000032083feec gtk_css_value_initial_compute + 220
    15  libgtk-3.dylib                      0x000000032084fd1c gtk_css_static_style_compute_value + 106
    16  libgtk-3.dylib                      0x0000000320840da7 _gtk_css_lookup_resolve + 129
    17  libgtk-3.dylib                      0x000000032084fc9a gtk_css_static_style_new_compute + 114
    18  libgtk-3.dylib                      0x000000032084fc05 gtk_css_static_style_get_default + 84
    19  libgtk-3.dylib                      0x0000000320841877 gtk_css_node_init + 23
    20  libgobject-2.0.dylib                0x00000003122d8556 g_type_create_instance + 625
    21  libgobject-2.0.dylib                0x00000003122c60c0 g_object_new_internal + 52
    22  libgobject-2.0.dylib                0x00000003122c5b94 g_object_newv + 488
    23  libgtk-3.dylib                      0x0000000320856501 gtk_css_widget_node_new + 30
    24  libgtk-3.dylib                      0x00000003209b34f5 gtk_widget_init + 353
    25  libgobject-2.0.dylib                0x00000003122d8556 g_type_create_instance + 625
    26  libgobject-2.0.dylib                0x00000003122c60c0 g_object_new_internal + 52
    27  libgobject-2.0.dylib                0x00000003122c5b94 g_object_newv + 488
    28  ???                                 0x000000031fd4356b 0x0 + 13418902891
    29  ???                                 0x000000031fd3cda4 0x0 + 13418876324
    30  ???                                 0x000000031fd3ca88 0x0 + 13418875528
    31  libjulia.dylib                      0x0000000104329514 jl_apply_generic + 404
    32  ???                                 0x000000031fd3c921 0x0 + 13418875169
    33  ???                                 0x000000031fd3c425 0x0 + 13418873893
    34  ???                                 0x000000031fd3be9e 0x0 + 13418872478
    35  ???                                 0x000000031fd3bdb0 0x0 + 13418872240
    36  libjulia.dylib                      0x0000000104329514 jl_apply_generic + 404
    37  libjulia.dylib                      0x000000010439d464 do_call + 244
    38  libjulia.dylib                      0x000000010439b9be eval + 1838
    39  libjulia.dylib                      0x00000001043afefc jl_toplevel_eval_flex + 1388
    40  libjulia.dylib                      0x0000000104331f6f jl_toplevel_eval_in + 655
    41  ???                                 0x00000003089cdd14 0x0 + 13029399828
    42  ???                                 0x00000003089cd967 0x0 + 13029398887
    43  libjulia.dylib                      0x00000001043294aa jl_apply_generic + 298
    44  ???                                 0x00000003089bdf52 0x0 + 13029334866
    45  libjulia.dylib                      0x00000001043a3b2f start_task + 383
)
2016-04-28 16:21:57.197 julia[68300:1933305] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType symbolicTraits]: unrecognized selector sent to instance 0x7fa30eeb90d0'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff82f7dae2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff98c41f7e objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff82f80b9d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00007fff82eb9601 ___forwarding___ + 1009
    4   CoreFoundation                      0x00007fff82eb9188 _CF_forwarding_prep_0 + 120
    5   UIFoundation                        0x00007fff95b867c0 -[__NSFontTypefaceInfo _postscriptName] + 345
    6   UIFoundation                        0x00007fff95b85b23 +[__NSFontTypefaceInfo typefaceInfoForPostscriptName:options:] + 949
    7   UIFoundation                        0x00007fff95b8c56f __NSGetMetaFontInstance + 983
    8   libgdk-3.0.dylib                    0x000000031fa45796 _gdk_quartz_screen_get_setting + 392
    9   libgtk-3.dylib                      0x0000000320934549 gtk_settings_get_property + 198
    10  libgobject-2.0.dylib                0x00000003122c6c92 g_object_get_valist + 254
    11  libgobject-2.0.dylib                0x00000003122c7130 g_object_get + 177
    12  libgtk-3.dylib                      0x0000000320839459 _gtk_css_font_size_get_default + 50
    13  libgtk-3.dylib                      0x0000000320839c56 gtk_css_value_font_size_compute + 80
    14  libgtk-3.dylib                      0x000000032083feec gtk_css_value_initial_compute + 220
    15  libgtk-3.dylib                      0x000000032084fd1c gtk_css_static_style_compute_value + 106
    16  libgtk-3.dylib                      0x0000000320840da7 _gtk_css_lookup_resolve + 129
    17  libgtk-3.dylib                      0x000000032084fc9a gtk_css_static_style_new_compute + 114
    18  libgtk-3.dylib                      0x000000032084fc05 gtk_css_static_style_get_default + 84
    19  libgtk-3.dylib                      0x0000000320841877 gtk_css_node_init + 23
    20  libgobject-2.0.dylib                0x00000003122d8556 g_type_create_instance + 625
    21  libgobject-2.0.dylib                0x00000003122c60c0 g_object_new_internal + 52
    22  libgobject-2.0.dylib                0x00000003122c5b94 g_object_newv + 488
    23  libgtk-3.dylib                      0x0000000320856501 gtk_css_widget_node_new + 30
    24  libgtk-3.dylib                      0x00000003209b34f5 gtk_widget_init + 353
    25  libgobject-2.0.dylib                0x00000003122d8556 g_type_create_instance + 625
    26  libgobject-2.0.dylib                0x00000003122c60c0 g_object_new_internal + 52
    27  libgobject-2.0.dylib                0x00000003122c5b94 g_object_newv + 488
    28  ???                                 0x000000031fd4356b 0x0 + 13418902891
    29  ???                                 0x000000031fd3cda4 0x0 + 13418876324
    30  ???                                 0x000000031fd3ca88 0x0 + 13418875528
    31  libjulia.dylib                      0x0000000104329514 jl_apply_generic + 404
    32  ???                                 0x000000031fd3c921 0x0 + 13418875169
    33  ???                                 0x000000031fd3c425 0x0 + 13418873893
    34  ???                                 0x000000031fd3be9e 0x0 + 13418872478
    35  ???                                 0x000000031fd3bdb0 0x0 + 13418872240
    36  libjulia.dylib                      0x0000000104329514 jl_apply_generic + 404
    37  libjulia.dylib                      0x000000010439d464 do_call + 244
    38  libjulia.dylib                      0x000000010439b9be eval + 1838
    39  libjulia.dylib                      0x00000001043afefc jl_toplevel_eval_flex + 1388
    40  libjulia.dylib                      0x0000000104331f6f jl_toplevel_eval_in + 655
    41  ???                                 0x00000003089cdd14 0x0 + 13029399828
    42  ???                                 0x00000003089cd967 0x0 + 13029398887
    43  libjulia.dylib                      0x00000001043294aa jl_apply_generic + 298
    44  ???                                 0x00000003089bdf52 0x0 + 13029334866
    45  libjulia.dylib                      0x00000001043a3b2f start_task + 383
)
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]    68300 abort      julia

here's my versioninfo:

Julia Version 0.4.5
Commit 2ac304d* (2016-03-18 00:58 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.4.0)
  CPU: Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
timholy commented 8 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.

tlnagy commented 8 years ago

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).

timholy commented 8 years ago

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.

floswald commented 8 years ago

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
timholy commented 8 years ago

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.

RalphAS commented 8 years ago

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.

timholy commented 8 years ago

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.

timholy commented 7 years ago

I think this isn't an issue if you use https://github.com/JuliaGraphics/Gtk.jl/issues/193, so closing.