• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Source debugging into coreaudio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Source debugging into coreaudio


  • Subject: Re: Source debugging into coreaudio
  • From: Jeff Moore <email@hidden>
  • Date: Wed, 28 Oct 2009 11:36:51 -0700



On Oct 28, 2009, at 10:15 AM, Chuck Carlson wrote:

Thanks Jeff, but I do have GuadMalloc enabled and am not getting any notification of problems on the first run.

GuardMalloc "notifies" by causing a crash when it detects a bad memory access =)



I have a feeling the problem is with the USBAudio driver I am using. I do have the source and can build with firelog options, but am looking for some more clues.

Except for some very rare situations, audio drivers in the kernel don't corrupt memory in a user process. In fact of all the times I have seen crashes like yours (like I said, it seems to come up more often than you'd think), there hasn't been a single instance where the driver was at fault.


I'm not saying that you are wrong in suspecting the driver. Drivers do a lot of unexpected things. But, it makes more sense in this case to look for user-land causes of this problem first.


On Wed, Oct 28, 2009 at 9:48 AM, Jeff Moore <email@hidden> wrote:
Sorry to say, but you can't debug the HAL at the source level. We do not make those sources available.


At any rate, as I mentioned to you when you first wrote about this problem, this crash is a memory smasher. Essentially, something in your process is corrupting memory in such a way as to cause the interface between the HAL and the IORegistry to crash.

This is probably more common than it should be, but the problem is going to be squarely with your code in this process. Your best bet is to use the malloc debug options and/or the GuardMalloc library. This will give you a better shot at finding the corruption when it takes place rather than long after the fact when the crash happens.


On Oct 28, 2009, at 9:41 AM, Chuck Carlson wrote:

Hello,

A few weeks ago I encountered the EXC_BAD_ACCESS problem below, and fixed it in a kludge fashion by linking to the carbon framework.

Now I have time to fix it correctly and would like to be able to source level debug.

This problem happens on the second run of the program, so it seems something is being corrupted on the first run.

I downloaded the IOAudioFamily project from opensource.apple.com in an attempt to do source level debugging, but can't find the symbol IsConstantRateClock,so I must have the wrong source.

Is it possible to do source level debugging in this situation? Where can I find the code? How does one get xcode to use the source?

Thanks,

--Chuck




Process: sp.CoreAudioServer [1726] Path: /Users/Chuck/Documents/work/ max/sp.udp~/trunk/build/Build/sp.CoreAudioServer Identifier: sp.CoreAudioServer Version: ??? (???) Code Type: X86 (Native) Parent Process: bash [1714]

Date/Time:       2009-10-28 09:02:38.879 -0700
OS Version:      Mac OS X 10.6.1 (10B504)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Application Specific Information:
objc_msgSend() selector name: _getValue:forType:


Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x91f1991b objc_msgSend + 27
1 com.apple.audio.CoreAudio 0x91e7f5c7 IOA_HWDevice::IsConstantRateClock(unsigned int, unsigned int) + 87
2 com.apple.audio.CoreAudio 0x91e7f523 IOA_HWDevice::IsConstantRateClock() const + 45
3 com.apple.audio.CoreAudio 0x91e7f174 IOA_HWDevice::Initialize() + 316
4 com.apple.audio.CoreAudio 0x91e7e6b2 IOA_HWDeviceManager::IOServiceMatchingHandler(IOA_HWDeviceManager*, unsigned int) + 174
5 com.apple.audio.CoreAudio 0x91e7e5fb IOA_HWDeviceManager::Initialize() + 245
6 com.apple.audio.CoreAudio 0x91e7baab HP_HardwarePlugIn_InitializeWithObjectID (AudioHardwarePlugInInterface**, unsigned long) + 85
7 com.apple.audio.CoreAudio 0x91e7ba3a HALPlugIn::Initialize() + 48
8 com.apple.audio.CoreAudio 0x91e7abca HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) + 1882
9 com.apple.audio.CoreAudio 0x91e794bf HALPlugInManagement::Initialize() + 387
10 com.apple.audio.CoreAudio 0x91e79325 HALSystem::InitializeDevices() + 11
11 com.apple.audio.CoreAudio 0x91e74ddf HALSystem::CheckOutInstance() + 409
12 com.apple.audio.CoreAudio 0x91e90f52 AudioDeviceSetProperty + 88
13 sp.CoreAudioServer 0x00002616 start_audio_device + 97 (coreaudioserver.c:219)
14 sp.CoreAudioServer 0x0000233e main + 88 (coreaudioserver.c:57)
15 sp.CoreAudioServer 0x000022ba start + 54


Thread 1: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x90ce703a kevent + 10
1 libSystem.B.dylib 0x90ce7768 _dispatch_mgr_invoke + 215
2 libSystem.B.dylib 0x90ce6bf9 _dispatch_queue_invoke + 183
3 libSystem.B.dylib 0x90ce698a _dispatch_worker_thread2 + 234
4 libSystem.B.dylib 0x90ce6401 _pthread_wqthread + 390
5 libSystem.B.dylib 0x90ce6246 start_wqthread + 30


Thread 2:
0 libSystem.B.dylib 0x90ce6092 __workq_kernreturn + 10
1 libSystem.B.dylib 0x90ce6628 _pthread_wqthread + 941
2 libSystem.B.dylib 0x90ce6246 start_wqthread + 30


Thread 0 crashed with X86 Thread State (32-bit):
 eax: 0xa09c5810  ebx: 0x97638831  ecx: 0x911bc783  edx: 0x00101190
 edi: 0x00000000  esi: 0xa09c5810  ebp: 0xbffff508  esp: 0xbffff394
  ss: 0x0000001f  efl: 0x00010282  eip: 0x91f1991b   cs: 0x00000017
  ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
 cr2: 0x00000000


--

Jeff Moore
Core Audio
Apple



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Source debugging into coreaudio
      • From: Chuck Carlson <email@hidden>
References: 
 >Re: Source debugging into coreaudio (From: Chuck Carlson <email@hidden>)
 >Re: Source debugging into coreaudio (From: Jeff Moore <email@hidden>)

  • Prev by Date: Re: Adding Distortion, Reverb & Compression
  • Next by Date: Re: channel layout for 3DMixer
  • Previous by thread: Re: Source debugging into coreaudio
  • Next by thread: Re: Source debugging into coreaudio
  • Index(es):
    • Date
    • Thread