Visual C++ Runtime crash...

I get an Assertion fail from the runtime library and it popup a lot of them when i start to drag my objekt in the Corona simulator the error says:
Program:…
File:…\external\Box2D_v2.1.2\B…\b2bstac…tor.cpp
Line:38

Expression: m_entryCount < b2_maxStackEntries

My ula looks like this(I’m just testin around a little ):
require “sprite”
local physics = require(“physics”)
–local ui = require(“ui”)
local gameUI = require(“gameUI”)
physics.start()
–physics.setDrawMode( “hybrid” )

local dragBody = gameUI.dragBody – for use in touch event listener below
display.setStatusBar( display.HiddenStatusBar )

local Bg = display.newImage( “road.png” )
Bg.x = display.contentWidth / 2
Bg.y = 195

local leftside = display.newImage( “side.png” )
leftside.x = display.contentWidth -32
leftside.y = 195
leftside.myName = “leftside”
physics.addBody( leftside, “static”, { friction=0.5, bounce=0.3 } )

local rightside = display.newImage( “side.png” )
rightside.x = 32
rightside.y = 195
rightside.myName = “rightside”
physics.addBody( rightside, “static”, { friction=0.5, bounce=0.3 } )

local sheet1 = sprite.newSpriteSheet( “bilenrakt.png”, 128, 64 )
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 3)
sprite.add( spriteSet1, “Car”, 1, 3, 100, 0 ) – play 8 frames every 1000 ms
local instance1 = sprite.newSprite( spriteSet1 )

physics.addBody( instance1,“kinematic”,{ friction=0.5, bounce=0.3 } )
instance1:addEventListener( “touch”, dragBody )
instance1.x = display.contentWidth / 2
instance1.y = 280
instance1:rotate(90)
instance1:prepare(“Car”)
instance1:play()

it was when i changed this line:" physics.addBody( instance1,“kinematic”,{ friction=0.5, bounce=0.3 } )
"
i changed the body type to Kinematic soo that it would not recognize the gravity…

any suggestions ?

I am sorry for my poor english :frowning:
[import]uid: 35736 topic_id: 6577 reply_id: 306577[/import]

It seems that the problem is in the GameUI.lua… When i test with ather objects and sets the bodyType to kinematic it crashes…
the code of gameUI.lua is :
– gameUI library
module(…, package.seeall)

– A general function for dragging physics bodies

– Simple example:
– local dragBody = gameUI.dragBody
– object:addEventListener( “touch”, dragBody )

function dragBody( event, params )
local body = event.target
local phase = event.phase
local stage = display.getCurrentStage()

if “began” == phase then
stage:setFocus( body, event.id )
body.isFocus = true

– Create a temporary touch joint and store it in the object for later reference
if params and params.center then
– drag the body from its center point
body.tempJoint = physics.newJoint( “touch”, body, body.x, body.y )
else
– drag the body from the point where it was touched
body.tempJoint = physics.newJoint( “touch”, body, event.x, event.y )
end

– Apply optional joint parameters
if params then
local maxForce, frequency, dampingRatio

if params.maxForce then
– Internal default is (1000 * mass), so set this fairly high if setting manually
body.tempJoint.maxForce = params.maxForce
end

if params.frequency then
– This is the response speed of the elastic joint: higher numbers = less lag/bounce
body.tempJoint.frequency = params.frequency
end

if params.dampingRatio then
– Possible values: 0 (no damping) to 1.0 (critical damping)
body.tempJoint.dampingRatio = params.dampingRatio
end
end

elseif body.isFocus then
if “moved” == phase then

– Update the joint to track the touch
body.tempJoint:setTarget( event.x, event.y )

elseif “ended” == phase or “cancelled” == phase then
stage:setFocus( body, nil )
body.isFocus = false

– Remove the joint when the touch ends
body.tempJoint:removeSelf()

end
end

– Stop further propagation of touch event
return true
end
– A function for cross-platform event sounds

function newEventSoundXP( params )
local isAndroid = “Android” == system.getInfo(“platformName”)

if isAndroid and params.android then
soundID = media.newEventSound( params.android ) – return sound file for Android
elseif params.ios then
soundID = media.newEventSound( params.ios ) – return sound file for iOS/MacOS
end

return soundID
end
– A function for cross-platform fonts

function newFontXP( params )
local isAndroid = “Android” == system.getInfo(“platformName”)

if isAndroid and params.android then
font = params.android – return font for Android
elseif params.ios then
font = params.ios – return font for iOS/MacOS
else
font = native.systemFont – default font (Helvetica on iOS, Android Sans on Android)
end

return font
end
[import]uid: 35736 topic_id: 6577 reply_id: 22820[/import]

Did you ever solve your problem? I’m having the same error pop up. [import]uid: 49205 topic_id: 6577 reply_id: 35404[/import]

Also getting the same issue here when using Windows version. In my code this causes an infinite loop, which eventually crashes the simulator.

However, the same code on the OS X simulator works fine - is this a problem only with the Windows version of the simulator?

[import]uid: 62042 topic_id: 6577 reply_id: 38939[/import]

Hey guys,

Will bring this up in our next meeting.

Peach :slight_smile: [import]uid: 52491 topic_id: 6577 reply_id: 39150[/import]

hey. i ran 2011.591 for a couple months with no crashes. Then i did a fresh install of xp because my os had became very bloated now corona 2011.591 is crashing all the time with this error Visual C++ Runtime crash. what is going on this is driving me bananas, i think it should run better on a clean install not worst. [import]uid: 89663 topic_id: 6577 reply_id: 71361[/import]

I’d suggest making a post in the Android or Windows forum.

I don’t work with that side of things but after a reformat have you updated everything that needs updating? (Because this doesn’t seem to be a common issue that would be my first thought, back from when I was a Windows user.)

Peach :slight_smile: [import]uid: 52491 topic_id: 6577 reply_id: 71366[/import]

it appears it has something to do the audio .caf files. i know windows doesn’t support them. before the simulator on xp would just stutter a little bit when trying to play a .caf file but since the new os was installed the simulator seams to crash when trying to play one.

it is a visual c++ runtime crash i had visual studio 2010 installed on the old xp i wonder if it was preventing the simulator from crashing.

i do most of the builds on osx-laptop, but i really prefer Lua-edit for programing for corona. I also really like this tool for efficiency “synergy” it allows you to use the same keyboard and mouse between your xp and osx. And then i use autohotkey to constraint a universal hotkey to send messages to the corona simulator to reload it(just like osx simulator reloads when you save a lua file).

snippet for autohotkey for “cntrl e”

  
^e::  
IfWinExist FartBugs - Corona Simulator  
{  
 WinActivate  
 Send, {CTRLDOWN}r{CTRLUP}  
}  
else  
{  
  
}  
  

[import]uid: 89663 topic_id: 6577 reply_id: 71389[/import]