Devel::MAT helps:
Attempt to free unreferenced scalar: SV 0x56351745a6b0, Perl interpreter: 0x5635174572a0 during global destruction.
$ pmat pre-die.pmat
. show 0x56351745a6b0
ARRAY(0)=C at 0x56351745a6b0 with refcount 3
size 64 bytes
blessed as C
0 elements (use 'elems' command to show)
. inrefs 0x56351745a6b0
s a suspended SAVEt_FREESV CODE(PP) at 0x56351745a470
s a suspended SAVEt_SPTR current value CODE(PP) at 0x56351745a470
s the referrant REF() at 0x56351786a258
s the referrant REF() at 0x563517825ea0
. identify 0x56351745a6b0
ARRAY(0)=C at 0x56351745a6b0 is:
├─(via RV) a suspended pad slot of CODE(PP) at 0x56351745a470, which is (*A):
│ └─(via RV) element [1] of ARRAY(2) at 0x56351786a510, which is:
│ └─(via RV) element [0] of ARRAY(1) at 0x56351747d288, which is:
│ └─(via RV) value {callbacks} of HASH(3)=Future at 0x56351747d2b8, which is:
│ ├─(via RV) a suspended mortal of CODE(PP) at 0x56351745a470, which is:
│ │ └─already found circularly as *A
│ └─(via RV) element [0] of ARRAY(1) at 0x56351786a078, which is:
│ └─(via RV) value {on_cancel} of HASH(3)=Future at 0x56351786a5a0, which is:
│ └─(via RV) the lexical $f at depth 1 of CODE() at 0x56351745a6c8=main_cv, which is:
│ └─the main code
├─(via RV) the lexical $obj at depth 1 of CODE() at 0x56351745a6c8=main_cv, which is:
│ └─the main code
├─a suspended SAVEt_FREESV of CODE(PP) at 0x56351745a470, which is:
│ └─already found as *A
└─a suspended SAVEt_SPTR current value of CODE(PP) at 0x56351745a470, which is:
└─already found as *A
--
Paul Evans