Fabric Answers Crashes on ANSRotateCrashMetadataOperation - google-fabric

Fabrics Answers seems to be crashing. I found the same crash log on the iOS Realm issue on Github.
Crashed: io.answers.EventQueue :: NSOperation 0x17405fbc0 (QOS: BACKGROUND)
0 libswiftCore.dylib 0x101084da0 _stdlib_destroyTLS + 294720
...
11 XXXXX 0x1001f2c4c -[ANSRotateCrashMetadataOperation initWithCrashMetadataURL:currentMetadata:] (ANSRotateCrashMetadataOperation.m:28)
12 XXXXX 0x1001ffdf8 -[ANSAnswersController replacePreviousExecutionMetadataWithCurrentMetadata:inRootDirectory:] (ANSAnswersController.m:273)
13 XXXXX 0x1001fecb8 __56-[ANSAnswersController initWithBetaToken:rootDirectory:]_block_invoke (ANSAnswersController.m:103)
...

Related

Chromium build not running after rebranding

I wanted to try to build and modify Chromium in order to try and learn a few things. When I first built it and ran it (without any changes), it worked perfectly fine, however I tried changes some of the branding in order to tinker with it and it gave me an error message. I referred to two places when rebranding to see where I could change the branding:
First link
Second link
When I ran the modified version, it gave me an error message when running:
[0808/205916.858263:FATAL:bundle_locations.mm(62)] Check failed: new_bundle. Failed to load the bundle at /path/to/src/out/buildTwo/RebrandName.app/Contents/Frameworks/Chromium Framework.framework/Versions/94.0.4601.0
0 libbase.dylib 0x000000010a123638 base::debug::CollectStackTrace(void**, unsigned long) + 12
1 libbase.dylib 0x000000010a00e774 base::debug::StackTrace::StackTrace() + 24
2 libbase.dylib 0x000000010a032c1c logging::LogMessage::~LogMessage() + 184
3 libbase.dylib 0x000000010a033914 logging::LogMessage::~LogMessage() + 12
4 libbase.dylib 0x0000000109ffa0f0 logging::CheckError::~CheckError() + 36
5 libbase.dylib 0x000000010a139d5c base::mac::AssignOverridePath(base::FilePath const&, NSBundle**) + 176
6 libchrome_dll.dylib 0x0000000104ceb5d0 SetUpBundleOverrides() + 40
7 libchrome_dll.dylib 0x0000000104ce8f44 ChromeMain + 156
8 RebrandName 0x00000001049b7cc0 main + 284
9 libdyld.dylib 0x000000018efcd450 start + 4
zsh: trace trap out/buildTwo/RebrandName.app/Contents/MacOS/RebrandName
I tried to investigate to see what might have happened and saw that /path/to/src/out/buildTwo/RebrandName.app/Contents/Frameworks/Chromium Framework.framework but in it's place is /path/to/src/out/buildTwo/RebrandName.app/Contents/Frameworks/RebrandName Framework.framework
I ran out/buildTwo/RebrandName.app/Contents/MacOS/RebrandName and this error popped up.
This is currently running on an M1 Macbook Pro on MacOS Big Sur.
I have tried searching for the fix with no luck. Please understand that I have little to no idea of what I'm doing, so if more clarification is required, please let me know and I will try to edit my question as best as I can.
The file:
chrome/common/chrome_constants.cc
Change PRODUCT_STRING constant

Circuits v3.2 Manager.py **events.effects** Issue

Has anyone noticed errors or event.effect errors when using Version 3.2 of Circuits? I've received the message:
Apr 15 03:48:05 **** resilient-circuits[11462]: event.effects -= 1
Apr 15 03:48:05 **** resilient-circuits[11462]: *AttributeError: 'ThreatServiceLookupEvent' object has no attribute 'effects'*
which seems to be coming from circuits. Specifically line 738 of the the Manager.py script.
[Manager.py]: <https://github.com/circuits/circuits/blob/59b2a7be553fa788d06e7575b39a5eb2ec96f884/circuits/core/manager.py#L738>

Objective C Command Failing When Run Through OSX Cron

