Segmentation Fault

Hi All,

I have another confounding error. Basically, I have written up my own module SatPrecip. However, I keep running into the following segmentation fault:

mimicdt() #Note, this is the function that I am calling from SatPrecip

signal (11): Segmentation fault: 11
in expression starting at none:0
uv_write2 at /workspace/srcdir/libuv/src/unix/stream.c:1435
uv_write at /workspace/srcdir/libuv/src/unix/stream.c:1530
jl_uv_write at /Users/sabae/buildbot/worker/package_macos64/build/src/jl_uv.c:463
uv_write_async at ./stream.jl:907
uv_write at ./stream.jl:877
unsafe_write at ./stream.jl:931
#with_output_color#674 at ./gcutils.jl:87
unknown function (ip: 0x11f9cc737)
#with_output_color at ./none:0 [inlined]
#printstyled#675 at ./util.jl:398 [inlined]
#printstyled at ./none:0
emit at /Users/natgeo-wong/.julia/packages/Memento/UgJr2/src/handlers.jl:212
log at /Users/natgeo-wong/.julia/packages/Memento/UgJr2/src/handlers.jl:46
log at /Users/natgeo-wong/.julia/packages/Memento/UgJr2/src/loggers.jl:358
_log at /Users/natgeo-wong/.julia/packages/Memento/UgJr2/src/loggers.jl:403
log at /Users/natgeo-wong/.julia/packages/Memento/UgJr2/src/loggers.jl:382 [inlined]
debug at /Users/natgeo-wong/.julia/packages/Memento/UgJr2/src/loggers.jl:418 [inlined]
mimicdt at /Users/natgeo-wong/.julia/dev/SatPrecip/src/mimic.jl:17
do_call at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:323
eval_stmt_value at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:362 [inlined]
eval_body at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:758
jl_interpret_toplevel_thunk_callback at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:884
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x12fb9030f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:893
jl_toplevel_eval_flex at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:815
jl_toplevel_eval at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:824 [inlined]
jl_toplevel_eval_in at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:844
eval at ./boot.jl:330 [inlined]
repleval at /Users/natgeo-wong/.julia/packages/Atom/BVajq/src/repl.jl:141
#174 at /Users/natgeo-wong/.julia/packages/Atom/BVajq/src/repl.jl:163
with_logstate at ./logging.jl:395
with_logger at ./logging.jl:491 [inlined]
evalrepl at /Users/natgeo-wong/.julia/packages/Atom/BVajq/src/repl.jl:154
do_call at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:323
eval_stmt_value at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:362 [inlined]
eval_body at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:758
jl_interpret_toplevel_thunk_callback at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:884
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x12fbbbe8f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /Users/sabae/buildbot/worker/package_macos64/build/src/interpreter.c:893
jl_toplevel_eval_flex at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:815
jl_toplevel_eval at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:824 [inlined]
jl_toplevel_eval_in at /Users/sabae/buildbot/worker/package_macos64/build/src/toplevel.c:844
eval at ./boot.jl:330
eval_user_input at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
macro expansion at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:118 [inlined]
#26 at ./task.jl:268
jl_apply at /Users/sabae/buildbot/worker/package_macos64/build/src/./julia.h:1614 [inlined]
start_task at /Users/sabae/buildbot/worker/package_macos64/build/src/task.c:596
Allocations: 49100619 (Pool: 49091440; Big: 9179); GC: 110

This error goes away when I delete the compiled files in the compiled/ directory, but the next run when I open juno and do:

julia> using SatPrecip
[ Info: Precompiling SatPrecip [c6577ace-fc08-4973-a1e4-3e4a8afb031d]

julia> mimicdt()

I run into this error again.

For reference, this is my main module file, SatPrecip.jl:

module SatPrecip

Main file for the SatPrecip module that downloads precipitation-related

variables from various satellite instruments

Modules Used

using Dates, Memento
using NetCDF
using Conda, PyCall, PyPlot

Set Logging Format!

global logger = Memento.config!(“debug”,fmt="{date} - {level} - {msg}")

Exporting the following functions:

export
mimicdt

Including other files in the module

include(“mimic.jl”)

end # module

And this is the file mimic.jl from which the function mimicdt() resides:

“”"
This file contains all the functions that are used in the retrieval of MIMIC
precipitable water datasets. This includes the downloading and and retrieval
data from specific areas, as well as plotting of the data.

– mimicdwn(date,region=“GLB”)
downloads hour gridded precipitable water for a given date (and if
specified, region)
– mimicdt(date)
extracts the year, month and day and generates:
– a list of files to download
– the url where the files are to be downloaded from

“”"

function mimicdt()
debug(logger,“Extracting year, month and day from given date”)
end