MAC audioUnit AudioComponentInstanceDispose crash - c++

the audio unit subType is kAudioUnitSubType_VoiceProcessingIO,
and use kAudioOutputUnitProperty_CurrentDevice to set Device ID for the audio unit
OSStatus result = AudioOutputUnitStop(audio_unit);
result = AudioUnitUninitialize(audio_unit);
result = AudioComponentInstanceDispose(audio_unit);
Thread trace:
3 ExceptionHandling 0x00007fff3c64ef31 -[NSExceptionHandler _handleException:mask:] + 364
4 ExceptionHandling 0x00007fff3c64ecac NSExceptionHandlerUncaughtSignalHandler + 35
5 libsystem_platform.dylib 0x00007fff204d3d7d _sigtramp + 29
6 CoreFoundation 0x00007fff2050f381 CFStringGetLength + 11
7 CoreFoundation 0x00007fff205225c7 CFStringCompare + 24
8 CoreAudio 0x00007fff221e83f5 _ZN9HALDevice4DuckEfPK14AudioTimeStampf + 921
9 CoreAudio 0x00007fff21d3ed48 AudioDeviceDuck + 843
10 AudioDSP 0x00000001390d7d4a _Z14DuckOtherAudiojff + 51
11 AudioDSP 0x0000000139213e06 _ZN16AUVoiceProcessor22DestroyAggregateDeviceEv + 974
12 AudioDSP 0x0000000139215459 _ZN16AUVoiceProcessorD2Ev + 417
13 AudioDSP 0x00000001392efdec _ZN13ComponentBase8AP_CloseEPv + 30
14 AudioToolboxCore 0x00007fff219e4b6a AudioComponentInstanceDispose + 55

You are disposing of an Audio Instance before it is stopped.
Note that AudioOutputUnitStop may not stop an audio unit immediately, since the audio thread runs asynchronously. If you delay for a half second after stopping the audio unit, that other thread is likely stopped by then and then you can more safely dispose of its resources.

Related

Curl crashing in function "ossl_connect_common" when multiple network calls are made in parallel

Crashed: Thread
0 libsystem_pthread.dylib
0x5948 pthread_rwlock_rdlock + 110
1 XYZ 0x259ac08 CRYPTO_THREAD_read_lock + 10241200
2 XYZ 0x251a184 int_err_get_item + 9714220
3 XYZ 0x2519f0c ERR_lib_error_string + 9713588
4 XYZ 0x2519cd4 ERR_error_string_n + 9713020
5 XYZ 0x260bbfc ossl_strerror + 10704036
6 XYZ 0x260c4e4 ossl_connect_common + 10706316
7 XYZ 0x2610538 Curl_ssl_connect_nonblocking + 10722784
8 XYZ 0x25e2df8 https_connecting + 10536608
9 XYZ 0x25e2d90 Curl_http_connect + 10536504
10 XYZ 0x25f0990 multi_runsingle + 10592824
11 XYZ 0x25f049c curl_multi_perform + 10591556
12 XYZ 0x25d8d28 curl_easy_perform + 10495440
**Operating Version : IOS 15
Curl Version : 7.76.1
OpenSSL Version : OpenSSL 1.1.1k 25 Mar 2021.
Issue : We are making multiple network calls(get/post/multipart)in multiple threads and it works but after some times it crashes when device goes into background.

Crash reported generated by Compiler in Swift 5 xcode 11