I've coded a standalone Objective C command application. If I run it through a LaunchDaemon, it runs just fine when connected by an ObjC client application over DistriutedObjects communication. If I run it at command line, it runs just fine. If I run it when called by a Bash script, it runs just fine. However, in various ways that I've attempted to run this through the root user's crontab, it does a crash report about pointer allocation:
Apr 14 05:27:00 volomike cron[72531]: cron(72531,0x7fff7d2fa000) malloc: *** error for object 0x7fb9c8400213: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Apr 14 05:27:00 volomike diagnosticd[70689]: error evaluating process info - pid: 72531, puniqueid: 72531
Apr 14 05:27:00 volomike com.apple.xpc.launchd[1] (com.vix.cron[72531]): Service exited due to signal: Abort trap: 6
Apr 14 05:27:00 volomike com.apple.xpc.launchd[1] (com.apple.ReportCrash.Root[72550]): Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.ReportCrash.DirectoryService
Apr 14 05:27:00 volomike ReportCrash[72550]: Saved crash report for cron[72531] version 39 to /Library/Logs/DiagnosticReports/cron_2016-04-14-052700_volomike.crash
The significant part of that crash report reads:
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
abort() called
*** error for object 0x7fb9c8400213: pointer being freed was not allocated
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff9490ff06 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff9c45e4ec pthread_kill + 90
2 libsystem_c.dylib 0x00007fff9345b6e7 abort + 129
3 libsystem_malloc.dylib 0x00007fff9c02f041 free + 425
4 cron 0x000000010367aa41 0x103677000 + 14913
5 cron 0x000000010367a7e4 0x103677000 + 14308
6 cron 0x0000000103679572 0x103677000 + 9586
7 cron 0x000000010367925a 0x103677000 + 8794
8 cron 0x000000010367885e 0x103677000 + 6238
9 libdyld.dylib 0x00007fff949835ad start + 1
In the various ways, I've done it with these various cron lines, but they crash immediately when trying to call the command, and even when I have NSLog() writing stuff to /var/log/system.log all the way from the start of main to the end of the application, nothing writes -- it's like when cron tries to call my command, it dies immediately with a crash report about pointer allocation.
41 5 * * * /bin/bash '/Applications/My App.app/Contents/Resources/mytoolcommand.sh' /q /sched
41 5 * * * /bin/bash '/Applications/My App.app/Contents/Resources/mytoolcommand.sh' /q /sched &
41 5 * * * '/Applications/My App.app/Contents/Resources/mytoolcommand' /q /sched
41 5 * * * '/Applications/My App.app/Contents/Resources/mytoolcommand' /q /sched &
Note again that if I do '/Applications/My App.app/Contents/Resources/mytoolcommand.sh' /q /sched, it runs just fine, as does /bin/bash '/Applications/My App.app/Contents/Resources/mytoolcommand.sh' /q /sched, as does '/Applications/My App.app/Contents/Resources/mytoolcommand' /q /sched
I even did a variation where cron called my mytoolcommand.sh script and simply wrote Hello World to /tmp/out.txt, and it ran just fine. So, I know my crontab is working.
Can you help me figure out what I'm doing wrong? Some suspected possible issues:
Perhaps OSX El Capitan is shutting my application down for some reason, such as not being signed properly. (I'm debugging right now. I never had signature issues come up before unless it dealt with .app folders. Besides, I can run it just fine from command line without having a signature warning.)
I have debug messages loading from main() right off the bat. They should be writing to /var/log/system.log, but they're not. This tells me the application is crashing immediately when called by cron. So, is there something special I need to load into my application's libraries in order for it to run properly when called under cron?
DEVELOPMENTS
I suspected that El Capitan Gatekeeper may have been the cause. So, I created a simplistic Objective C console application like so in a main.mm file and compiled.
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
#autoreleasepool {
NSString *sTest = #"Hello World";
[sTest writeToFile:#"/tmp/test.txt" atomically:YES encoding:NSUTF8StringEncoding error:nil];
}
return 0;
}
Cron seems to run this just fine, so it's not looking like a Gatekeeper problem.
I got the problem to go away, but only briefly. I recompiled the project in a brand new project, copying over source code and settings. I then ran the command through the cron about 4 times without an issue. However, when I ran it the fifth time, it failed again and continued failing.
So, I guess I'm going to have to figure out how to convert this into a LaunchAgent.
The answer is YOU DON'T. You don't use cron anymore on OSX for your applications you are coding. Instead, switch to a LaunchAgent. Sure, Apple keeps it around for POSIX support, and therefore may keep it around for a very long time, but even their website encourages people to no longer use cron for application coding.
"Note: Although it is still supported, cron is not a recommended
solution. It has been deprecated in favor of launchd."
SOURCE: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/ScheduledJobs.html
Unfortunately, though, LaunchAgents don't yet (in 10.11.4 at least) support cron-style syntax. (Yeah, I've already filed that suggestion to Apple for you.) So, there's no use of dash, comma, or backslash. Instead, it only supports an integer and multiple blocks to create each timeframe. And if that's not suitable enough, then set at least the most minimal timeframes and then do the rest of the code in whatever you are launching so that, for instance, if you want something only to run on the first Monday of the month, the LaunchDaemon launches in the first seven days but your application does a shutdown if it's not the first Monday of the month.

