From 8bde4793b8b1dfdd6be2f3ddc1fdf4f7f5c5b01e Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Mon, 20 Jun 2022 15:07:02 +0100 Subject: Also log CopSTASHPV --- util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index f2332034a1..9f17ed3ec5 100644 --- a/util.c +++ b/util.c @@ -5218,9 +5218,10 @@ S_mem_log_common(enum mem_log_type mlt, const UV n, PERL_UNUSED_RESULT(PerlLIO_write(fd, buf, len)); #ifdef USE_C_BACKTRACE if(strchr(pmlenv,'c') && (mlt == MLT_NEW_SV)) { - /* TODO: get caller package in here when we work out how */ len = my_snprintf(buf, sizeof(buf), - " caller at %s line %d\n", + " caller %s at %s line %d\n", + /* CopSTASHPV can crash early on startup; use CopFILE to check */ + CopFILE(PL_curcop) ? CopSTASHPV(PL_curcop) : "", CopFILE(PL_curcop), CopLINE(PL_curcop)); PERL_UNUSED_RESULT(PerlLIO_write(fd, buf, len)); -- cgit v1.2.1