Corona Simulator Window>View As causing crash?

Is anyone else having this happen?

Whenever I am using the Corona simulator and I go to switch the device using Window > View As, the simulator crashes with this output to the terminal:

/Applications/CoronaSDK/Corona Terminal: line 9:   998 Segmentation fault: 11  “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” “$@”

logout

 

[Process completed]

I have uninstalled and reinstalled Corona and re booted and I’m still getting this problem. I’m using the latest daily build - however when I used the latest public release it also happens.

Any ideas?

Cheers.

Can you please provide a bit more system/OS info?

Thanks,

Brent

Hi Brent;

Sure no problem:

Hardware Overview:

 

  Model Name: Mac mini

  Model Identifier: Macmini5,3

  Processor Name: Intel Core i7

  Processor Speed: 2 GHz

  Number of Processors: 1

  Total Number of Cores: 4

  L2 Cache (per Core): 256 KB

  L3 Cache: 6 MB

  Memory: 8 GB

 

System Software Overview:

 

  System Version: OS X 10.9.2 (13C1021)

  Kernel Version: Darwin 13.1.0

  Boot Volume: Server HD

  Boot Mode: Normal

Happens on both - Corona Builds 2014.2289 and 2014.2189 that I am using.

Cheers!

Strange, never heard of a crash like that before.

Can you send us a crash report?  You’ll find them in ~/Library/Logs/DiagnosticReports

Are switching to a particular device or doesn’t it matter?

Hi Perry;

No it doesn’t act differently for any particular device. No matter what I do if I use Window > View As get the same crash.

Here’s a copy of the report - I don;t know what I would be looking for. Hope there’s no personal info in there  :ph34r:

Cheers!

That is a very strange stacktrace!

Does this happen with a particular project?  Does it happen if you open SampleCode / GettingStarted / HelloWorld and then do a View As?

Hmm, well it appears it only happens on the current project I am working on… 

Does that mean there is a problem with my project files?  :unsure:

Would network.request() have anything to do with it? The project I am working on downloads some images from our server at the start. However, whether I wait for the images or skip them or not it still crashes when I try to switch the device on the simulator.

Oh boy now Im worried. 

How many images are you downloading?  Do they download simultaneously or sequentially?  How long do they take to download?

Do you see the same problem with Samples / Networking / AsyncImageDownload?

Downloading 4 images, sequentially asynchronously and they only take about 10 seconds to dl total. No i don’t get the same problem with the Samples / Networking / AsyncImageDownload Sample.

:huh: 

@Perry

I have narrowed it down to my database update function. I don;t know why but that is what is causing the problem if that helps. Now I just don’t know why it is causing the problem. LOL

If I comment it out - the problem goes away!?

Here is the updateDataB function - located in my globals.lua file required on every scene:


– Database variables and functions


function updateDataB(event)

–     --------------------------------

–     --Update DataBase

–     --------------------------------

–    

– local function networkListener( event )

–        if ( event.isError ) then

–                

–                --network.cancel( event.requestId )

–             print( “Network error! - Update DataBase Failed - cancelled request”)

–       

–        elseif ( event.phase == “ended” ) then

–        print ( "DataBase RESPONSE: " … event.response )

–                print( "DataBase Update complete, total bytes transferred: " , event.bytesTransferred )

–        end

– end

– local params = {}

– params.progress = true

–        

–         URL = “http://…com/stpost.php?DeviceID=”…DeviceID…"&SessID="…SessID – etc… Server address left out for obvious reason :wink:

– network.request( URL, “GET”, networkListener)

– 

–        --print(“Update DataB sent from Globals.lua”)

–        --------------------------------

–     --END Update DataBase

–     --------------------------------

     

end

Cheers!

I found it - It was this line in the error report that “clued” me into the possible problem.

20  com.apple.CoreFoundation       0x00007fff8aeb4661 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

I was trying to call the updateDataB function inside of a system event.

I don’t know if that makes any sense - but taking out the system event call to update the database seems to have fixed the problem. :slight_smile:

Anyway, just thought I would give you an update.

Cheers!

Glad you found it.  Sounds like one of those cases of don’t cross the streams!  

How exactly was the the updateDataB function getting called (which system event)?  The Simulator shouldn’t ever crash but there might be places it should be issuing an error message instead of heading down a bad path.

Yes “it would be bad!” lol

I was calling it with a runtime listener

 Runtime:addEventListener( “system”, onSystemEvent )

and it was supposed to fire as so:

function onSystemEvent( event ) 

    if event.type == “applicationStart” then

       

        startNotifications()

        

 

elseif (event.type == “applicationSuspend”) then

startNotifications()

–sendInfoToDB()

  

   elseif (event.type == “applicationExit”  ) then

    

Runtime:removeEventListener( “system”, onSystemEvent )

startNotifications()

–sendInfoToDB()

    end

end

Something like that.

LOL yes “don’t cross the streams!” That’s good advice.

Cheers!

Can you please provide a bit more system/OS info?

Thanks,

Brent

Hi Brent;

Sure no problem:

Hardware Overview:

 

  Model Name: Mac mini

  Model Identifier: Macmini5,3

  Processor Name: Intel Core i7

  Processor Speed: 2 GHz

  Number of Processors: 1

  Total Number of Cores: 4

  L2 Cache (per Core): 256 KB

  L3 Cache: 6 MB

  Memory: 8 GB

 

System Software Overview:

 

  System Version: OS X 10.9.2 (13C1021)

  Kernel Version: Darwin 13.1.0

  Boot Volume: Server HD

  Boot Mode: Normal

Happens on both - Corona Builds 2014.2289 and 2014.2189 that I am using.

Cheers!

Strange, never heard of a crash like that before.

Can you send us a crash report?  You’ll find them in ~/Library/Logs/DiagnosticReports

Are switching to a particular device or doesn’t it matter?

Hi Perry;

No it doesn’t act differently for any particular device. No matter what I do if I use Window > View As get the same crash.

Here’s a copy of the report - I don;t know what I would be looking for. Hope there’s no personal info in there  :ph34r:

Cheers!