Stumped on Corona Bug?

I am using build 2185

I have an overlay that has a simple picker wheel in it.

When the overlay is called i get a bug down in some internal Corona Code.  I tried removing the picker wheel and the overlay is just fine.

Below you will find the overlay i am using … i put it inside of a timer so i can be sure that it is adding the picker wheel that is causing the issue.  So the overlay loads just fine then 2 seconds later i get the error.

NOTE: All is fine until i go to the ios device or the simulator and that is when i see this error not on the corona simulator.

Seems that some internal code is not working out so well:

?:0: attempt to index field ‘colours’ (a nil value)

Any thoughts on what may be going on are most welcome.

Cheers,

marc

Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: Runtime error &nbsp;&nbsp;&nbsp;&nbsp;?:0: attempt to index field 'colours' (a nil value) &nbsp;&nbsp;&nbsp;&nbsp;stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:1116\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '?' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:392\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:122\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '\_listener' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:141\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:218\> Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: ErrorMessage: Error Message: &nbsp;&nbsp;&nbsp;&nbsp;?:0: attempt to index field 'colours' (a nil value)&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;StackTrace: &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:1116\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '?' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:392\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:122\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '\_listener' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:141\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:218\> Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: Error: ?:0: attempt to index field 'colours' (a nil value) Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: Trace:&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:1116\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '?' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:392\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:122\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '\_listener' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:141\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:218\> Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: Runtime error &nbsp;&nbsp;&nbsp;&nbsp;?:0: attempt to perform arithmetic on field 'y' (a nil value) &nbsp;&nbsp;&nbsp;&nbsp;stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '\_manageRowLifeCycle' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:512\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:218\> Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: ErrorMessage: Error Message: &nbsp;&nbsp;&nbsp;&nbsp;?:0: attempt to perform arithmetic on field 'y' (a nil value)&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;StackTrace: &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '\_manageRowLifeCycle' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:512\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:218\> Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: Error: ?:0: attempt to perform arithmetic on field 'y' (a nil value) Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: Trace:&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '\_manageRowLifeCycle' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:512\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:218\> Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: ERROR: Error during request, code: -1004, details: Could not connect to the server. Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: Runtime error &nbsp;&nbsp;&nbsp;&nbsp;?:0: attempt to perform arithmetic on field 'y' (a nil value) &nbsp;&nbsp;&nbsp;&nbsp;stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function '\_manageRowLifeCycle' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:512\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:218\> Feb 28 11:46:27 macbook2013.missingmarble.com ArcherZUpshot[59531] \<Warning\>: ErrorMessage: Error Message: &nbsp;&nbsp;&nbsp;&nbsp;?:0: attempt to perform arithmetic on field 'y' (a nil value)&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;StackTrace: &nbsp;