release ipa: how to symbolicate my classes' calls in a stack trace? Framework calls are shown

My app is written both in objective c and c++. I'm using xcode 4.5 and of course I have developer account, my device is not jailbroken and I've set up everything in my developer account ok.
I do not use "Device Logs" from xcode, instead I've implemented signals/exceptions handlers to write stack traces to file and - when next time app launches - send it to my webserver.
To get stack trace on crash I use [NSException callStackSymbols]. It works. So when I do sample crash like:
NSArray *arr=[NSArray array];
[arr objectAtIndex:100];
while debugging in xcode and launching installed from xcode app on device I get:
0 CoreFoundation 0x36c738a7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x3308a259 objc_exception_throw + 32
2 CoreFoundation 0x36bcb23d -[__NSArrayI objectAtIndex:] + 164
3 MyApp 0x001be505 _ZN8Menu6handleEN12GestureE + 912
4 MyApp 0x000e6ce1 _ZN13BaseLevel10handleBaseEN12GestureE + 440
5 MyApp 0x0011b747 _ZN12Manager6handleEN12GestureE + 742
6 MyApp 0x00102731 _ZN13Processor9doProcessEd + 552
7 GLKit 0x3723a0c5 -[GLKViewController _updateAndDraw] + 272
8 CoreFoundation 0x36bd27d3 -[NSObject performSelector:] + 38
9 QuartzCore 0x3233486f _ZN2CA7Display11DisplayLink8dispatchEyy + 166
10 QuartzCore 0x323347c5 _ZN2CA7Display16IOMFBDisplayLink8callbackEP21__IOMobileFramebufferyyyPv + 60
MyApp c++ and objc classes and methods are symbolicated ok.
But when I make AdHoc ipa, and do the same crach in it I get:
0 CoreFoundation 0x36c738a7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x3308a259 objc_exception_throw + 32
2 CoreFoundation 0x36bcb23d -[__NSArrayI objectAtIndex:] + 164
3 MyApp 0x001be505 _mh_execute_header + 894213
4 MyApp 0x000e6ce1 _mh_execute_header + 11489
5 MyApp 0x0011b747 _mh_execute_header + 227143
6 MyApp 0x00102731 _mh_execute_header + 124721
7 GLKit 0x3723a0c5 -[GLKViewController _updateAndDraw] + 272
8 CoreFoundation 0x36bd27d3 -[NSObject performSelector:] + 38
9 QuartzCore 0x3233486f _ZN2CA7Display11DisplayLink8dispatchEyy + 166
10 QuartzCore 0x323347c5 _ZN2CA7Display16IOMFBDisplayLink8callbackEP21__IOMobileFramebufferyyyPv + 60]
i.e. names of my classes and methods are gone, replaced by symbol _mh_execute_header+<offset>.
I thought I've missed dSYM setting, but it is on for both release and debug, also "strip debug symbols" is off.
Have searched on SO, but no luck. Please tell me what's wrong?
My bad, I was not familar with symbolicate techs.
In short - to symbolicate stack trace you need dSYM of package and xcode to symbolicate the crash log with its private api. Maybe next time I'll write more: still learning how to do it in the most convenient (for me) way.
Edit: a week has passed, and I've developed a solution. It's specific to my multiplatform ecosystem, but here how it works in short. App crashes and sends crash log with all needed data to my server. When I want to see crash logs, I launch utility on my desktop which downloads all the stacks (from release/arm binaries) from the server, which are not proccessed yet. Next it finds corresponding bundles in Xcode Archives folder (gets uuids/vmaddr for arch needed), then calculates real addresses of stack lines (using binary vmaddr and _mh_execute_header address from received log) and calls atos for every address. Then it parses output of atos, generate diff and sends it back to server. This way I can see symbolicated stacks in my php-based bugtracker.
It was not so easy, as getting deobfuscated stacks in java, but still it's possible.
You can use this Symbolication tool I wrote to quickly Symbolicate your app's addresses.
symbolication your.app.dSYM your.app.trace
The symbolicated version will be printed to STDOUT. For best results, keep your .app in the same folder as your .dSYM.
https://github.com/Imperiopolis/Symbolication

