2011-09-27 2 views
1

가끔 내 Cocoa 앱이 시스템 사운드를로드하는 중에 충돌합니다. 본인 스스로 재현 할 수 없었지만 일부 사용자가 내게 오류 보고서를 보냈습니다.시스템 소리를로드하려고 할 때 NSSound가 손상됩니다.

스택 추적은 항상 동일합니다 (아래 참조). 응용 프로그램은 사운드가로드와 충돌되어, 사용자가 [확인]을 클릭, 모달 대화 상자를 엽니 다 :

[NSSound soundNamed:@"Hero"]; 

하는 몇 가지 웹 [1],하지만 해상도에서이 문제의 언급이 있습니다. 주 스레드의 사운드를로드 중이며 다시 재생하려고 시도하지 않습니다. 바로 충돌합니다. 또한 사운드 파일 자체가 손상되지 않았습니다 (한 사용자가 나에게 이메일을 보내고 설치 한 것과 일치 함).

충돌 로그 발췌 :

Crashed Thread: 0 Dispatch queue: com.apple.main-thread 

Exception Type: EXC_BAD_ACCESS (SIGBUS) 
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000009a0d204 

VM Regions Near 0x9a0d204: 
    shared memory   0000000009310000-0000000009511000 [ 2052K] r--/r-- SM=SHM 
--> MALLOC_TINY   0000000009a00000-0000000009c00000 [ 2048K] rw-/rwx SM=COW 
    MALLOC_LARGE   0000000009c00000-000000000bc9c000 [ 32.6M] rw-/rwx SM=PRV 

Application Specific Information: 
objc[8625]: garbage collection is OFF 
Performing @selector(ok:) from sender NSButton 0x236510 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 
0 ???        0x09a0d204 0 + 161534468 
1 com.apple.audio.units.Components 0x7000ed9d AUHAL::AUHAL(ComponentInstanceRecord*, unsigned long, bool) + 775 
2 com.apple.audio.units.Components 0x7002feff ComponentEntryPoint<DefaultOutputAU>::Dispatch(ComponentParameters*, DefaultOutputAU*) + 144 
3 com.apple.CoreServices.CarbonCore 0x98487949 CallComponent + 223 
4 com.apple.CoreServices.CarbonCore 0x98487992 CallComponentDispatch + 29 
5 com.apple.CoreServices.CarbonCore 0x984f3b6c CallComponentOpen + 43 
6 com.apple.CoreServices.CarbonCore 0x98486608 OpenAComponent + 426 
7 com.apple.CoreServices.CarbonCore 0x98486688 OpenComponent + 24 
8 com.apple.AppKit    0x9b810cd3 _initializeCA + 1115 
9 com.apple.AppKit    0x9b811c23 -[NSSound _postInitialization] + 349 
10 com.apple.AppKit    0x9b810609 -[NSSound initWithContentsOfURL:byReference:] + 263 
11 com.apple.AppKit    0x9b812767 +[NSSound _searchForSoundNamed:] + 1044 
12 com.apple.AppKit    0x9b8122de +[NSSound soundNamed:] + 227 

1 : http://lists.apple.com/archives/Cocoa-dev/2007/Oct/msg01159.html

+0

우리에게 더 많은 코드가 표시되었습니다. 그 소리를 어디에서 사용하고 있습니까? ... – Nekto

+0

더 많은 코드를 보여주는 것이 도움이되지 않습니다. backtrace는 꽤 명확합니다. 어떤 경우에는 '[NSSound soundNamed :]'가 충돌을 일으키고 있습니다. – 0xced

답변

0

당신은 했나요 문제의 해결 (또는 오히려 해결이) 전송 changeset 3540에 적용되었다 : 는 사용자 지정 소리 나중에 허용하지 않습니다 changeset 5577 : 레오파드 사용자 지정 사용자 소리 지원.

불행히도 backtraces는 일치하지 않으며 사용자의 충돌 로그는 Snow Leopard 또는 Lion에서 가져온 것이므로 이러한 솔루션은 아마도 사용자에게 적용되지 않을 것입니다. Apple에 bug report을 제출하시기 바랍니다.

+0

감사합니다. 나는이 문제가있는 유일한 사람이 아니라는 소식을 듣고 기쁘다. 나는 소리를 끄기위한 옵션을 추가했다. – Mark

관련 문제