App Crashes Right away on Device but not in the Simulator!

@rob

You are 100% right! I commented out the shader and rotation code and now the app runs on my devices!  However, when I press play to to go the game scene (which also contains the same shader which the user can drag to rotate it), the app crashes!  There is defiantly something wrong with the shader or the movement of it.  Any suggestions on what I should do?  Someone on the forum helped me make the shader and it works great on the simulator AND iPhone 6 and iPhone 6 plus!  So there is something very wrong here.  Thanks for the help throughout this issue.  Can’t wait to figure this out!

-Max

Yea, I don’t know shaders well at all.  You can break down the problem a bit more by creating the shader but not rotating/moving it and see if that’s okay.  Then create a new thread about the shader and hopefully someone with a lot more experience than I have can answer.

Rob

@rob 

I will do exactly what you said above.

However, I don’t understand why it works fine on an iPhone 6 or iPhone 6 plus!

If you could explain that to me or give me your theory that would be great! Thanks!

@rob  

I followed what you said to do in your latest reply and the app crashes! Something is wrong with the shader that won’t run!

Any suggestions on how to go about fixing this?

You are going to have to ask on one of the shader threads or start a new thread.  

The iPhone 6/6 Plus has more memory and a more advanced GPU which could explain the issue on the older devices, but still the iPhone 5 and iPad Mini 2 are not very old.

Rob

@rob

Nobody is responding to any of my posts about my problem! :frowning:

Any suggestions?  The app works on an iPhone 6 and iPhone 6 plus but nothing lower…

Might I suggest changing the title of your post to something like “Custom shader crashing with segment violation” that better describe your problem.  You can also bump your post ever 24 hours if you don’t get a response.

Rob

Well you’re crashing to a segmentation error (Signal 11).  This is a case of where you are trying to access a memory pointer that’s pointing to memory you don’t have access too. 

Are you using any features that only work on the device and not the simulator likes ads, gameNetwork, store etc? 

Rob

@rob

Yes I am using Facebook to allow users to login through Facebook connect.

And I have a button that redirects the user to the app store to review my app which also isn’t supported.

Any help so the app runs?

-Max

@rob

???

my reply to your question is above!

Sorry it took me so long to get back on here.  I’m not on the forums 24 hours a day.

Neither of those should cause that crash if they are coded up properly.  Now you need to show us some code.  I would like to see your build.settings file.   We need to see your code from main.lua where you’re calling these things too.

Please make sure to copy/paste the code using the <> in the edit bar above.

Thanks

Rob

@rob

this is my build.settings file:

[lua]–

– For more information on build.settings see the Corona SDK Build Guide at:

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html

settings =

{

plugins = 

{

[“CoronaProvider.native.popup.social”] = 

{

publisherId = “com.coronalabs”

},

[“facebook”] = 

{

publisherId = “com.coronalabs”

},

},

orientation =

{

– Supported values for orientation:

– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

default = “portrait”,

supported = { “portrait”, }

},

excludeFiles =

{

– Include only the necessary icon files on each platform

iphone = { “Icon-*dpi.png”, },

android = { “Icon.png”, “Icon-Small-*.png”, “Icon*@2x.png”, },

},

– iOS Section

iphone =

{

plist =

{

UIApplicationExitsOnSuspend = false,

FacebookAppID = “893514267378337”,  --replace XXXXXXXXXX with your Facebook App ID

UIStatusBarHidden = false,

UIPrerenderedIcon = true, – set to false for “shine” overlay

–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

CFBundleIconFiles =

{

“Icon.png”,

“Icon@2x.png”,

“Icon-60.png”,

“Icon-60@2x.png”,

“Icon-60@3x.png”,

“Icon-72.png”,

“Icon-72@2x.png”,

“Icon-76.png”,

“Icon-76@2x.png”,

“Icon-Small.png”,

“Icon-Small@2x.png”,

“Icon-Small@3x.png”,

“Icon-Small-40.png”,

“Icon-Small-40@2x.png”,

“Icon-Small-50.png”,

“Icon-Small-50@2x.png”,

},

–[[

– iOS app URL schemes:

CFBundleURLTypes =

{

{

CFBundleURLSchemes =

{

“fb893514267378337”,  – replace XXXXXXXXX with your Facebook appId

}

}

}

–]]

}

},

– Android Section

android =

{

usesPermissions =

{

“android.permission.INTERNET”,

},

},

}[/lua]

This is my main.lua:

[lua]-----------------------------------------------------------------------------------------

– main.lua


– Your code here

local facebook = require “facebook”

local fbAppID = “893514267378337”

–go to menu

local storyboard = require “storyboard”

storyboard.gotoScene( “menu” ) [/lua]

Where are you initialing facebook?

Can you also put in some print statements to see how far you’re getting?

