Skip to content

Segfault when shutting down database which got encrypted by another process [CORE6501] #6731

@firebird-automations

Description

@firebird-automations

Submitted by: @AlexPeshkoff

When database is shutting down header page should be fetched and next written to database in order to update transaction numbers. If AST, causing change of encryption state, arrived during DB shutdown right before TRA_update_counters() database encryption manager is already missing environment required to load encryption plugin (like attachment) and segfaults happens when plugin is tried to be loaded.

Update of DB header does not require presence of database crypt plugin - it's anyway not encrypted page. Therefore fix is ti check environment before attempt to load plugin.

Commits: 64fe26f 18019a6

====== Test Details ======

Crash occured several times on Linux only, during execution of test 'functional.util.gbak_zip'.
Separate test not required.