Register x1 is not available

Hi at all,

i have update my xcode to 7.1 version to run my app (USAG app) on iOS 9.1.

When I run the app and use a function that accesses the internal database , the app crashes.

The error message is as follows : EXC_BAD_ACCESS and the database register is "not available".

Here's the code and a screenshot

Post the symbolicated crash log.

(Your post didn't show the code nor screenshot).

This is the code:

NSArray *)getFirstClassifications
{
    sqlite3 *database;


    NSMutableArray *result = [[NSMutableArray alloc] init];


if(sqlite3_open([databasePath UTF8String], &database)== SQLITE_OK) {
        const char *sqlStatement;
            if([[self getCurrentLanguage] isEqualToString:@"it-IT"] || [[self getCurrentLanguage] isEqualToString:@"it"])
        {
            sqlStatement = "select a.id, title_it, flag_new, promo_list, path, type from firstclassifications a left join images b on a.images_id_it=b.id ";
        }
        else
        {
            sqlStatement = "select a.id, title_en, flag_new, promo_list, path, type from firstclassifications a left join images b on a.images_id_en=b.id ";
        }
    
        sqlite3_stmt *compiledStatement;
        if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
          
            while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
          
                NSInteger uid = sqlite3_column_int(compiledStatement, 0);
                NSString *titleIt = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
                BOOL flagNew = sqlite3_column_int(compiledStatement, 2);
                NSString *promoList = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
            
                NSString *imagePath =[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];
                NSString *imageFullPath = [NSString stringWithFormat:@"ipad_img_1/%@",imagePath];
               FirstClassification *fc = [[FirstClassification alloc] initWithParams:uid titleIt:titleIt flagNew:flagNew promoList:promoList imagePath:imageFullPath];
                [result addObject:fc];
            }
        }

        sqlite3_finalize(compiledStatement);
    }
    sqlite3_close(database);

    return  result;
}

The error message is shown at the line 9 and the error message shown is:"EXC_BAD_ACCESS".

The object database show this log:" (sqlite3 *) database = <register x1 is not available>"

1. That code won't compile.

2. Post the symbolicated crash log.

How can i create the symbolicated crash log?Thanks

Xcode/Window/Devices/View Device Logs

That isn't symbolicated.

If it were, we would be seeing source code line numbers whereever your app name 'usagApp' appears.

It's not necessary to point the binary images.

I have seen that the variable "database" is always null!

How can i solve the problem?

Thanks

Anyone can help me?

Post the symbolicated crash log like I asked you to.

There's not much help anyone can provide you because, according to the code you've provided, the likely scenarios are:

1. Your database path is incorrect and thus line 9 is failing.

2. You changed something in your code and now getFirstClassifications is being called before databasePath has been initialized to the right value, and thus line 9 is failing.


To be blunt, if your code on line 31 is any indication--the line where you construct a file path using -stringWithFormat instead of either appending path components or using a bundle search path--there's any number of variations of case one or two that could be true.

"register x1 is not available" seems suspicious - how are you including sqlite? Are you using the built-in library included with the OS, or statically linking your own, or ???

The message "register x1 is not available" is an Xcode/lldb 'feature'. It's a message that the variable would be stored in that register, but due to optimization currently isn't.


If you do a search for "register XY is not available" or "register %@ is not available" you can find a discussion of the matter.

Good to know. So does this sound more like a compiler bug that could possibly be worked around by trivial code changes, or perhaps a build setting to change the optimization level?

To be honest, it doesn't sound like a compiler bug at all. It sounds more like "My app crashed, and I don't understand why" with the addition of random, assorted technical details. The sort of typical calamity one expects to see for someone learning C or Objective-C. :-/

True enough. Since we still haven't seen a symbolicated crash log, we are all just guessing at this point.

Hello everyone , and thanks for the information . I'm using xcode 7.1 but I can not get the symbolicated crash log . I followed both the signs of HyperNovaSoftware that the online guide .How can I get these logs ? Thanks

That's the OS X log.

Not helpful.

Need the symbolicated crash log.

Google if you are having problems finding it.

Incident Identifier: 23FFC69E-4F54-4B6A-8EC8-FD71D80FB777

CrashReporter Key: e42f7bcf286ecdbcf9434017a6e9663259083a40

Hardware Model: iPad4,4

Process: usagApp [1280]

Path: /private/var/mobile/Containers/Bundle/Application/BA1A3AF1-85C2-462C-8ADB-3BF08F620E24/usagApp.app/usagApp

Identifier: it.reggiani.usagApp

Version: 3.1 (3.1)

Code Type: ARM-64 (Native)

Parent Process: Exited process [1279]



Date/Time: 2015-12-03 12:03:27.27 +0100

Launch Time: 2015-12-03 10:30:26.26 +0100

OS Version: iOS 9.1 (13B143)

Report Version: 105



Exception Type: EXC_BAD_ACCESS (SIGSEGV)

Exception Subtype: KERN_INVALID_ADDRESS at 0x746e693a7ab58354

Triggered by Thread: 0



Filtered syslog:

None found



Global Trace Buffer (reverse chronological seconds):

5579.191979 AppleJPEG 0x000000018b12e348 [0x14f86ca00] Created session

Is this the correct log?Thank you!!!

Now all we need is the part of the log that shows Thread 0.

Triggered by Thread: 0

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

Thread 0 Crashed:

9 libsystem_pthread.dylib 0x00000001993e61e0 0x1993e4000 + 8672

10 libsystem_pthread.dylib 0x00000001993e5d58 0x1993e4000 + 7512

11 libsystem_pthread.dylib 0x00000001993e553c 0x1993e4000 + 5436

12 libsystem_pthread.dylib 0x00000001993e5020 0x1993e4000 + 4128

