From 0105d1cb2fc29ad8feddd578421eba5f97963905 Mon Sep 17 00:00:00 2001 From: Guilherme Andrade Date: Tue, 17 Jan 2023 15:03:49 +0000 Subject: [PATCH] Avoid crashing shared state owner after reading OS-trusted CAs Specifically, when the file port exits before the OTP code we've invoked unlinks from it, thus triggering an `EXIT` message (or so I speculate). Issue report: * https://github.com/g-andrade/tls_certificate_check/issues/35 --- CHANGELOG.md | 6 ++++++ src/tls_certificate_check_shared_state.erl | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6242c21..23bf63c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- (rare?) crash after reading OS-trusted CAs + ## [1.17.2] - 2023-01-12 ### Fixed diff --git a/src/tls_certificate_check_shared_state.erl b/src/tls_certificate_check_shared_state.erl index af455cc..1e6062c 100644 --- a/src/tls_certificate_check_shared_state.erl +++ b/src/tls_certificate_check_shared_state.erl @@ -62,7 +62,6 @@ -export([init/1, handle_call/3, handle_cast/2, - handle_info/2, terminate/2, code_change/3]). @@ -224,11 +223,6 @@ handle_cast({initialize_shared_state, EncodedHardcodedAuthorities}, State) handle_cast(Request, State) -> {stop, {unexpected_cast, Request}, State}. --spec handle_info(term(), state()) - -> {stop, {unexpected_info, term()}, state()}. -handle_info(Info, State) -> - {stop, {unexpected_info, Info}, State}. - -spec terminate(term(), state()) -> ok. terminate(Reason, _State) -> ets:delete_all_objects(?INFO_TABLE),