My app has been rejected from Apple quite a long time now.
They say that I get crash on dashboard but although it works fine on simulator and device
I implemented 2 approaches to get the crash report
Firebase Analytics
Symbolised the crash reported shared by Apple.
.init(coder:)
It says error generated by compiler
8 SSBS 0x10521c174 DashboardViewController.init(coder:) + 5308788 (<compiler-generated>:0)
9 SSBS 0x10521c238 #objc DashboardViewController.init(coder:) + 5308984 (<compiler-generated>:0)
In this case, what do I need to implement in my ViewController Class file
So the crash report generated fr
om that is :
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
*Last Exception Backtrace:
0 CoreFoundation 0x1adc3b794 0x1adb11000 + 1222548
1 libobjc.A.dylib 0x1ad95dbcc 0x1ad958000 + 23500
2 CoreFoundation 0x1adb31b98 0x1adb11000 + 134040
3 UIKitCore 0x1b1652c74 0x1b12b4000 + 3796084
4 UIFoundation 0x1b123fe94 0x1b11d5000 + 437908
5 UIFoundation 0x1b12400b4 0x1b11d5000 + 438452
6 UIFoundation 0x1b11dccac 0x1b11d5000 + 31916
7 UIKitCore 0x1b1699dd0 0x1b12b4000 + 4087248
8 SSBS 0x10521c174 DashboardViewController.init(coder:) + 5308788 (<compiler-generated>:0)
9 SSBS 0x10521c238 #objc DashboardViewController.init(coder:) + 5308984 (<compiler-generated>:0)
10 UIKitCore 0x1b1973c40 0x1b12b4000 + 7076928
11 UIFoundation 0x1b123fe94 0x1b11d5000 + 437908
12 UIFoundation 0x1b11dccac 0x1b11d5000 + 31916
13 UIKitCore 0x1b1977bbc 0x1b12b4000 + 7093180
14 UIFoundation 0x1b123fe94 0x1b11d5000 + 437908
15 UIFoundation 0x1b12400b4 0x1b11d5000 + 438452
16 UIFoundation 0x1b11dccac 0x1b11d5000 + 31916
17 UIKitCore 0x1b1972cd8 0x1b12b4000 + 7072984
18 UIKitCore 0x1b1975858 0x1b12b4000 + 7084120
19 UIKitCore 0x1b1e4784c 0x1b12b4000 + 12138572
20 SSBS 0x1052b55a8 closure #1 in LoginViewController.RegisterUserOnServer() + 5936552 (LoginViewController.swift:707)
21 Alamofire 0x105e47454 0x105d54000 + 996436
22 Alamofire 0x105d7ac94 0x105d54000 + 158868
23 libdispatch.dylib 0x1ad9009a8 0x1ad8a6000 + 371112
24 libdispatch.dylib 0x1ad901524 0x1ad8a6000 + 374052
25 libdispatch.dylib 0x1ad8b35b4 0x1ad8a6000 + 54708
26 CoreFoundation 0x1adbb97fc 0x1adb11000 + 690172
27 CoreFoundation 0x1adbb46d0 0x1adb11000 + 669392
28 CoreFoundation 0x1adbb3ce8 0x1adb11000 + 666856
29 GraphicsServices 0x1b7cfe38c 0x1b7cfb000 + 13196
30 UIKitCore 0x1b1ce2444 0x1b12b4000 + 10675268
31 SSBS 0x1051ba4b4 main + 4908212 (AppDelegate.swift:21)
32 libdyld.dylib 0x1ada3b8f0 0x1ada3a000 + 6384
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001ada30d88 0x1ada0b000 + 155016
1 libsystem_pthread.dylib 0x00000001ad9491e8 0x1ad947000 + 8680
2 libsystem_c.dylib 0x00000001ad89c9b0 0x1ad82a000 + 469424
3 libsystem_c.dylib 0x00000001ad89c940 0x1ad82a000 + 469312
4 libc++abi.dylib 0x00000001ada04cc0 0x1ad9f2000 + 76992
5 libc++abi.dylib 0x00000001ad9f6e10 0x1ad9f2000 + 19984
6 libobjc.A.dylib 0x00000001ad95de80 0x1ad958000 + 24192
7 SSBS 0x0000000105501948 FIRCLSTerminateHandler() + 8345928 (FIRCLSException.mm:338)
8 SSBS 0x00000001054abc90 CLSTerminateHandler+ 7994512 () + 348
9 libc++abi.dylib 0x00000001ada0414c 0x1ad9f2000 + 74060
10 libc++abi.dylib 0x00000001ada040e4 0x1ad9f2000 + 73956
11 libdispatch.dylib 0x00000001ad901538 0x1ad8a6000 + 374072
12 libdispatch.dylib 0x00000001ad8b35b4 0x1ad8a6000 + 54708
13 CoreFoundation 0x00000001adbb97fc 0x1adb11000 + 690172
14 CoreFoundation 0x00000001adbb46d0 0x1adb11000 + 669392
15 CoreFoundation 0x00000001adbb3ce8 0x1adb11000 + 666856
16 GraphicsServices 0x00000001b7cfe38c 0x1b7cfb000 + 13196
17 UIKitCore 0x00000001b1ce2444 0x1b12b4000 + 10675268
18 SSBS 0x00000001051ba4b4 main + 4908212 (AppDelegate.swift:21)
19 libdyld.dylib 0x00000001ada3b8f0 0x1ada3a000 + 6384*
code of DashboardViewController:
class DashboardViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//navigationHeaderItem()
// Do any additional setup after loading the view.
if(self.isNewDashboard == nil || self.isNewDashboard == true){
self.newDashboardView.isHidden = false
}else{
self.newDashboardView.isHidden = true
}
let menuMangerObj = MenuDrawerManager()
let resultItem=menuMangerObj.getByItemDrawerItem("My Meetings") as NSArray
if(resultItem.count>0){
self.newDashboardView.isHidden = false
}else{
self.newDashboardView.isHidden = true
}
self.loginUserName.text=userdDefaultData.string(forKey: "loginUserName")
}
}
I initiate a view controller like:
let vcObj = self.storyboard?.instantiateViewController(withIdentifier: "DashboardController") as! DashboardViewController
vcObj.isNewDashboard = true
self.navigationController?.pushViewController(vcObj, animated: true)
Am I am missing anything here?

