Fatal error after include-workspace-include

bug

#1

I get a rather weird reproducible error that crashes Julia in REPL and freezes it in Jupyter. The error happens whenever I use include followed by workspace then include again. I am using v0.50.

The code I run is:

include("test_prep.jl")
#Some tests and debugging
workspace()
include("test_prep.jl")

Here is the content of test_prep.jl:

include("VTKDataTypes\\src\\VTKDataTypes.jl")
include("VTKDataIO\\src\\VTKDataIO.jl")

using VTKDataTypes
using VTKDataIO

Here is the content of VTKDataTypes.jl:


module VTKDataTypes

using WriteVTK

include("vtkcelltypes.jl")
include("types.jl")
include("utils.jl")
include("validation.jl")
include("typeconversion.jl")

export AbstractVTKData, AbstractStaticVTKData, AbstractTimeSeriesVTKData
export AbstractVTKSimpleData, AbstractVTKMultiblockData
export AbstractVTKUnstructuredData, AbstractVTKStructuredData, AbstractVTKRectilinearData
export VTKUnstructuredData, VTKStructuredData, VTKRectilinearData, VTKUniformRectilinear, VTKImageData
export VTK_CELL_TYPE, POINT_CELLS, LINE_CELLS, FACE_CELLS, VOLUME_CELLS
export LINEAR_CELLS, QUADRATIC_CELLS, CUBIC_CELLS, HIGHER_ORDER_CELLS, HIGHER_ORDER_PARAMETRIC_CELLS, SPECIAL_CELLS
export promote_rule, size, length, getindex, endof, start, next, done
export same_geometry, ==, same_ordered_geometry, same_geometry_shape, same_data_shape, coherent
export extents, dim, num_of_points, num_of_cells, num_of_point_vars, num_of_cell_vars
export cell_type, cell_connectivity, has_var, var_dim, vtk_cell_type_name, is_homogeneous, filter_cells!
export keep_volume_cells_only!, keep_face_cells_only!, get_cell_ids, get_lowest_index, get_highest_index
export is_valid_cell, add_new_cell, remove_cell!, add_point_id_offset!, append!, append
export num_of_blocks, insert_new_block!, remove_block!, timespan, num_of_timesteps, insert_timed_data!
export remove_timed_data!, remove_timed_data!, is_valid, convert

end

Here is the content of VTKDataIO.jl:

module VTKDataIO

using VTKDataTypes
using WriteVTK
using PyCall
@pyimport paraview.simple as pv
@pyimport paraview.servermanager as ps
@pyimport paraview.numpy_support as pnp

include("paraviewreaders.jl")
include("vtkwriters.jl")

export read_vtk, write_to_file

end

Finally here is the longest bit, the error. Anyone knows what I am doing wrong, if anything at all?

WARNING: Method definition ones(AbstractArray, Type) in module Compat at C:\User
s\mohd\.julia\v0.5\Compat\src\Compat.jl:1440 overwritten in module Compat at C:\
Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1440.
WARNING: Method definition ones(AbstractArray, Type, Tuple) in module Compat at
C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1438 overwritten in module Compat
 at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1438.
WARNING: Method definition ones(AbstractArray, Type, Any...) in module Compat at
 C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1439 overwritten in module Compa
t at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1439.
WARNING: Method definition !(Function) in module Compat at C:\Users\mohd\.julia\
v0.5\Compat\src\Compat.jl:1205 overwritten in module Compat at C:\Users\mohd\.ju
lia\v0.5\Compat\src\Compat.jl:1205.
WARNING: Method definition ==(Union{Main.Base.Dates.Day, Main.Base.Dates.Hour, M
ain.Base.Dates.Week, Main.Base.Dates.Minute, Main.Base.Dates.Second, Main.Base.D
ates.Millisecond}, Union{Main.Base.Dates.Year, Main.Base.Dates.Month}) in module
 Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1513 overwritten in mo
