Re: Bug#508432: minimum testcase
Meanwhile this is solved, see the attached patch that's useful as a
workaround for fwknopd
On Sat, Feb 14, 2009 at 20:47, Martín Ferrari <tincho@debian.org> wrote:
> Hi, after working on this bug for a while, I was able to distill a
> minimum code that triggers the segfault. The callback routine invoked
> from pcap_loop needs to set a signal handler that it's used during the
> callback.
>
> In the fwknopd code, this happens when calling iptables, which triggers
> a SIGCHLD on exit, but can happen with any signal.
>
> The following backtrace makes me doubt if this is a Net::Pcap or a perl
> problem. Maybe somebody in the list can shed some light? (Hello Niko :))
>
> #0 0xb7e726c9 in free () from /lib/libc.so.6
> #1 0x080c5b70 in Perl_sv_clear ()
> #2 0x080c5d2a in Perl_sv_free2 ()
> #3 0x080e0a10 in Perl_leave_scope ()
> #4 0x080e137c in Perl_pop_scope ()
> #5 0x080b463d in Perl_pp_leavesub ()
> #6 0x080b1879 in Perl_runops_standard ()
> #7 0x080aba15 in Perl_call_sv ()
> #8 0xb7daf538 in callback_wrapper ()
> from /usr/lib/perl5/auto/Net/Pcap/Pcap.so
> #9 0xb7d75d45 in ?? () from /usr/lib/libpcap.so.0.8
> #10 0x08ae4558 in ?? ()
> #11 0xbf8a9e28 in ?? ()
> #12 0x08afb54a in ?? ()
> #13 0x00000020 in ?? ()
> #14 0xbf8a9e14 in ?? ()
> #15 0xbf8a9e38 in ?? ()
> #16 0xbf8a9e48 in ?? ()
> #17 0x080c4067 in Perl_sv_setsv_flags ()
> #18 0xb7d76bab in pcap_loop () from /usr/lib/libpcap.so.0.8
> #19 0xb7da9cf3 in XS_Net__Pcap_loop ()
> from /usr/lib/perl5/auto/Net/Pcap/Pcap.so
> #20 0x080b32d2 in Perl_pp_entersub ()
> #21 0x080b1879 in Perl_runops_standard ()
> #22 0x080ac6a0 in perl_run ()
> #23 0x08063ddd in main ()
>
>
> _______________________________________________
> pkg-perl-maintainers mailing list
> pkg-perl-maintainers@lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-perl-maintainers
>
--
Martín Ferrari
--- fwknopd 2009-02-14 23:04:54.000000000 +0000
+++ /usr/sbin/fwknopd 2009-01-14 23:20:57.000000000 +0000
@@ -359,14 +359,7 @@
for (;;) {
- my @tmpcbargs; my $cbcalled = 0;
- my $tmpcb = sub {
- my %hdr = $_[1];
- @tmpcbargs = ($_[0], \%hdr, $_[2]);
- $cbcalled = 1;
- };
- Net::Pcap::loop($pcap_t, 1, $tmpcb, 'fwknop_tag');
- pcap_process_pkt(@tmpcbargs) if($cbcalled);
+ Net::Pcap::loop($pcap_t, 1, \&pcap_process_pkt, 'fwknop_tag');
if ($config{'AUTH_MODE'} eq 'FILE_PCAP'
or $config{'AUTH_MODE'} eq 'ULOG_PCAP') {
Reply to: