Re: [perl #75628] setsockopt() with fileno($s) as first parameter makes perl segfault

[email protected] (Nicholas Clark)
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
Thanks for the bug report.
On Wed, Jun 09, 2010 at 01:56:07PM +0000, Ævar Arnfjörð Bjarmason wrote:
> On Wed, Jun 9, 2010 at 12:41, [email protected]
> <[email protected]> wrote:
> > perl -MIO::Socket -E 'my $s = IO::Socket->new(); $s->socket(2, 1, 6); setsockopt(fileno($s), 1, 1, 1);'
> 
> That's just "Bad symbol for filehandle at -e line 1." in 5.12 and 5.13.1

git bisect shows that it was fixed with be4a20f47dbbaec8

commit be4a20f47dbbaec8334ad2c20e898e8d6f2adb65
Author: Rafael Garcia-Suarez <[email protected]>
Date:   Thu Aug 6 22:12:47 2009 +0200

    Make gv_IOadd accept a NULL argument

    This fixes bug #68182


This change was too late to make it into perl 5.10.1, so that release will
also have this bug.

Is the code above sufficiently generic that it would make a good (portable)
regression test? A test for #68182 was added in 735302bdcf24a4dd

Nicholas Clark
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.