timer.performWithDelay(2000, function () &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.columnData = {} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.columnData[1] = {} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.columnData[1].labels = {"TEST"} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.columnData[1].align = "left" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.columnData[1].startIndex = 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- create pickerWheel widget &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.picker = widget.newPickerWheel{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; top=95, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fontSize=14, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font=BoldFontName, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; columns=self.columnData, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; group:insert(self.picker) &nbsp;&nbsp;&nbsp;&nbsp;end) &nbsp;

Do you have copies of the theme files in your folder with your main.lua or perhaps a custom theme?

Rob

Good call … would have spent years finding that

yea … they were left over from my work around when i was using a different image resolution scheme than @2x to make the widgets work as they do not follow the documentation and require the @2x scheme to work out of the box.  That led to other issues in the corona builds.  I gave up and renamed all my image files and removed the style sheet hack i had but forgot to remove these theme files.

You guys should really just document that image files should be named @2x, etc and be done with it.  My own stubbornness is at fault for my prolonged agony.

Your assistance is appreciated.

Cheers,

m

Do you have copies of the theme files in your folder with your main.lua or perhaps a custom theme?

Rob

Good call … would have spent years finding that

yea … they were left over from my work around when i was using a different image resolution scheme than @2x to make the widgets work as they do not follow the documentation and require the @2x scheme to work out of the box.  That led to other issues in the corona builds.  I gave up and renamed all my image files and removed the style sheet hack i had but forgot to remove these theme files.

You guys should really just document that image files should be named @2x, etc and be done with it.  My own stubbornness is at fault for my prolonged agony.

Your assistance is appreciated.

Cheers,

m

Rob Miracle - I’ve noticed that a lot of the time when an error appears, the stack traceback quite often has:

?: in function <?:218>

It’s not one of my own files, so it must be something happening behind the scenes. What happens on line 218? It might help me in future to work out where an error lies.

One example of ?: in function <?:218> I’m having these days, something to do with inserting into tableview but I cannot replicate consistently so I haven’t reported it:

[lua]2014-04-23 23:04:33.346 Corona Simulator[53972:507] Runtime error

?:0: attempt to perform arithmetic on field ‘contentHeight’ (a nil value)

stack traceback:

    ?: in function ‘repositionY’

    ?: in function <?:1116>

    (tail call): ?

    /Users/jonjonsson/Dropbox/projects/app/app/modules/newGameAssets/PublicTournaments.lua:231: in function ‘addTourney’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/newGameAssets/PublicTournaments.lua:342: in function ‘?’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/Com.lua:21: in function ‘run’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/Com.lua:647: in function ‘msgRecieved’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/Com.lua:81: in function ‘callback’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/noobhub.lua:100: in function </Users/jonjonsson/Dropbox/projects/app/app/modules/noobhub.lua:77>

    ?: in function <?:218>[/lua]

@AlanPlantPot, the stack trace should have more information which may lead to the line in your code that’s calling an internal function.   So if you see something like “string expected but got a nil” and you can back up to your code you can look at the call and make sure you’re not passing in a nil where the function is expecting a string.  Looks right?  Did you use a : when it should be  .? or visa versa?   The complete backtrace to a line of your code can help figure out what the real problem is.

@jonjonsson, in your case, you know the issue is in the widget library which is open source on our GitHub, so you could go look through the code and see if you can find a function called repositionY and see what parameters it’s expecting, and what value is nil and then figure out why your app is sending the nil in.

The Corona internal code is compiled without debug symbols to keep things small and compact, which is why you don’t get specifics.  But with a sleuthing you can usually work it out.  It all starts with the full stack trace which the popup error doesn’t have and you have to go to your log file to get.

Rob

Thanks Rob, I’ll give that a shot.

Rob Miracle - I’ve noticed that a lot of the time when an error appears, the stack traceback quite often has:

?: in function <?:218>

It’s not one of my own files, so it must be something happening behind the scenes. What happens on line 218? It might help me in future to work out where an error lies.

One example of ?: in function <?:218> I’m having these days, something to do with inserting into tableview but I cannot replicate consistently so I haven’t reported it:

[lua]2014-04-23 23:04:33.346 Corona Simulator[53972:507] Runtime error

?:0: attempt to perform arithmetic on field ‘contentHeight’ (a nil value)

stack traceback:

    ?: in function ‘repositionY’

    ?: in function <?:1116>

    (tail call): ?

    /Users/jonjonsson/Dropbox/projects/app/app/modules/newGameAssets/PublicTournaments.lua:231: in function ‘addTourney’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/newGameAssets/PublicTournaments.lua:342: in function ‘?’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/Com.lua:21: in function ‘run’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/Com.lua:647: in function ‘msgRecieved’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/Com.lua:81: in function ‘callback’

    /Users/jonjonsson/Dropbox/projects/app/app/modules/noobhub.lua:100: in function </Users/jonjonsson/Dropbox/projects/app/app/modules/noobhub.lua:77>

    ?: in function <?:218>[/lua]

@AlanPlantPot, the stack trace should have more information which may lead to the line in your code that’s calling an internal function.   So if you see something like “string expected but got a nil” and you can back up to your code you can look at the call and make sure you’re not passing in a nil where the function is expecting a string.  Looks right?  Did you use a : when it should be  .? or visa versa?   The complete backtrace to a line of your code can help figure out what the real problem is.

@jonjonsson, in your case, you know the issue is in the widget library which is open source on our GitHub, so you could go look through the code and see if you can find a function called repositionY and see what parameters it’s expecting, and what value is nil and then figure out why your app is sending the nil in.

The Corona internal code is compiled without debug symbols to keep things small and compact, which is why you don’t get specifics.  But with a sleuthing you can usually work it out.  It all starts with the full stack trace which the popup error doesn’t have and you have to go to your log file to get.

Rob

Thanks Rob, I’ll give that a shot.