This repository is an MWE for a segfault that occurs when using AWSCRT inside a sysimage.
Instantiate this package:
julia --project -e 'import Pkg; Pkg.instantiate()'
Build the sysimage:
MQTT_ENABLED="false" julia --project=sysimage -e 'import Pkg; Pkg.build(); include(joinpath("sysimage", "build_sysimage.jl")); build()'
Set these environment variables in your shell (these need to point to real AWS infra):
export MQTT_ENDPOINT="..." AWS IoT > Settings > Device data endpoint
export MQTT_CERT_PATH="..." # the xxx-certificate.pem.crt file
export MQTT_PRIVATE_KEY_PATH="..." # the xxx-private.pem.key file
export MQTT_CA_PATH="..." # AmazonRootCA1.pem
Run the test with the sysimage (optionally under rr
):
MQTT_ENABLED="true" rr julia -J sysimage/sysimage.so test/test.jl