My app crashes randomly

Hi, 

I’m having a problem running my app on the iPad. When I execute the game I can play until de game decides to crash randomly. I’ve executed with the Ipad connected to the Xcode with this result:

Apr 24 20:48:59 iPad-de-Jacobo Lily Dragon[3321] <Warning>: fruta cortada: naranja

Apr 24 20:49:01 iPad-de-Jacobo ReportCrash[3323] <Error>: task_set_exception_ports(B07, 400, D03, 0, 0) failed with error (4: (os/kern) invalid argument)

Apr 24 20:49:01 iPad-de-Jacobo ReportCrash[3323] <Notice>: ReportCrash acting against PID 3321

Apr 24 20:49:01 iPad-de-Jacobo diagnosticd[3270] <Error>: error evaluating process info - pid: 3321, punique: 3321

Apr 24 20:49:01 iPad-de-Jacobo ReportCrash[3323] <Notice>: Formulating crash report for process Lily Dragon[3321]

Apr 24 20:49:01 iPad-de-Jacobo mediaserverd[19] <Notice>: ‘’ com.lilymedia.lilydragon(pid = 3321) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None

Apr 24 20:49:01 iPad-de-Jacobo mediaserverd[19] <Notice>: ‘’ (pid = 3321) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None

Apr 24 20:49:01 iPad-de-Jacobo com.apple.xpc.launchd[1] (UIKitApplication:com.lilymedia.lilydragon[0xae9e][3321]) <Notice>: Service exited due to signal: Segmentation fault: 11

Apr 24 20:49:01 iPad-de-Jacobo ReportCrash[3323] <Notice>: Saved report to /var/mobile/Library/Logs/CrashReporter/Lily Dragon_2015-04-24-204901_iPad-de-Jacobo.ips

Apr 24 20:49:01 iPad-de-Jacobo SpringBoard[1889] <Warning>: Application ‘UIKitApplication:com.lilymedia.lilydragon[0xae9e]’ crashed.

Apr 24 20:49:01 iPad-de-Jacobo assertiond[59] <Warning>: pid_suspend failed for <BKNewProcess: 0x12e540c80; com.lilymedia.lilydragon; pid: 3321; hostpid: -1>: Unknown error: -1, Unknown error: -1

Apr 24 20:49:01 iPad-de-Jacobo assertiond[59] <Warning>: Could not set priority of <BKNewProcess: 0x12e540c80; com.lilymedia.lilydragon; pid: 3321; hostpid: -1> to 2, priority: No such process

Apr 24 20:49:01 iPad-de-Jacobo assertiond[59] <Warning>: Could not set priority of <BKNewProcess: 0x12e540c80; com.lilymedia.lilydragon; pid: 3321; hostpid: -1> to 4096, priority: No such process

Apr 24 20:49:01 iPad-de-Jacobo UserEventAgent[17] <Warning>: id=com.lilymedia.lilydragon pid=3321, state=0

Apr 24 20:49:08 iPad-de-Jacobo locationd[56] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

 

 

Anyone know what happens to my app?

 

Thanks in advance!

Is there more to the console log?

Rob

I attach a file with the full log.

This seems to be the relevant error:

Service exited due to signal: Segmentation fault: 11

A segmentation vault is where your code tries to access a portion of protected memory.  Generally this is caused by a bad pointer (in C language terms).  For instance let’s say you have a function called “doSomething” and it’s memory address is 0x483949384.  The variable doSomething contains that memory address and when you call doSometing() it goes to that memory address and starts executing code.   But if something comes along and sticks a value like 12 in there and Lua still thinks its a function, and it tries to jump t that location.  The Operating System’s kernel says that’s not allowed and dumps your program.

Generally I’ve seen this happen when you have something like a RunTime listener running in a scene and you change that scene and then remove the scene.  All of a sudden that function is no longer in memory but some event is still trying to go there.  I would look for any onComplete listeners that may be completing after removing something it’s trying to use.   It’s happening after this:

Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: Level: 4
Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: ---------------
Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: ----INITSET----
Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: ---------------
Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: ACTIVITY TOKEN: 85506afb4f9bd98a5bc805073cbc4dbd
Apr 26 08:39:24 iPad-de-Sergi Lily Dragon[7981] <Warning>: numero de cuerda: 1
Apr 26 08:39:24 iPad-de-Sergi Lily Dragon[7981] <Warning>: fruta cortada: manzana

If that will narrow you in. 

Rob

Hi, I’m still working on the problem with no success :frowning:

My game is a kind of Cut the Rope with 1, 2 or 3 cords with a fruit on it, the game asks for the correct fruit and the player must cut the correct cord to achieve the next level.

I tried what you tell me about if there where a RunTime and all of this but the problem is still there, I tried to install anothers versions of Corona, and looking for Google what I should do, I close all I can close before changing the scene but crashes randomly.

I send you again another log and a part of the code to see if someone can help me with it, I’ve been trying things for a week and I don’t know what can I do…

Thanks in advance!