My iphone application crashes

I made an application that should run constant until I stop it.
What it basically does is getting some data from connected another device and send that data to the server periodically using NSURLConnection, and read data from the server periodically and visualize that data as a graph using NSXMLParser.
I ran the instrument to check allocs and leaks.
No leak at all. memory monitor shows consistent 5.2MB.
Objectalloc graph is stable, Net bytes of objectallo is arouend 480000 and #net is around 6400.
The problem is the application is stopped (or crashes) about 12 hours later.
What are possible problems? I have absolutely no idea where to start finding the problem because neither a debugger nor the instrument don't show any error or problem.
[added]
1 . as Paul's suggestion, I ran my app on the simulator and got some error messages after 5 hours of running.
InAir(64628,0xa050c720) malloc: *** error for object 0xc015bc87: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
InAir(64628,0xa050c720) malloc: *** error for object 0xa0200100: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0x2080a043: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0x120100: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0x34a00000: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0xc1d3a1b1: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0x46b0a1b1: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0xc1d3a1b1: pointer being freed was not allocated
Program received signal: “EXC_BAD_ACCESS”.
2 . About NilObject's comment... I didn't know the organizer has crashlog. Yes it has.
Incident Identifier: 0ADC2722-BF4B-457F-A224-4A946810FB1F
CrashReporter Key: f62c1dc12071b63c1e21d612962ee6aad74b4503
Process: InAir [3154]
Path: /var/mobile/Applications/9471A5CA-97E1-4E52-A934-9CE33DC5A5DB/InAir.app/InAir
Identifier: InAir
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2009-02-21 21:37:36.786 -0500
OS Version: iPhone OS 2.2.1 (5H11a)
Report Version: 103
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x300c8c18 objc_msgSend + 20
1 InAir 0x00003d34 0x1000 + 11572
2 Foundation 0x306942a0 __NSFireTimer + 132
3 CoreFoundation 0x30269d88 CFRunLoopRunSpecific + 2642
4 CoreFoundation 0x30269320 CFRunLoopRunInMode + 44
5 GraphicsServices 0x31567e58 GSEventRunModal + 268
6 UIKit 0x30a4fa6c -[UIApplication _run] + 520
7 UIKit 0x30a591d0 UIApplicationMain + 1132
8 InAir 0x000020b6 0x1000 + 4278
9 InAir 0x0000202c 0x1000 + 4140
Thread 0 crashed with ARM Thread State:
r0: 0x0013b920 r1: 0x301a2410 r2: 0x0013b920 r3: 0x301a2410
r4: 0xc004ea47 r5: 0x001203d0 r6: 0x001203d0 r7: 0x2fffef50
r8: 0x001203d0 r9: 0x394346d0 r10: 0x001063b0 r11: 0x00000f03
ip: 0x0000a134 sp: 0x2fffeef8 lr: 0x00003d3b pc: 0x300c8c18
cpsr: 0x00000010
(etc... The entire log is here. )
Anybody who can interpret these?
Have you tried to set a breakpoint on malloc_error_break as the error messages tell you? (Run → Manage Breakpoints → Add Symbolic Breakpoint).