2

I am using Distributed objects for communicating between 2 processes as per what is given. here

Whenever I try to send many messages in a short span of time , I observe the following crash. It happens only on MAC OS 10.5. It seems to be working fine on 10.6/10.7

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000001
Crashed Thread:  26




    Thread 26 Crashed:
        0   libSystem.B.dylib               0x9453d2ee ConnectionResponse + 100
        1   libSystem.B.dylib               0x9453d114 DNSServiceProcessResult + 754
        2   com.apple.CFNetwork             0x929566b1 _SocketCallBack_NetService(__CFSocket*, unsigned long, __CFData const*, void const*, void*) + 43
        3   com.apple.CoreFoundation        0x92a5a6f0 __CFSocketDoCallback + 640
        4   com.apple.CoreFoundation        0x92a5bd35 __CFSocketPerformV0 + 133
        5   com.apple.CoreFoundation        0x92a513c5 CFRunLoopRunSpecific + 3141
        6   com.apple.CoreFoundation        0x92a51aa8 CFRunLoopRunInMode + 88
        7   com.apple.Foundation            0x9156c869 -[NSSocketPortNameServer portForName:host:nameServerPortNumber:] + 457
        8   com.apple.Foundation            0x9156c4c8 -[NSSocketPortNameServer portForName:host:] + 56
        9   com.apple.Foundation            0x91446a68 +[NSConnection connectionWithRegisteredName:host:usingNameServer:] + 56
        10  ...yyyyyyyyyy.xxxxxxxx          0x00110bbe -[MessageSendingModule sendMessageInternal:] + 617

Can this be caused due to many simultaneous requests to the mDNSresponder . The approach works fine for lesser number of messages. Can anyone please help ???

ping localhost
  • 479
  • 3
  • 22

1 Answers1

0

Consider reworking the code with this example that I've created here in 2016. Perhaps that can provide you some stability. Also, you posted this back in 2012. OSX 10.5 is going to be fairly old -- most of my OSX applications I'm coding now only support as far back as OSX 10.8. Meanwhile, on crashes, something recently I've learned is that you can have weird stuff appear in the wrong place in your code (a misnomer) if you're using C APIs and not allocating memory properly. For instance, if you're using functions like sprintf and other *f C functions that do stuff with char's. Recently, I used char *s; instead of char s[1000]; and my application crashed in the IPC mechanism to my wild surprise! I was getting BAD ACCESS on thread messages. When I fixed the char declaration, my IPC suddenly started working properly without crashes. Go figure!

If that doesn't fix you, then you're likely looking at the sockets being overwhelmed by the number of connections you're making. For that, you probably need to rethink how you've architected your solution and find a better strategy that connects less often.

Community
  • 1
  • 1
Volomike
  • 23,743
  • 21
  • 113
  • 209