I feel for you.  These are frustrating problems.  But we can’t debug your code for you.  You need to put in more print statements and try to narrow down where the crash is happening.

You can google how to symbolcate the crash dump, but you will have to download the dump from Xcode and use the .dSYM file we output when we build the app.  If you can zip up the crash dump (can’t use the log version) and the .dSYM file and if Engineering has time they might be able to see what’s happening.

Rob

Hi Rob,

How can I get de .dSYM file? building the app? Because I’ve builded but I don’t see that file. I’m using the Corona sdk version 2625

And when I get it, where I have to send the 2 files?

Thanks in advance!!!

@info6842 Hey Id recommend @roaminggamer to help out(really cool guy) I’m pretty sure he’d be able to figure out what’s causing this problem :slight_smile:

Simply include a plugin in your build.settings.  You don’t have to use it, but it will trigger building a .dSYM file.

Then download the crash file from your device using Xcode into the same folder with the .app and .dSYM file and use these instructions to symbolcate the crash file:

http://blog.kevincupp.com/2011/05/12/symbolicating-ios-crash-logs.html

Then that might give us a clue where it’s crashing.

Rob

Hi there everyone!

 

I have encountered a problem with implementation of a custom shader that for some odd reason, causes my app to crash on an iPhone 5 and iPad mini  but not an iPhone 6 or iPhone 6 plus!   I am also getting a segmentation fault 11 error that causes my app to crash immediately after it is opened.  Any help is appreciated!  

 

Below is the code for my custom shader and my implementation of it:

 

  1. –kernel file to make shader
  2. local kernel = {}
  3.  
  4. kernel.language = “glsl”
  5. kernel.category = “generator”
  6. kernel.name = “wheel”
  7. kernel.isTimeDependent = true
  8.  
  9.  
  10. kernel.fragment =
  11. [[
  12. P_COLOR vec4 FragmentKernel( P_UV vec2 texCoord )
  13. {
  14. P_UV vec2 pos = 2. * (texCoord - .5); // Get relative position and normalize it to [-1, 1]
  15.     P_UV float len = length(pos);
  16.  
  17.     if (len > .9) return vec4(0.); // “outside”, use clear color
  18. if (len < .8) return vec4(0., 0., 1., 0.); // inner body, blue
  19.  
  20. P_UV float PI_OVER_TWO = 2. * atan(1.); // arctangent of 1 = pi / 4
  21. P_UV float angle = atan(pos.y, pos.x); // returns value in [-pi / 2, pi / 2]
  22.  
  23. if (angle < -PI_OVER_TWO) return vec4(1., 0., 0., 1.); // red
  24. else if (angle < 0.) return vec4(1., 1., 0., 1.); // yellow
  25. else if (angle < PI_OVER_TWO) return vec4(.5, 0., .5, 1.); // purple;
  26. else return vec4(0., 1., 0., 1.); // green
  27. }
  28.  
  29.  
  30. ]]
  31. return kernel

 

 

  1. –place in menu file where shader is implemented 
  2. –create circle to be made into wheel
  3. local wheel = display.newCircle(150, 100, 100)
  4. wheel.x = display.contentCenterX; wheel.y = display.contentCenterY
  5. wheel:scale(1.7, 1.7)
  6. group:insert(wheel)
  7. print(“creating circle”)
  8.  
  9.  
  10. –initialize kernel to create wheel effect
  11. local kernel = require “kernel_generator_custom_wheel”
  12. graphics.defineEffect( kernel )
  13.  
  14. –create wheel using effect on circle
  15. wheel.fill.effect = “generator.custom.wheel”
  16. print(“create wheel effect”)

Is there more to the console log?

Rob

I attach a file with the full log.

This seems to be the relevant error:

Service exited due to signal: Segmentation fault: 11

A segmentation vault is where your code tries to access a portion of protected memory.  Generally this is caused by a bad pointer (in C language terms).  For instance let’s say you have a function called “doSomething” and it’s memory address is 0x483949384.  The variable doSomething contains that memory address and when you call doSometing() it goes to that memory address and starts executing code.   But if something comes along and sticks a value like 12 in there and Lua still thinks its a function, and it tries to jump t that location.  The Operating System’s kernel says that’s not allowed and dumps your program.

Generally I’ve seen this happen when you have something like a RunTime listener running in a scene and you change that scene and then remove the scene.  All of a sudden that function is no longer in memory but some event is still trying to go there.  I would look for any onComplete listeners that may be completing after removing something it’s trying to use.   It’s happening after this:

Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: Level: 4
Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: ---------------
Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: ----INITSET----
Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: ---------------
Apr 26 08:39:18 iPad-de-Sergi Lily Dragon[7981] <Warning>: ACTIVITY TOKEN: 85506afb4f9bd98a5bc805073cbc4dbd
Apr 26 08:39:24 iPad-de-Sergi Lily Dragon[7981] <Warning>: numero de cuerda: 1
Apr 26 08:39:24 iPad-de-Sergi Lily Dragon[7981] <Warning>: fruta cortada: manzana

If that will narrow you in. 

Rob