Rob

@rob

This is where I am initialing Facebook.  When they click the button, Facebook connect will launch.

[lua]–create facebook icon

local facebookIcon = display.newImage( “FB-f-Logo__blue_114.png” )

facebookIcon.x = display.contentCenterX - 100; facebookIcon.y = display.contentCenterY + 235

facebookIcon:scale(.5, .5)

group:insert(facebookIcon)

–make facebook button work

local function facebookBtn(event)

if (event.phase == “began”) then

print(“facebook worked!”)

facebook.login( fbAppID, facebookListener, { “user_friends”, “email” } )

end

end

facebookIcon:addEventListener( “touch”, facebookBtn )[/lua]

I doubt facebook is the cause since you have it on a button.  Something is happening early on in the process that’s crashing it.   Can you put some print statements in and see how far you’re getting.

Rob

@rob 

I added print statements throughout my game.  Only the menu statements print out to the console in the Xcode debugger console meaning thats the problem.

It seems it is crashing due to ‘<Notice>: Service exited due to signal: Segmentation fault: 11’ or ’ <Error>: assertion failed: 12F70: libxpc.dylib + 51915 [8DB46991-F182-35E3-8E95-918A4007AA7A]: 0x7d’

Either of those looks like the problem to me.  The second error above happens first and the first statement occurs after the code prints out to the console.

All my print statements print out successfully but it still crashes immediately!

Any help?

Thanks in advance!

Can you post your console log again, I’m having trouble following your description.

Rob

@rob

May 24 15:56:31 Maxs-iphone wifid[70] <Notice>: WiFi:[454190191.096806]: WiFi unquiescing requested by “locationd”

May 24 15:56:31 Maxs-iphone wifid[70] <Notice>: WiFi:[454190191.134745]: WiFi unquiescing requested by “locationd”

May 24 15:56:32 Maxs-iphone kernel[0] <Notice>: xpcproxy[580] Container: /private/var/mobile/Containers/Data/Application/E458DDFA-9EDF-4FCF-9F9A-2168EDC95E40 (sandbox)

May 24 15:56:32 Maxs-iphone locationd[64] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

May 24 15:56:33 Maxs-iphone Spin[580] <Error>: assertion failed: 12F70: libxpc.dylib + 51915 [8DB46991-F182-35E3-8E95-918A4007AA7A]: 0x7d

May 24 15:56:33 Maxs-iphone Unknown[580] <Error>: 

May 24 15:56:33 Maxs-iphone Spin[580] <Warning>: Platform: iPhone / iPhone5,2 / 8.3 / PowerVR SGX 543 / OpenGL ES 2.0 IMGSGX543-115.5 / 2015.2625

May 24 15:56:33 Maxs-iphone wifid[70] <Notice>: WiFi:[454190193.470297]: WiFi unquiescing requested by “locationd”

May 24 15:56:33 Maxs-iphone wifid[70] <Notice>: WiFi:[454190193.511113]: WiFi unquiescing requested by “locationd”

May 24 15:56:33 Maxs-iphone Spin[580] <Warning>: adding menu sound effect

May 24 15:56:33 Maxs-iphone Spin[580] <Warning>: creating circle

May 24 15:56:33 Maxs-iphone Spin[580] <Warning>: create wheel effect

May 24 15:56:33 Maxs-iphone Spin[580] <Warning>: add menu objects

May 24 15:56:33 Maxs-iphone Spin[580] <Warning>: create facebook icon

May 24 15:56:33 Maxs-iphone Spin[580] <Warning>: create review app icon

May 24 15:56:33 Maxs-iphone Spin[580] <Warning>: create mute icon

May 24 15:56:33 Maxs-iphone ReportCrash[581] <Error>: task_set_exception_ports(B07, 400, D03, 0, 0) failed with error (4: (os/kern) invalid argument)

May 24 15:56:33 Maxs-iphone ReportCrash[581] <Notice>: ReportCrash acting against PID 580

May 24 15:56:34 Maxs-iphone ReportCrash[581] <Notice>: Formulating crash report for process Spin[580]

May 24 15:56:34 Maxs-iphone com.apple.xpc.launchd[1] (UIKitApplication:com.gegelgames.spin[0x1865][580]) <Notice>: Service exited due to signal: Segmentation fault: 11

May 24 15:56:34 Maxs-iphone SpringBoard[43] <Warning>: BSXPCMessage received error for message: Connection invalid

May 24 15:56:34 Maxs-iphone mediaserverd[37] <Notice>: ‘’ com.gegelgames.spin(pid = 580) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None

May 24 15:56:34 Maxs-iphone mediaserverd[37] <Notice>: ‘’ (pid = 580) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None

