#16 segfault while calling dump_open

Wim Lewis

From a report on the help forum:

> segfault while calling dump_open
> Delete By: Shehjar Tikoo (shehjar) - 2007-07-10 19:24
> Hi
> Python2.4 crashes with a segfault while calling the dump_open method.
> I am using a P4 machine with Debian etch.



  • kristjanbb

    kristjanbb - 2009-08-05

    dump_open can not be called before self->pcap has been initialized by calling some of the open_* functions.

    It's a lack of sanity check in both pylibpcap and libpcap. Just use open_offline(filename) instead.

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0xb7cc16c0 (LWP 16579)]
    pcap_dump_open (p=0x0, fname=0xb7c62bc4 "msndump.1") at ./savefile.c:1416
    1416 linktype = dlt_to_linktype(p->linktype);
    (gdb) up
    #1 0xb8038512 in pcapObject_dump_open (self=0x879d7f8, fname=0xb7d26bc4 "msndump.1") at pcap_interface.c:132
    132 self->pcap_dumper = pcap_dump_open(self->pcap, fname);
    (gdb) inspect self->pcap
    $1 = (pcap_t *) 0x0

  • Wim Lewis

    Wim Lewis - 2012-01-05

    Thanks for the extra investigation, kristjanbb. I've added more sanity checking to pylibpcap so you should get a nice Python exception now instead of a crash.

  • Wim Lewis

    Wim Lewis - 2012-01-05
    • status: open --> open-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks