ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] Core points to wtap_buf_ptr in wtap.c at line 556

From: "Neha Chahal" <neha.chahal@xxxxxxxxx>
Date: Wed, 8 Nov 2006 14:34:13 -0800
Hi I am trying to test my code in the wiretap directory.

When I run tethereal on my binary file it crashes randomly.
The core points here

--------------------------------------------------------------------------------------------------

Loaded symbols for /lib/libresolv.so.2
#0  0x0038fbfd in wtap_buf_ptr (wth=0x9fd35c0) at wtap.c:556
556             return buffer_start_ptr(wth->frame_buffer);
(gdb) where
#0  0x0038fbfd in wtap_buf_ptr (wth=0x9fd35c0) at wtap.c:556
#1  0x08061a23 in load_cap_file (cf=0x806de40, save_file=0x0, out_file_type=2) at tethereal.c:2115
#2  0x080606af in main (argc=1, argv=0xbfff86e4) at tethereal.c:1424
(gdb) p wth
$1 = (wtap *) 0x9fd35c0
(gdb) p *wth
$2 = {fh = 0x9fd0b10, fd = 4, random_fh = 0x0, file_type = 44, snapshot_length = 0, frame_buffer = 0xe3cc0000, phdr = {
    ts = {secs = 285310101, nsecs = 279183626}, caplen = 19, len = 19, pkt_encap = 0}, pseudo_header = {eth = {
      fcs_len = 0}, x25 = {flags = 0 '\0'}, isdn = {uton = 0, channel = 0 '\0'}, atm = {flags = 0, aal = 0 '\0',
      type = 0 '\0', subtype = 0 '\0', vpi = 0, vci = 0, channel = 0, cells = 0, aal5t_u2u = 0, aal5t_len = 0,
      aal5t_chksum = 0}, ascend = {type = 0, user = '\0' <repeats 63 times>, sess = 0, call_num = '\0' <repeats 63 times>,
      chunk = 0, task = 0}, p2p = {sent = 0}, ieee_802_11 = {fcs_len = 0, channel = 0 '\0', data_rate = 0 '\0',
      signal_level = 0 '\0'}, cosine = {encap = 0 '\0', direction = 0 '\0', if_name = '\0' <repeats 127 times>, pro = 0,
      off = 0, pri = 0, rm = 0, err = 0}, irda = {pkttype = 0}, nettl = {subsys = 0, devid = 0, kind = 0, pid = 0,
      uid = 0}, mtp2 = {sent = 0 '\0', annex_a_used = 0 '\0', link_number = 0}, k12 = {input = 0, input_name = 0x0,
      stack_file = 0x0, input_type = 0, input_info = {atm = {vp = 0, vc = 0, cid = 0}, ds0mask = 0}, stuff = 0x0}, lapd = {
      pkttype = 0, we_network = 0 '\0'}}, data_offset = 0, capture = {pcap = 0x0, lanalyzer = 0x0, ngsniffer = 0x0,
    iseries = 0x0, i4btrace = 0x0, nettl = 0x0, netmon = 0x0, netxray = 0x0, ascend = 0x0, csids = 0x0, etherpeek = 0x0,
    airopeek9 = 0x0, erf = 0x0, k12 = 0x0, generic = 0x0}, subtype_read = 0x38f688 <my_read>,
  subtype_seek_read = 0x38f7c8 <my_seek_read>, subtype_sequential_close = 0, subtype_close = 0, file_encap = 0,
  tsprecision = 6}
(gdb) p *(wth->frame_buffer)
Cannot access memory at address 0xe3cc0000
(gdb) p (wth->frame_buffer)
$3 = (struct Buffer *) 0xe3cc0000
(gdb)
(gdb)
---------------------------------------------------------------------
--

Looks like a illegal memory access. Can some one please suggest what might be wrong.

Thanks and Regards,
Neha Chahal
Cell- 443 207 0414