May 24 15:56:34 Maxs-iphone wifid[70] <Notice>: WiFi:[454190194.205512]: BG Application: Not Present, BG Daemon: Present. Daemons: apsd networkd UserEventAgent 

May 24 15:56:34 Maxs-iphone SpringBoard[43] <Warning>: Application ‘UIKitApplication:com.gegelgames.spin[0x1865]’ crashed.

May 24 15:56:34 Maxs-iphone assertiond[58] <Warning>: Could not set priority of <BKNewProcess: 0x14d5ed90; com.gegelgames.spin; pid: 580; hostpid: -1> to 2, priority: No such process

May 24 15:56:34 Maxs-iphone assertiond[58] <Warning>: Could not set priority of <BKNewProcess: 0x14d5ed90; com.gegelgames.spin; pid: 580; hostpid: -1> to 4096, priority: No such process

May 24 15:56:34 Maxs-iphone SpringBoard[43] <Warning>: Unable to deliver -[UIRemoteApplication showTopMostMiniAlertWithSynchronizationPort:] message to port 0: (ipc/send) invalid destination port

May 24 15:56:34 Maxs-iphone locationd[64] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

May 24 15:56:34 Maxs-iphone ReportCrash[581] <Notice>: Saved report to /var/mobile/Library/Logs/CrashReporter/Spin_2015-05-24-155633_Maxs-iphone.ips.beta

May 24 15:56:37 Maxs-iphone SpringBoard[43] <Warning>: The view controller <SBBulletinRootViewController: 0x1472a280> returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation.

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementPerform message: attempt to write a readonly database sql: BEGIN IMMEDIATE;

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementReset message: attempt to write a readonly database sql: BEGIN IMMEDIATE;

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementPerform message: attempt to write a readonly database sql: INSERT INTO outgoing_message (guid, alternate_guid, account_guid, from_identifier, message_data, data, protobuf_data, destinations, data_to_encrypt, encrypt_payload, compress_payload, use_top_level_dict, wants_response, expiration_date, command, wants_delivery_status, delivery_status_context, message_uuid, priority, date, is_sent, identifier, forced_local, peer_response_identifier, expects_peer_response, wants_app_ack, non_waking, fire_and_forget, stored_size, duet_identifiers, bypass_duet, queue_one_identifier, enforce_remote_timeout) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementReset message: attempt to write a readonly database sql: INSERT INTO outgoing_message (guid, alternate_guid, account_guid, from_identifier, message_data, data, protobuf_data, destinations, data_to_encrypt, encrypt_payload, compress_payload, use_top_level_dict, wants_response, expiration_date, command, wants_delivery_status, delivery_status_context, message_uuid, priority, date, is_sent, identifier, forced_local, peer_response_identifier, expects_peer_response, wants_app_ack, non_waking, fire_and_forget, stored_size, duet_identifiers, bypass_duet, queue_one_identifier, enforce_remote_timeout) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementPerform message: attempt to write a readonly database sql: INSERT OR REPLACE INTO _SqliteDatabaseProperties VALUES (?, ?);

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementReset message: attempt to write a readonly database sql: INSERT OR REPLACE INTO _SqliteDatabaseProperties VALUES (?, ?);

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementPerform message: attempt to write a readonly database sql: BEGIN IMMEDIATE;

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementReset message: attempt to write a readonly database sql: BEGIN IMMEDIATE;

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementPerform message: attempt to write a readonly database sql: INSERT OR REPLACE INTO _SqliteDatabaseProperties VALUES (?, ?);

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementReset message: attempt to write a readonly database sql: INSERT OR REPLACE INTO _SqliteDatabaseProperties VALUES (?, ?);

May 24 15:56:37 Maxs-iphone identityservicesd[42] <Warning>: [Warning] SQLite error in function: CSDBSqliteStatementReset message: attempt to write a readonly database sql: SELECT ROWID, guid, alternate_guid, account_guid, from_identifier, message_data, data, protobuf_data, destinations, data_to_encrypt, encrypt_payload, compress_payload, use_top_level_dict, wants_response, expiration_date, command, wants_delivery_status, delivery_status_context, message_uuid, priority, date, is_sent, identifier, forced_local, peer_response_identifier, expects_peer_response, wants_app_ack, non_waking, fire_and_forget, stored_size, duet_identifiers, bypass_duet, queue_one_identifier, enforce_remote_timeout FROM outgoing_message WHERE guid = ? ORDER BY ROWID ASC;

@rob

Also, I just tested my app on my iPhone 5 also running iOS 8.3 and it indeed crashes too.

I then tested it on my iPhone 6 and it DOESN’T CRASH!

I have absolutely no idea why it would run on an iPhone 6 but not an iPhone 5 or iPad mini, all running the same updated software.  Thanks in advance for helping me!

-Max