11 libsystem_pthread.dylib 0x00000001993e61e0 0x1993e4000 + 8672

12 libsystem_pthread.dylib 0x00000001993e5d58 0x1993e4000 + 7512

13 libsystem_pthread.dylib 0x00000001993e553c 0x1993e4000 + 5436

14 libsystem_pthread.dylib 0x00000001993e5020 0x1993e4000 + 4128

20 libsystem_pthread.dylib 0x00000001993e5470 0x1993e4000 + 5232

21 libsystem_pthread.dylib 0x00000001993e5020 0x1993e4000 + 4128

1 libsystem_pthread.dylib 0x00000001993e5530 0x1993e4000 + 5424

2 libsystem_pthread.dylib 0x00000001993e5020 0x1993e4000 + 4128

28 libsystem_pthread.dylib 0x00000001993e5470 0x1993e4000 + 5232

29 libsystem_pthread.dylib 0x00000001993e5020 0x1993e4000 + 4128

15 libsystem_pthread.dylib 0x00000001993e5470 0x1993e4000 + 5232

16 libsystem_pthread.dylib 0x00000001993e5020 0x1993e4000 + 4128

8 libsystem_pthread.dylib 0x00000001993e5470 0x1993e4000 + 5232

9 libsystem_pthread.dylib 0x00000001993e5020 0x1993e4000 + 4128

Thread 0 crashed with ARM Thread State (64-bit):

0x1993e4000 - 0x1993ecfff libsystem_pthread.dylib arm64 <c2dc25304a05357191b5dac769fdc530> /usr/lib/system/libsystem_pthread.dylib

Incident Identifier: 23FFC69E-4F54-4B6A-8EC8-FD71D80FB777

CrashReporter Key: e42f7bcf286ecdbcf9434017a6e9663259083a40

Hardware Model: iPad4,4

Process: usagApp [1280]

Path: /private/var/mobile/Containers/Bundle/Application/BA1A3AF1-85C2-462C-8ADB-3BF08F620E24/usagApp.app/usagApp

Identifier: it.reggiani.usagApp

Version: 3.1 (3.1)

Code Type: ARM-64 (Native)

Parent Process: Exited process [1279]



Date/Time: 2015-12-03 12:03:27.27 +0100

Launch Time: 2015-12-03 10:30:26.26 +0100

OS Version: iOS 9.1 (13B143)

Report Version: 105



Exception Type: EXC_BAD_ACCESS (SIGSEGV)

Exception Subtype: KERN_INVALID_ADDRESS at 0x746e693a7ab58354

Triggered by Thread: 0



Filtered syslog:

None found



Global Trace Buffer (reverse chronological seconds):

5579.191979 AppleJPEG 0x000000018b12e348 [0x14f86ca00] Created session







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

Thread 0 Crashed:

0 libobjc.A.dylib 0x00000001989c5bdc 0x1989ac000 + 105436

1 usagApp 0x000000010015724c 0x1000c0000 + 619084

2 usagApp 0x000000010014ba80 0x1000c0000 + 572032

3 usagApp 0x000000010014b9c4 0x1000c0000 + 571844

4 UIKit 0x00000001893f8098 0x1893e0000 + 98456

5 UIKit 0x0000000189410350 0x1893e0000 + 197456

6 UIKit 0x00000001895a9fb4 0x1893e0000 + 1875892

7 UIKit 0x00000001894b6190 0x1893e0000 + 876944

8 UIKit 0x00000001894b5e6c 0x1893e0000 + 876140

9 UIKit 0x00000001894b5dd4 0x1893e0000 + 875988

10 UIKit 0x00000001893f37ac 0x1893e0000 + 79788

11 QuartzCore 0x0000000188bf2b58 0x188be4000 + 60248

12 QuartzCore 0x0000000188bed764 0x188be4000 + 38756

13 QuartzCore 0x0000000188bed624 0x188be4000 + 38436

14 QuartzCore 0x0000000188beccc0 0x188be4000 + 36032

15 QuartzCore 0x0000000188beca08 0x188be4000 + 35336

16 QuartzCore 0x0000000188be60f8 0x188be4000 + 8440

17 CoreFoundation 0x0000000183e1bbd0 0x183d40000 + 900048

18 CoreFoundation 0x0000000183e19974 0x183d40000 + 891252

19 CoreFoundation 0x0000000183e19da4 0x183d40000 + 892324

20 CoreFoundation 0x0000000183d48ca0 0x183d40000 + 36000

21 GraphicsServices 0x000000018edb0088 0x18eda4000 + 49288

22 UIKit 0x0000000189460ffc 0x1893e0000 + 528380

23 usagApp 0x000000010014b66c 0x1000c0000 + 570988

24 libdyld.dylib 0x00000001991f68b8 0x1991f4000 + 10424

Is correct this log??Thank you

It is the log, but it is not symbolicated. If it were, the lines


1   usagApp                       0x000000010015724c 0x1000c0000 + 619084
2   usagApp                       0x000000010014ba80 0x1000c0000 + 572032
3   usagApp                       0x000000010014b9c4 0x1000c0000 + 571844


would contain useful information: the exact file and line numbers in your code where the crash occurred. Without that, there's not much anyone can help with.


If Xcode won't symbolicate it when you view the log in Devices -> Device Logs, then you have an uphill task. Some people have reported that the build UUID doesn't match for some reason and have had success editing the log with the correct UUID to match the correct DSYM from your app archive... it's not for the faint of heart though. From what I've read there's no "one size fits all" solution to fix symbolication problems.

I searched the forums but it seems a limit xcode 7. There is an alternative way to trace the log ?

Register x1 is not available
 
 
Q