코코아 개발 : malloc : free_garbage : 쓰레기 ptr = 0x18a15e0, 0이 아닌 refcount = 1 오류가 있습니다.

StackOverflow https://stackoverflow.com/questions/803643

문제

Cocoa 앱을 개발 중이며 Xcode에서 앱을 실행할 때마다 디버깅 콘솔에서 다음 종류의 메시지를 얻습니다.

<내 앱 이름>(952,0xb0103000) Malloc : Free_garbage : 쓰레기 PTR = 0x107B2F0, 0이 아닌 refcount = 1

나는 mallocstacklogging을 켜고 nszombieenabled를 켜고이 주소 몇 개에 malloc_history를 만들었고 바닥에 인용 된 줄을 따라 흔적을 얻었습니다.

공통 스레드는 오류가있는 모든 블록에서 nspopupbuttoncell에 대한 참조 인 것 같습니다.

내 생각에 그것은 어딘가에 CFRETEATED가되었지만 쓰레기를 수집 할 수없는 일이라는 것입니다.

a) 이것이 GC에 대해 아직 제대로 업데이트되지 않은 프레임 워크의 내 부분에 대한 프로그래밍 오류 일 가능성이 더 높습니까?

b)이 메시지를 자극하는 문제의 결과는 무엇입니까? 즉,이 메시지에주의를 기울여야합니까, 아니면 그냥 무시할 수 있습니까?

2] [arg = 48] : Thread_A003d720 | 시작 | 메인 | nsapplicationMain | -[nsapplication run] | -[nsapplication nexteventmatchingmask : undildate : inmode : dequeue :] | _DPSNEXTEVENT | BlockuntilNexTeventMatchingListInMode | 수신기 텍스트 벤트 커밋 | runcurrenteventLoopInmode | cfrunloopruninmode | cfrunlooprunspecific | __cfrunloopdoobservers | _handlewindowneedsdisplay | -[nswindow displayIfned] | -[nsView displayIfned] | -[NSView _DISPLAYRECTIGNOROGOPACITION : ISVISIBLERECT : rectisvisiBlerectForView :] | -[nsthemeFrame _RecursivedIsplayRectifneedEdignoringOpacity : isvisiblerect : rectisvisiblerectforview : topview :] | -[NSView _RecursivedIsplayRectifneedEdeGignoringOpacity : IsvisiBlerect : rectisvisiblerectforview : topview :] | -[NSView _RecursivedIsplayRectifneedEdeGignoringOpacity : IsvisiBlerect : rectisvisiblerectforview : topview :] | -[NSView _RecursivedIsplayRectifneedEdeGignoringOpacity : IsvisiBlerect : rectisvisiblerectforview : topview :] | -[NSView _RecursivedIsplayRectifneedEdeGignoringOpacity : IsvisiBlerect : rectisvisiblerectforview : topview :] | -[NSView _RecursivedIsplayRectifneedEdeGignoringOpacity : IsvisiBlerect : rectisvisiblerectforview : topview :] | -[NSView _RecursivedIsplayAllDirtyWithLockFocus : VisRect :] | -[nsView _DrawRect : clip :] | -[nsControl drawRect :] | -[nsmenuiteMcell drawitwithframe : inview :] | -[NSPOPUPBUTTONCELL _DrawIndicatorwithFrame : inview :] | -[NSPOPUPBUTTONCELL _INDICATORFRAMEFORCELLFRAME : Inview :] | -[NSPOPUPBUTTONCELL _INDICATORFRAMEFORCELLFRAME : ISFLIPPES :] | -[NSPOPUPBUTTONCELL _DEFAULTINDICATORIMAGE] | -[NSPOPUPBUTTONCELL _COREUIDEFAULTINDICATORIMAGE] | +[nsimage imageNamed :] | +[nsimage _coreuiimagewithName :] | +[NSIMAGE _COREUIIMAGEWITHBASENAME : state : bekgroundStyle :] | -[nscoreuiimagerep imagewithOuteffectSrect] | SizeforImageOptions | Cuicopymeasurements | cuirenderer :: copymeasurements (cgrect, cgcontext*, __cfdictionary const*, __cfarray const*) | cuirenderer :: copyimagemeasurements (long, cuicontext const*, __cfarray const*, __cfdictionary*) | CreateImagesOURCEFROMDISK (Long, CuiconText const*, long*, unsigned char*) | cuisharedartreader :: createImagesOURCE (long) | cgimagesOURCEREATEWITHDATAPROVIDER | CGIMAGEREADCREATEWITHPROVIDER | cgimagereadcreatewithdata | _CGIMAGEREADCREATE | _cfruntimeCreateInstance | cfallocatorAllother | auto_zone_allocation_object call [4] [arg = 0] : Thread_B0103000 | Thread_Start | _pthread_start | auto_collection_thread (void*) | auto_collect_with_mode (auto :: zone*, unsigned int) | auto_collect_internal (auto :: zone*, int)

도움이 되었습니까?

해결책

실제로 Xcode에서 사용하는 하위 레벨 프레임 워크에 있으며 NSIMAGE를 사용하는 쓰레기 수집 응용 프로그램도 동일하지만 성가신 메시지를 생성합니다.

이것들을 침묵시키는 한 가지 방법은 다음과 같습니다. http://0xced.blogspot.com/2008/09/quietxcode.html

다른 팁

나는 이것을 항상 Xcode로 본다. Xcode 자체의 메모리 관리 문제이며 프로그램과 전혀 관련이 없습니다.

오류가 프로그램과 관련된 경우 디버깅 창 (Shift-Command-R을 누를 때 표시되는 것)과 시스템 콘솔에 표시됩니다.

이러한 Xcode Malloc 메시지는 시스템 콘솔에서만 제공되므로 문제가 아닙니다.

이제 Apple 의이 호는 톤의 메모리 오류 로그인을 시스템 콘솔에 버리는 IDE를 공개합니까? 저것 걱정할 것이있을 수 있습니다 :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top