Wireshark-dev: Re: [Wireshark-dev] Custom dissector causing wireshark to crash
From: Patrick Lannigan <p.lannigan@xxxxxxxxx>
Date: Tue, 25 Aug 2009 17:00:14 -0400
Ok, I got it set up in VC++EE and tried it. It is failing in my proto_register_abc() method.
I construct the hf array, ett array and proto_register_protocol with no problems. It then fails on:

proto_register_field_array (proto_abc, hf, array_length (hf));

Here is the hf array construction, can anyone see what the error is?

    static hf_register_info hf[] = {
        { &hf_abc_flags,
            { "Flags", "abc.flags",
            FT_UINT8, BASE_NONE,
            NULL, 0x0, NULL, HFILL }
        },
        { &hf_abc_crc,
            { "CRC", "abc.crc",
            FT_UINT16, BASE_HEX,
            NULL, 0x0, NULL, HFILL }
        },
        { &hf_abc_txPower,
            { "txPower", "abc.txPower",
            FT_UINT8, BASE_DEC,
            "Transmit power for message in dBm",
            0x0, NULL, HFILL }
        },
        { &hf_abc_frameType,
            { "frameType", "abc.frameType",
            FT_UINT16, BASE_NONE,
            NULL, 0x0, NULL, HFILL }
        },
        { &hf_abc_prevHop,
            { "prevHop", "abc.prevHop",
            FT_UINT32, BASE_HEX,
            "Address of node that message was received from",
            0x0, NULL, HFILL }
        },
        { &hf_abc_nextHop,
            { "nextHop", "abc.nextHop",
            FT_UINT32, BASE_HEX,
            "Address of node that message is being sent to",
            0x0, NULL, HFILL }
        },
        { &hf_abc_seqNum,
            { "seqNum", "abc.seqNum",
            FT_UINT8, BASE_DEC,
            NULL, 0x0, NULL, HFILL }
        },
        { &hf_abc_priority,
            { "priority", "mac.priority",
            FT_UINT8, BASE_NONE,
            NULL, 0x0, NULL, HFILL }
        },
        { &hf_abc_frameContentLen,
            { "frameContentLen", "abc.frameContentLen",
            FT_UINT16, BASE_DEC,
            "Length of buffer sent OTA including mac headers",
            0x0, NULL, HFILL }
        },
        { &hf_abc_duration,
            { "duration", "abc.duration",
            FT_UINT16, BASE_DEC,
            "Duration in microsec used for CSMA NAV calculation",
            0x0, NULL, HFILL }
        },
        { &hf_abc_token,
            { "token", "abc.token",
            FT_UINT32, BASE_NONE,
            NULL, 0x0, NULL, HFILL }
        },
        { &hf_abc_linkProfile,
            { "linkProfile", "abc.linkProfile",
            FT_UINT32, BASE_NONE,
            "Linkprofile used to xmit this packet, tmp until we know how the PHY is going to provide this info",
            0x0, NULL, HFILL }
        },
        { &hf_abc_expirationTime,
            {"expirationTime", "abc.expirationTime",
            FT_UINT16, BASE_DEC,
            "Time in ms this frame may take to be delivered to its next hop",
            0x0, NULL, HFILL }
        },
        { &hf_abc_padding,
            {"padding", "abc.padding",
            FT_UINT16, BASE_NONE,
            NULL, 0x0, NULL, HFILL }
        }
    };

Patrick

On Tue, Aug 25, 2009 at 4:11 PM, Guy Harris <guy@xxxxxxxxxxxx> wrote:

On Aug 25, 2009, at 1:09 PM, wsgd wrote:

> When you start wireshark with a capture file ?
> If there is no capture file (or capture), the problem does not come
> from
> the packet or the dissect function.

...which means it probably comes from one of the dissector's
registration functions (which are called when Wireshark or TShark
starts up).
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe