2011-01-27 3 views
2

기기 (iPhone 4)에서 애플리케이션을 실행할 때이 exc_bad_access가 표시됩니다. NSZombieEnabled를 YES로 설정하여 좀비 사용을 시도했습니다. 응용 프로그램이 exc_bad_access와 충돌하지만 충돌이 발생하지 않습니다.iPhone에서 EXC_BAD_ACCESS는 시뮬레이터에 없습니다.

신고 된 clang 분석기를 사용하여 빌드 및 분석, 스캔 빌드의 모든 오류를 수정했습니다. 시뮬레이터에서 완벽하게 작동합니다. 앱은 libxml2를 사용하여 XML을 파싱하고 UITableView에 콘텐츠를 표시합니다. 어떤 도움을 주시면 감사하겠습니다.

업데이트 : (gdb) 정보 스레드 응답을 추가했습니다. 내가 놓친 EXC_BAD_ACCESS를 디버깅하는 다른 방법이 있습니까?

(gdb) bt 
#0 0x33a0daba in CALayerStateRelease() 
#1 0x339f3d9e in CALayerFreeTransaction() 
#2 0x339f3330 in CA::Transaction::commit() 
#3 0x33a179bc in CA::Transaction::observer_callback() 
#4 0x3082823c in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__() 
#5 0x308280b0 in __CFRunLoopDoObservers() 
#6 0x3081f28c in CFRunLoopRunSpecific() 
#7 0x3081f17e in CFRunLoopRunInMode() 
#8 0x31e445f2 in GSEventRunModal() 
#9 0x31e4469e in GSEventRun() 
#10 0x31e51122 in -[UIApplication _run]() 
#11 0x31e4f12e in UIApplicationMain() 
#12 0x0000285e in main (argc=1, argv=0x2ffff53c) at /Users/Home/Desktop/ProductNavigation_libxml2_regular/main.m:14 
(gdb) info threads 
    6 (Thread 0x770b: user=0.000000 system=0.000000 cpu=0 sleep_time=0) 0x3027a19c in __workq_kernreturn() 
    5 (Thread 0x6e07: user=0.010000 system=0.010000 cpu=0 sleep_time=0) 0x30224060 in select$DARWIN_EXTSN() 
    4 (Thread 0x6103: user=0.030000 system=0.030000 cpu=0 sleep_time=0) 0x301ffc98 in mach_msg_trap() 
    3 (Thread 0x2003: user=0.000000 system=0.000000 cpu=0 sleep_time=0) 0x301ffc98 in mach_msg_trap() 
    2 (Thread 0x1703: user=0.000000 system=0.000000 cpu=0 sleep_time=0) 0x3022c330 in kevent() 
* 1 (Thread 0x0307: user=1.160000 system=1.160000 cpu=0 sleep_time=0) 0x33a0daba in CALayerStateRelease() 
(gdb) 

업데이트 # 2 : 그것은 인쇄 문제가 될 수처럼 또 다른 스택 추적이 제한된 정보에서

#0 0x3002d844 in objc_msgSend_stret() 
#1 0x31ed5b8e in -[UITableViewCellLayoutManager(UITableViewCellLayoutManagerStatic) _editingAccessoryRectForCell:offscreen:]() 
#2 0x31ed5374 in -[UITableViewCellLayoutManager(UITableViewCellLayoutManagerStatic) _reorderSeparatorRectForCell:offscreen:]() 
#3 0x31ed5266 in -[UITableViewCellLayoutManager reorderSeparatorEndingRectForCell:forNewEditingState:]() 
#4 0x31ed48ae in -[UITableViewCellLayoutManager layoutSubviewsOfCell:]() 
#5 0x3206ae24 in -[UITableViewCellLayoutManagerSubtitle layoutSubviewsOfCell:]() 
#6 0x31ed37c0 in -[UITableViewCell layoutSubviews]() 
#7 0x31e5cbc6 in -[UIView(CALayerDelegate) _layoutSublayersOfLayer:]() 
#8 0x308362ea in -[NSObject(NSObject) performSelector:withObject:]() 
#9 0x339f9948 in -[CALayer layoutSublayers]() 
#10 0x339f9700 in CALayerLayoutIfNeeded() 
#11 0x339f34ca in CA::Context::commit_transaction() 
#12 0x339f32e0 in CA::Transaction::commit() 
#13 0x33a179bc in CA::Transaction::observer_callback() 
#14 0x3082823c in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__() 
#15 0x308280b0 in __CFRunLoopDoObservers() 
#16 0x3081f6ba in __CFRunLoopRun() 
#17 0x3081f276 in CFRunLoopRunSpecific() 
#18 0x3081f17e in CFRunLoopRunInMode() 
#19 0x31e445f2 in GSEventRunModal() 
#20 0x31e4469e in GSEventRun() 
#21 0x31e51122 in -[UIApplication _run]() 
#22 0x31e4f12e in UIApplicationMain() 
+1

당신이하고있는 일을 보여주는 코드를 제공 할 수 있습니다. –

답변

0

XML Parser에서 문제가 발생하여 구문 분석이 완료되어 충돌이 발생한 후에 파서 컨텍스트가 해제되었습니다. dealloc 메서드 고정 문제로 옮겼습니다. 내 게시물을 조사하고 내 질문에 시간을 할애 해 주셔서 감사합니다.

0

를 jQuery과 가리키는, 그것은 보인다. 파일에 로깅하고 있습니까? 로깅하는 디렉토리 (즉, 앱에서 파일을 쓸 수있는 곳)는 기기 및 시뮬레이터에서 다를 수 있습니다. 나는 디버그 정보를 로깅 할 때 비슷한 문제가 있었다.

+0

파일에 로깅하고 있지 않습니다. 디버깅을 위해 콘솔에 tempString을 인쇄했습니다. 나는 아무런 효과가없는 것을 주석 처리했다. – 0x8badf00d

2

NSZombies를 활성화 한 상태로 실행하고 할당 해제해야하는 동안 무엇이 해제되는지 확인하십시오 (특히 스택 추적 때문에 메모리 문제와 같은 것 같습니다).

원본을 발견했을 때, 그것을 해결하고 인쇄 문은 프로그램의 흐름을 따라 당신의 객체가 제대로 인스턴스화하는 경우 확인 주석도 제대로 출시되는 경우 코드의 관점에서 :

+0

그게 내가 제일 먼저 한 일. Project -> Active Executable -> Arguements NSZombieEnabled를 YES로 설정하십시오. EXC_BAD_ACCESS에서 디버거 콘솔의 아무 것도. : – 0x8badf00d

+0

@MacDev 와우, 그게 이상한데. 내가 사과 프레임 워크 중 하나에서 그 충돌을 얻을 수있는 이유는 항상 있기 때문에 나쁜 메모리 접근 어딘가에있을거야 내기. – JustSid

+0

이러한 디버깅 도구는 우스꽝스럽게 나쁜지만, 적어도 NSZombie는 어떤 객체가 호출되었는지를 알려줍니다. "__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__"- 얼마나 모호한 지 알 수 있습니까? 내 경우에는 어떤 관찰자도 아닌 것 같습니다. – n13

1

행복 .

거기에없는 프로그램을 릴리스 할 때 프로그램이 중단되는 것처럼 보입니다 (더 이상 또는 아직 없습니다). 마지막 메시지 중 하나는 UITableViewCellLayout이며 테이블 셀이 설정되는 곳 (cellForRowAtIndexPath 등)에서 호출됩니다.

관련 문제