YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

[#312] Clear pointer from jnlpool to gld when gld gets freed (or else SIG-11 occurs when tests run with non-zero ydb_dbglvl randomly chosen in test framework) #322

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

Commands like MUPIP SET -FILE which invoke mu_gv_cur_reg_init() (which creates a dummy gbldir) could attach to a jnlpool while the dummy gbldir is active. Later when mu_gv_cur_reg_free() is invoked the gbldir is freed. Much later when the MUPIP SET goes to halt, it does a jnlpool_detach() which invokes DETACH_FROM_JNLPOOL_IF_NEEDED -> JNLPOOL_SHMDT -> JNLPOOL_CLEAR_FIELDS which checks if the jnlpool has a back pointer to the gld and the gld is non-NULL it tries to set the jnlpool pointer from the gld to NULL. This can SIG-11 if the memory has been freed and the test runs with a non-zero ydb_dbglvl (GDL_SmBackfill bit is set which backfills unused storage to cause exceptions if released storage is used).