Hi, I’m still working on the problem with no success :frowning:

My game is a kind of Cut the Rope with 1, 2 or 3 cords with a fruit on it, the game asks for the correct fruit and the player must cut the correct cord to achieve the next level.

I tried what you tell me about if there where a RunTime and all of this but the problem is still there, I tried to install anothers versions of Corona, and looking for Google what I should do, I close all I can close before changing the scene but crashes randomly.

I send you again another log and a part of the code to see if someone can help me with it, I’ve been trying things for a week and I don’t know what can I do…

Thanks in advance!

I feel for you.  These are frustrating problems.  But we can’t debug your code for you.  You need to put in more print statements and try to narrow down where the crash is happening.

You can google how to symbolcate the crash dump, but you will have to download the dump from Xcode and use the .dSYM file we output when we build the app.  If you can zip up the crash dump (can’t use the log version) and the .dSYM file and if Engineering has time they might be able to see what’s happening.

Rob

Hi everyone!

First of all thanks to all that respond to me, I’m trying again to solve the problem with my game and I think i have a clue, I think the problem is when I paint the line to cut the rope, that’s the code:

function drawLine(e)&nbsp; print('drawLine: '..e.phase) if(e.phase == 'began') then initX = e.x initY = e.y elseif(e.phase == 'moved') then line = display.newLine(initX, initY, e.x, e.y) physics.addBody(line, 'static') line.isSensor = true line:addEventListener('collision', ropeCollision) line.strokeWidth = 0 lines:insert(line) elseif(e.phase == 'ended') then display.remove(lines) lines = nil lines = display.newGroup() end end

That function paint a line that when collisions with a rope, It calls to the ropeCollision function that controls if the rope has to be cut or not. But doing a print with the phase, I saw that it does a lot of calls to that event. Am I doing well? Or there is a better way to do this?

Hi Rob,

How can I get de .dSYM file? building the app? Because I’ve builded but I don’t see that file. I’m using the Corona sdk version 2625

And when I get it, where I have to send the 2 files?

Thanks in advance!!!

@info6842 Hey Id recommend @roaminggamer to help out(really cool guy) I’m pretty sure he’d be able to figure out what’s causing this problem :slight_smile:

Simply include a plugin in your build.settings.  You don’t have to use it, but it will trigger building a .dSYM file.

Then download the crash file from your device using Xcode into the same folder with the .app and .dSYM file and use these instructions to symbolcate the crash file:

http://blog.kevincupp.com/2011/05/12/symbolicating-ios-crash-logs.html

Then that might give us a clue where it’s crashing.

Rob

Hi there everyone!

 

I have encountered a problem with implementation of a custom shader that for some odd reason, causes my app to crash on an iPhone 5 and iPad mini  but not an iPhone 6 or iPhone 6 plus!   I am also getting a segmentation fault 11 error that causes my app to crash immediately after it is opened.  Any help is appreciated!  

 

Below is the code for my custom shader and my implementation of it:

 

  1. –kernel file to make shader
  2. local kernel = {}
  3.  
  4. kernel.language = “glsl”
  5. kernel.category = “generator”
  6. kernel.name = “wheel”
  7. kernel.isTimeDependent = true
  8.  
  9.  
  10. kernel.fragment =
  11. [[
  12. P_COLOR vec4 FragmentKernel( P_UV vec2 texCoord )
  13. {
  14. P_UV vec2 pos = 2. * (texCoord - .5); // Get relative position and normalize it to [-1, 1]
  15.     P_UV float len = length(pos);
  16.  
  17.     if (len > .9) return vec4(0.); // “outside”, use clear color
  18. if (len < .8) return vec4(0., 0., 1., 0.); // inner body, blue
  19.  
  20. P_UV float PI_OVER_TWO = 2. * atan(1.); // arctangent of 1 = pi / 4
  21. P_UV float angle = atan(pos.y, pos.x); // returns value in [-pi / 2, pi / 2]
  22.  
  23. if (angle < -PI_OVER_TWO) return vec4(1., 0., 0., 1.); // red
  24. else if (angle < 0.) return vec4(1., 1., 0., 1.); // yellow
  25. else if (angle < PI_OVER_TWO) return vec4(.5, 0., .5, 1.); // purple;
  26. else return vec4(0., 1., 0., 1.); // green
  27. }
  28.  
  29.  
  30. ]]
  31. return kernel

 

 

  1. –place in menu file where shader is implemented 
  2. –create circle to be made into wheel
  3. local wheel = display.newCircle(150, 100, 100)
  4. wheel.x = display.contentCenterX; wheel.y = display.contentCenterY
  5. wheel:scale(1.7, 1.7)
  6. group:insert(wheel)
  7. print(“creating circle”)
  8.  
  9.  
  10. –initialize kernel to create wheel effect
  11. local kernel = require “kernel_generator_custom_wheel”
  12. graphics.defineEffect( kernel )
  13.  
  14. –create wheel using effect on circle
  15. wheel.fill.effect = “generator.custom.wheel”
  16. print(“create wheel effect”)