halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:
This seems to me to be a bug, I just wanted to see if anyone had seen it before and if it reproduces for them.
Using perl "(v5.18.4) built for x86_64-linux-thread-multi", rather than the nice runtime warning:#!/usr/bin/perl use strict; use warnings FATAL => qw(all); my $t = test->new(); print "The End.\n"; { package test; sub new { my $class = shift; my $self = { list => [ 'a', 'b', 'c' ] }; bless $self, $class; } sub DESTROY { my $self = shift; print STDERR "Bye!".$self->{list}->{4}."\n"; } 1; }
The End.
(in cleanup) Not a HASH reference at ./test.pl line 20.
I get:
The End. shell: Job 1, “./test.pl” terminated by signal SIGSEGV (Address boundary error)Which is tedious to then actually pinpoint if the code is more elaborate. Fortunately the deciding factor is:
Just plain `warnings` or `-w` won't do it. The backtrace starts in malloc.c and leads to an endless loop involving "Perl_ck_warner()" where it seems to have been trying to generate the "(in cleanup)" error message.use warnings FATAL => qw(all);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SIGSEGV instead of "Not a hash ref" in destructor w/ FATAL => all
by Anonymous Monk on Jul 20, 2015 at 10:23 UTC | |
by halfcountplus (Hermit) on Jul 20, 2015 at 13:27 UTC |