帮助理解堆栈跟踪:“#0 0x00000000 in ??()”

时间:2011-08-31 07:38:18

标签: c debugging gdb android-ndk stack-trace

我正在尝试调试使用本机C代码的Android应用程序。我能够设置GDB并获得我的segfaulting的堆栈跟踪。我理解堆栈跟踪直到最顶层的项目:

#0  0x00000000 in ?? ()
#1  0x84601920 in fvalue_set (fv=0xe262c0, value=0x494530cc, already_copied=0) at ftypes.c:422
#2  0x845eaae8 in proto_tree_new_item (new_fi=0xe262c0, tree=<value optimized out>, tvb=0xe29080, start=14, length=11, encoding_arg=0) at proto.c:1429
#3  0x845eb2f8 in proto_tree_add_item (tree=<value optimized out>, hfindex=<value optimized out>, tvb=0xe29080, start=14, length=11, encoding=0) at proto.c:1760
#4  0x84a163dc in add_tagged_field (pinfo=<value optimized out>, tree=0xe245b8, tvb=0xe29080, offset=<value optimized out>) at packet-ieee80211.c:6272
#5  0x84a18e74 in ieee_80211_add_tagged_parameters (tvb=0xe29080, offset=12, pinfo=0x10f8978, tree=0xe24588, tagged_parameters_len=190) at packet-ieee80211.c:7914
#6  0x84a19094 in dissect_ieee80211_mgt (fcf=<value optimized out>, tvb=0xe29080, pinfo=0x10f8978, tree=0xe21dc0) at packet-ieee80211.c:8064
#7  0x84a1a660 in dissect_ieee80211_common (tvb=0xe29048, pinfo=<value optimized out>, tree=<value optimized out>, fixed_length_header=<value optimized out>, fcs_len=0, wlan_broken_fc=0, datapad=-494833656, is_ht=Cannot access memory at address 0x3bc) at packet-ieee80211.c:9595
#8  0x84a1d388 in dissect_ieee80211 (tvb=0xe262c0, pinfo=0x494530cc, tree=0x0) at packet-ieee80211.c:9721
#9  0x845d6358 in call_dissector_work (handle=0x3df1c8, tvb=0xe29048, pinfo_arg=0x10f8978, tree=0xe21dc0, add_proto_name=1) at packet.c:395
#10 0x845d63d4 in call_dissector_only (handle=0xe262c0, tvb=0x494530cc, pinfo=0x0, tree=0x85b85d74) at packet.c:1826
#11 0x845d645c in call_dissector (handle=0xe262c0, tvb=0x494530cc, pinfo=0x0, tree=0x85b85d74) at packet.c:1839
#12 0x84c900a4 in dissect_radiotap (tvb=0xe29010, pinfo=<value optimized out>, tree=<value optimized out>) at packet-radiotap.c:1624
#13 0x845d6358 in call_dissector_work (handle=0x523ab8, tvb=0xe29010, pinfo_arg=0x10f8978, tree=0xe21dc0, add_proto_name=1) at packet.c:395
#14 0x845d6814 in dissector_try_uint_new (sub_dissectors=<value optimized out>, uint_val=23, tvb=<value optimized out>, pinfo=0x10f8978, tree=0xe21dc0, add_proto_name=1) at packet.c:898
#15 0x845d6848 in dissector_try_uint (sub_dissectors=0xe262c0, uint_val=1229271244, tvb=0x0, pinfo=0x85b85d74, tree=0xe21dc0) at packet.c:924
#16 0x8471453c in dissect_frame (tvb=<value optimized out>, pinfo=<value optimized out>, parent_tree=<value optimized out>) at packet-frame.c:354
#17 0x845d6358 in call_dissector_work (handle=0x360fe0, tvb=0xe29010, pinfo_arg=0x10f8978, tree=0xe21dc0, add_proto_name=1) at packet.c:395
#18 0x845d63d4 in call_dissector_only (handle=0xe262c0, tvb=0x494530cc, pinfo=0x0, tree=0x85b85d74) at packet.c:1826
#19 0x845d645c in call_dissector (handle=0xe262c0, tvb=0x494530cc, pinfo=0x0, tree=0x85b85d74) at packet.c:1839
#20 0x845d6710 in dissect_packet (edt=<value optimized out>, pseudo_header=0xbed5c3d0, pd=<value optimized out>, fd=<value optimized out>, cinfo=0x0) at packet.c:326
#21 0x80d033a0 in dissectPacket (pHeader=0x44740b70 "??]NSb\n", pData=0x4476e270 "", encap=23) at /Users/gnychis/Documents/workspace/CoexiSyst/jni/libwireshark/wireshark_helper.c:374
#22 0x80d034f4 in Java_com_gnychis_coexisyst_Packet_dissectPacket (env=0xaa50, thiz=0x44798bd0, header=0x44740b60, data=0x4476e260, encap=23) at /Users/gnychis/Documents/workspace/CoexiSyst/jni/libwireshark/wireshark_helper.c:431

“??()中最重要的项目是”#0 0x00000000“究竟是什么意思?这似乎是NULL。这是缺少调试信息,还是由调用null方法引起的段错误? (即地址0x0000000处的函数)。

我只是想了解如何解释此跟踪以及segfault的根本原因。

#1,fvalue_set的代码是:

 fv->ftype->set_value(fv, value, already_copied);

1 个答案:

答案 0 :(得分:5)

代码在空地址处调用了一个子程序。最有可能set_value为NULL。