Open haroldfeng opened 2 years ago
I have compiled and ldd successfully, but an error is reported when I run. I am will be real thankful for helping me.
[root@localhost decode_by_libwireshark-master]# ./myshark -f 1.pcap Segmentation fault (core dumped)
I use gdb to debug.
(gdb) bt #0 0x00007ffbbe4cc7b8 in main_arena () from /lib64/libc.so.6 #1 0x00007ffbc069389b in dissect_frame (tvb=0x1f0b300, pinfo=0x1f0ba18, parent_tree=0x1eb7b30, data=0x7ffe8bcc30b0) at packet-frame.c:355 #2 0x00007ffbc037f4e0 in call_dissector_through_handle (handle=0x7ffbbbc71a10, handle=0x7ffbbbc71a10, data=0x7ffe8bcc30b0, tree=0x1eb7b30, pinfo=0x1f0ba18, tvb=0x1f0b300) at packet.c:684 #3 call_dissector_work (handle=0x7ffbbbc71a10, tvb=0x1f0b300, pinfo_arg=0x1f0ba18, tree=0x1eb7b30, add_proto_name=<optimized out>, data=0x7ffe8bcc30b0) at packet.c:759 #4 0x00007ffbc0380f72 in call_dissector_with_data (handle=<optimized out>, tvb=0x1f0b300, pinfo=0x1f0ba18, tree=0x1eb7b30, data=<optimized out>) at packet.c:3012 #5 0x00007ffbc0381486 in dissect_record (edt=edt@entry=0x1f0ba00, file_type_subtype=file_type_subtype@entry=0, phdr=phdr@entry=0x1ed5040, tvb=tvb@entry=0x1f0b300, fd=fd@entry=0x7ffe8bcc3270, cinfo=cinfo@entry=0x603450 <cfile+560>) at packet.c:567 #6 0x00007ffbc03765a4 in epan_dissect_run_with_taps (edt=0x1f0ba00, file_type_subtype=0, phdr=0x1ed5040, tvb=0x1f0b300, fd=0x7ffe8bcc3270, cinfo=0x603450 <cfile+560>) at epan.c:473 #7 0x0000000000401bc1 in read_packet (edt_r=0x7ffe8bcc3308) at myshark.c:148 #8 0x0000000000401c74 in print_each_packet_xml () at myshark.c:166 #9 0x0000000000401e36 in main (argc=3, argv=0x7ffe8bcc3438) at myshark.c:232
I have solved the problem,because there is a problem with 1.pcap in the project.
I have compiled and ldd successfully, but an error is reported when I run. I am will be real thankful for helping me.
I use gdb to debug.