2011-08-31 3 views
2

네이티브 C 코드를 사용하는 Android 응용 프로그램을 디버깅하려고합니다. 나는 GDB를 셋업 할 수 있었고 segfaulting의 스택 추적을 얻을 수 있었다. 나는 스택의 최상위 항목까지 추적 이해 :스택 추적을 이해하는 데 도움이됩니다. "# 0 0x00000000 in ??()"

상단 대부분의 항목 인 무엇
#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 메소드 호출로 인한 segfault입니까? (즉, 주소 0x0000000에있는 함수).

이 추적과 segfault의 근본 원인을 해석하는 방법을 이해하려고합니다. # 1에서

코드는 fvalue_set은 다음과 같습니다

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

당신은 우리보다 많은 코드를 제공해야 도움이 될 것입니다. –

답변

5

코드는 널 (null) 주소에서 서브 루틴을 촉구했다. 대부분 set_value 일 경우 NULL입니다.

+0

thanks! 내가 기대하고 있었던 것은 이와 비슷한 것이었다. 라이브러리를 다시 컴파일하지 않고 다음과 같이 넣지 않아도 GDB에서이 조건을 테스트 할 수있는 방법이 있습니까 : if (fv-> type ... == NULL) {printf ("condition true"); } 이렇게 쉽게 테스트 할 수 있습니까? 이 함수가 호출 될 때마다 중단 점을 설정하고 싶지 않습니다.이 함수는 호출되는 1/4000 배 정도이므로 발생합니다. – gnychis

+0

조건부 중단 점이 필요합니다. GDB 명령은'condition fv-> ftype-> set_value == 0'입니다. – hamstergene

+0

도움을 주셔서 감사합니다! 나는 현재이 경우인지 확인하기 위해 현재 디버깅 중입니다. 물론, 일단 브레이크 포인트를 설정했다면, 그것을 재현하는 데 어려움을 겪고 있습니다;) 이것이 어떻게 진행되는 것입니까? – gnychis

관련 문제