opencv c++ VideoCapture open() error

I'm trying to read a webcam stream in opencv c++ on OS X but when I attempt to open the feed I produce the following error:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
Stacktrace:
*** First throw call stack:
(
0 CoreFoundation 0x00007fff86cfee7b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff9b8e8cad objc_exception_throw + 48
2 CoreFoundation 0x00007fff86c181dc -[__NSArrayM objectAtIndex:] + 204
3 libopencv_highgui.2.4.dylib 0x0000000104b09280 _ZN13CvCaptureFileC2EPKc + 350
4 libopencv_highgui.2.4.dylib 0x0000000104b07cf2 _Z32cvCreateFileCapture_AVFoundationPKc + 34
5 libopencv_highgui.2.4.dylib 0x0000000104afb7ee cvCreateFileCapture + 14
6 libopencv_highgui.2.4.dylib 0x0000000104afba9e _ZN2cv12VideoCapture4openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 64
7 classification.bin 0x0000000104031842 main + 370
8 libdyld.dylib 0x00007fff9c1cc255 start + 1
9 ??? 0x0000000000000005 0x0 + 5
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
Code:
VideoCapture cap;
printf("vidcap created\n"); // This message is printed
cap.open("http://192.168.1.155:80/video.cgi?dummy=.mjpg");
printf("feed opened\n"); // this one is not
What could be the reason for this error?

CCLabelBMFont fails on setString with update

I have Cocos2d app that fail randomly for some user when i try to display a CCLabelBMFont with animation. I'm not able to reproduce the issue on any of my test device. Since it seem to fail on line 845 I'm wondering if I'm runing out of mmemory. I'm using cocos2d v2.0.0.
for (TileBlockModel* tile in [matchInfo tiles]) {
if (tile.matchScore > 0 && tile.spriteObject != nil) {
NSString* str = [NSString stringWithFormat:#"%d",tile.matchScore];
CCLabelBMFont* label = [CCLabelBMFont labelWithString:str fntFile:#"8-WHITE NUMBERS.fnt"];
label.position = ((CCNode*)tile.spriteObject).position;
label.scale = label.scale * fontMultiplier;
label.zOrder = TILE_BLOCK_SCORE_Z_LEVEL;
[gameGrid addChild:label];
CCActionInterval* action = [CCSequence actions:
[CCMoveBy actionWithDuration:.4 position:ccp(0, ((CCNode*)tile.spriteObject).boundingBox.size.height)],
[CCCallBlockN actionWithBlock:^(CCNode* node){
[node removeFromParentAndCleanup:YES];
}],
nil];
[label runAction:[CCSpeedPointer actionWithAction:action speed_:globalGameSpeed]];
}
}
Crash log
0 vault2richesiphone 0x00078a02 -[CCLabelBMFont setString:updateLabel:] (CCLabelBMFont.m:845)
1 vault2richesiphone 0x00078d29 -[CCLabelBMFont setFntFile:] (CCLabelBMFont.m:921)
2 vault2richesiphone 0x00077f1d -[CCLabelBMFont updateLabel] (CCLabelBMFont.m:622)
3 vault2richesiphone 0x000b58b3 -[gameViewController displayMatchScore:] (gameViewController.m:1100)
4 vault2richesiphone 0x000b68ab -[gameViewController animateColumnDrop:andRow:andOffset:animationId:] (gameViewController.m:1226)
5 vault2richesiphone 0x0006755d -[CCRepeat stop] (CCActionInterval.m:307)
6 vault2richesiphone 0x0006c4bf -[CCProgressTo startWithTarget:] (CCActionProgressTimer.m:53)
7 vault2richesiphone 0x0008ca59 +[CCShaderCache sharedShaderCache] (CCShaderCache.m:41)
8 vault2richesiphone 0x000a070d -[CCDirectorIOS setProjection:] (CCDirectorIOS.m:217)
9 QuartzCore 0x3581c7a9 _ZN2CA7Display11DisplayLink8dispatchEyy + 161
10 QuartzCore 0x3581c701 _ZN2CA7Display16IOMFBDisplayLink8callbackEP21__IOMobileFramebufferyyyPv + 65
11 IOMobileFramebuffer 0x37a98fd7 IOMobileFramebufferVsyncNotifyFunc + 155
12 IOKit 0x3480f5ad IODispatchCalloutFromCFMessage + 193
13 CoreFoundation 0x33bf188b __CFMachPortPerform + 119
14 CoreFoundation 0x33bfc3e7 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
15 CoreFoundation 0x33bfc38b __CFRunLoopDoSource1 + 139
16 CoreFoundation 0x33bfb20f __CFRunLoopRun + 1383
17 CoreFoundation 0x33b6e23d CFRunLoopRunSpecific + 357
18 CoreFoundation 0x33b6e0c9 CFRunLoopRunInMode + 105
19 GraphicsServices 0x3774d33b GSEventRunModal + 75
20 UIKit 0x35a8a2b9 UIApplicationMain + 1121

Bool method to check user input

Hi everybody i am trying to make a boolean method that will return value depending upon the user input for the field when submit button is clicked.
- (BOOL)checkuser:(NSString*)input
{
bool result = NO;
if ([input isEqualToString:#"test"])
{
result = YES;
}
else
{
result = NO;
}
return result;
}
And i am refrencing this method from my program as
else if ([Username checkuser] == YES)
{ // do something
}
with following warning
'NSString' may not respond to '-checkuser'
and i am not getting why my program crashing at this point with following error.
2011-03-22 22:57:25.942 Assignment 2[824:207] -[NSCFString checkuser]: unrecognized selector sent to instance 0x4b7c050
2011-03-22 22:57:25.944 Assignment 2[824:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString checkuser]: unrecognized selector sent to instance 0x4b7c050'
* Call stack at first throw:
(
0 CoreFoundation 0x00db8be9 exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f0d5c2 objc_exception_throw + 47
2 CoreFoundation 0x00dba6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00d2a366 __forwarding + 966
4 CoreFoundation 0x00d29f22 _CF_forwarding_prep_0 + 50
5 Assignment 2 0x00002958 -[Assignment_2ViewController SubmitbuttonPressed:] + 727
6 UIKit 0x002c1a6e -[UIApplication sendAction:to:from:forEvent:] + 119
7 UIKit 0x003501b5 -[UIControl sendAction:to:forEvent:] + 67
8 UIKit 0x00352647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
9 UIKit 0x003511f4 -[UIControl touchesEnded:withEvent:] + 458
10 UIKit 0x002e60d1 -[UIWindow _sendTouchesForEvent:] + 567
11 UIKit 0x002c737a -[UIApplication sendEvent:] + 447
12 UIKit 0x002cc732 _UIApplicationHandleEvent + 7576
13 GraphicsServices 0x016eea36 PurpleEventCallback + 1550
14 CoreFoundation 0x00d9a064 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52
15 CoreFoundation 0x00cfa6f7 __CFRunLoopDoSource1 + 215
16 CoreFoundation 0x00cf7983 __CFRunLoopRun + 979
17 CoreFoundation 0x00cf7240 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x00cf7161 CFRunLoopRunInMode + 97
19 GraphicsServices 0x016ed268 GSEventRunModal + 217
20 GraphicsServices 0x016ed32d GSEventRun + 115
21 UIKit 0x002d042e UIApplicationMain + 1160
22 Assignment 2 0x00001c04 main + 102
23 Assignment 2 0x00001b95 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
(gdb)
You're over-complicating a very simple problem:
- (BOOL) checkuser:(NSString*)input {
return [input isEqualToString:#"test"];
}
and then to call it:
if ([Username checkUser:#"DONT FORGET YOUR PARAM HERE"]) {
// Do something...
}
In your example, you're not passing any parameter to your method... That's a misstake hence your error.
Also, if you create a method returning a 'BOOL', make sure you're returning a 'BOOL' and not a 'bool'. You have to always keep in mind that the underlying types can be different, even if a bool can be evaluated to a BOOL.
else if ([Username checkuser] == YES)
checkuser is supposed to receive a NSString*, which you are not sending though and is the reason for error messages. So, it should be -
Assuming someNSString is initialized and is of type NSString*.
else if( ([Username checkuser:someNSString] ) == YES )
// ^^^^^^^^^^^^ Needs to be passed as the method prototype mentions so.
{
// ....
}
NSString* someNSString = #"Forgot to pass this" ;
else if( ([Username checkuser:someNSString] ) == YES )
// ^^^^^^^^^^^^ Needs to be passed as the method prototype mentions so.
{
// ....
}