dule Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1513.
WARNING: Method definition ==(Union{Main.Base.Dates.Year, Main.Base.Dates.Month}
, Union{Main.Base.Dates.Day, Main.Base.Dates.Hour, Main.Base.Dates.Week, Main.Ba
se.Dates.Minute, Main.Base.Dates.Second, Main.Base.Dates.Millisecond}) in module
 Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1514 overwritten in mo
dule Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1514.
WARNING: Method definition ==(Main.Base.Dates.Period, Main.Base.Dates.Period) in
 module Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1509 overwritte
n in module Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1509.
WARNING: Method definition redirect_stdout(Function, Any) in module Compat at C:
\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1057 overwritten in module Compat a
t C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1057.
WARNING: Method definition (::Type{Main.Base.LinearIndexing})(Type{#T<:Any}) in
module Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1430 overwritten
 in module Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1430.
WARNING: Method definition (::Type{Main.Base.LinearIndexing})(Any...) in module
Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1431 overwritten in mod
ule Compat at C:\Users\mohd\.julia\v0.5\Compat\src\Compat.jl:1431.

Please submit a bug report with steps to reproduce this fault, and any error mes
sages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x64f5e838 -- push_root at /home/Admini
strator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/
slave/package_win6_2-x64/build/src\gc.c:1343 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
while loading D:\JuliaDev\VTKDataIO\src\VTKDataIO.jl, in expression starting on
line 7
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1343 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1362 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1362 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1410 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1410 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
gc_mark_module at /home/Administrator/buildbot/slave/package_win6_2-x64/build/sr
c/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1212
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1423 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
gc_mark_module at /home/Administrator/buildbot/slave/package_win6_2-x64/build/sr
c/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1227
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1423 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1362 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1362 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1362 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1460 [inlined]
gc_push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1183
push_root at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/hom
e/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1410
_jl_gc_collect at /home/Administrator/buildbot/slave/package_win6_2-x64/build/sr
c/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1681 [inli
ned]
jl_gc_collect at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src
/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1858
jl_gc_pool_alloc at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:828 [inl
ined]
jl_gc_alloc_ at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/
home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:
148 [inlined]
jl_gc_alloc at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/h
ome/Administrator/buildbot/slave/package_win6_2-x64/build/src\gc.c:1881
_new_array_ at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/h
ome/Administrator/buildbot/slave/package_win6_2-x64/build/src\array.c:95
_new_array at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/ho
me/Administrator/buildbot/slave/package_win6_2-x64/build/src\array.c:149 [inline
d]
jl_alloc_array_1d at /home/Administrator/buildbot/slave/package_win6_2-x64/build
/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\array.c:346
vector_any at .\base.jl:151
require at .\loading.jl:433
unknown function (ip: 0000000061CA25B1)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_
internal.h:189 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1942
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home
/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1392 [inlined
]
read_verify_mod_list at /home/Administrator/buildbot/slave/package_win6_2-x64/bu
ild/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\dump.c:18
43
_jl_restore_incremental at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\dump.c
:2514
_jl_restore_incremental at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\dump.c
:2498 [inlined]
jl_restore_incremental at /home/Administrator/buildbot/slave/package_win6_2-x64/
build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\dump.c:
2580
_include_from_serialized at .\loading.jl:150
_require_from_serialized at .\loading.jl:187
_require_search_from_serialized at .\loading.jl:217
unknown function (ip: 0000000061D336F7)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_
internal.h:189 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1942
require at .\loading.jl:371
unknown function (ip: 0000000061CA25B1)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_
internal.h:189 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1942
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home
/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1392 [inlined
]
eval_import_path_ at /home/Administrator/buildbot/slave/package_win6_2-x64/build
/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:4
02
eval_import_path at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:42
9 [inlined]
jl_toplevel_eval_flex at /home/Administrator/buildbot/slave/package_win6_2-x64/b
uild/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel
.c:480
jl_eval_module_expr at /home/Administrator/buildbot/slave/package_win6_2-x64/bui
ld/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c
:196
jl_toplevel_eval_flex at /home/Administrator/buildbot/slave/package_win6_2-x64/b
uild/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel
.c:465
jl_parse_eval_all at /home/Administrator/buildbot/slave/package_win6_2-x64/build
/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\ast.c:717
jl_load at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/
Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:596 [inline
d]
jl_load_ at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home
/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:605
include_from_node1 at .\loading.jl:488
unknown function (ip: 0000000061C63D01)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_
internal.h:189 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1942
do_call at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/
Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:66
eval at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Adm
inistrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:190
jl_toplevel_eval_flex at /home/Administrator/buildbot/slave/package_win6_2-x64/b
uild/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel
.c:558
jl_parse_eval_all at /home/Administrator/buildbot/slave/package_win6_2-x64/build
/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\ast.c:717
jl_load at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/
Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:596 [inline
d]
jl_load_ at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home
/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:605
include_from_node1 at .\loading.jl:488
unknown function (ip: 0000000061C63D01)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_
internal.h:189 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1942
do_call at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/
Administrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:66
eval at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Adm
inistrator/buildbot/slave/package_win6_2-x64/build/src\interpreter.c:190
jl_toplevel_eval_flex at /home/Administrator/buildbot/slave/package_win6_2-x64/b
uild/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel
.c:558 [inlined]
jl_toplevel_eval at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:58
0
jl_toplevel_eval_in_warn at /home/Administrator/buildbot/slave/package_win6_2-x6
4/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\built
ins.c:590
eval at .\boot.jl:234
unknown function (ip: 0000000061C4D605)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_
internal.h:189 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1942
eval_user_input at .\REPL.jl:64
unknown function (ip: 0000000015463ECA)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_
internal.h:189 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1942
macro expansion at .\REPL.jl:95 [inlined]
#3 at .\event.jl:68
unknown function (ip: 0000000015461073)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64
/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_
internal.h:189 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/
src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1942
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home
/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1392 [inlined
]
start_task at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/ho
me/Administrator/buildbot/slave/package_win6_2-x64/build/src\task.c:253
Allocations: 3874853 (Pool: 3873736; Big: 1117); GC: 4


#2

There was a recent thread that, as far as I remember, basically said “don’t use workspace”.


#3

Would the following work instead? Basically a gutted-out workspace that does not save the last module.

function cleanworkspace()
    lastbase = Core.Main.Base
    ccall(:jl_new_main_module, Any, ())
    newmain = Core.Main
    ccall(:jl_add_standard_imports, Void, (Any,), newmain)
    eval(newmain, Expr(:toplevel, :(const Base = $(Expr(:quote, lastbase)))))
    empty!(Base.package_locks)
    nothing
end

EDIT the original was overenthusiastic and axed Base.


Flush REPL (also inside Atom)
#4

FWIW, this still breaks if you are using PyPlot (which has always been a problem with workspace()).

I get around this by putting most of my code into modules and not introducing the modules into the REPL scope (ie don’t use using at top level scope). Basically what is described here: https://docs.julialang.org/en/stable/manual/workflow-tips/

If I really need the REPL for debugging purposes I will load the modules and then restart julia when I’m done with the debugging/editing and want to test my code again.

Another option if you want to use code in the REPL without using MyModule is to qualify the methods, ie: MyModule.MyMethod()


#5

When I drop workspace, and I change a function definition, I get this warning WARNING: using VTKDataIO.read_vtk in module Main conflicts with an existing identifier. and it keeps on using the old function definition.


#6

Surprisingly, when I qualify the function call with the module name, it uses the new definition.

Edited to add: Or I guess not so suprisingly, but it seems that simply redefining a module and calling using again does not redefine all the functions already in the main scope, but the functions in the module’s scope are actually the new ones, which is potentially a bug.

EDA: But then I guess this non-functionality was…added so that any sub-module does not get defined multiple times if used by multiple modules by running using on the final version of each of those modules in the actual program.


#7

Some / much of this has changed in Julia 0.6.


#8

Thanks! It works. I added it to my juliarc file.
Devs, could we get this permanently?


#9

See updated version, which now also loads ~/.juliarc.jl.