Getting "pure virtual function called" error in HTML5 app (DEF-1997)

I have an extremely simple project with 2 sprites and a few sounds. It works fine in the editor on the mac. But crashes in the browser. How would you suggest debugging this?

1 Like

Does the error mention anything else? Does it tell the name of the function that is at fault?

1 Like

Which browser are you using? What if you create a project based on one of the templates and build that to HTML5?

1 Like

Oh yea… I noticed this also in my HTML5 build when I was testing websockets last night.

Using Chrome.

This is the callstack:

PublicExamples.js:44 Uncaught Pure virtual function called!
callMain @ PublicExamples.js:44_
preloadAndCallMain @ dmloader.js:565
(anonymous function) @ dmloader.js:530
(anonymous function) @ dmloader.js:480
done @ PublicExamples.js:1
done @ PublicExamples.js:1
storeLocalEntry @ PublicExamples.js:1
(anonymous function) @ PublicExamples.js:1
IDBFS.loadRemoteEntry.req.onsuccess @ PublicExamples.js:1

1 Like

Hi.

I’m using mozilla latest version and chrome on the latest macbook not something strange. I just wondered if somebody had seen this one. If I figure out what the problem is I will post the answer to help others. A new project works fine, thanks for the tip, I tried it! It’s just that I am at a game jam and if I could have got it working it would have been cool to put the game online.

I will start with a blank project and build everything up again.

It’s a problem with lua and/or emscripten I know that much.

Thanks!

1 Like

@Alexis_Farmer If you could post the callstack, that will be very useful to us!

1 Like

GET http://localhost:8080/build/default/__htmlLaunchDir/Reading%20Rainbow/try_game.png 404 (Not Found)
2dmloader.js:301 Running…
dmloader.js:301 Running…
3dmloader.js:301
dmloader.js:301 Exception thrown, see JavaScript console
Reading Rainbow.js:44 Uncaught Pure virtual function called!callMain @ Reading Rainbow.js:44_preloadAndCallMain @ dmloader.js:565(anonymous function) @ dmloader.js:530(anonymous function) @ dmloader.js:480done @ Reading Rainbow.js:1done @ Reading Rainbow.js:1storeLocalEntry @ Reading Rainbow.js:1(anonymous function) @ Reading Rainbow.js:1IDBFS.loadRemoteEntry.req.onsuccess @ Reading Rainbow.js:1

2 Likes

Thx! Unfortunately, I haven’t seen this myself before. I’ll file a bug after the weekend.

One thing you might do, is to try comment out parts of the code, to see if you can pinpoint the problem.

1 Like

Thanks. It’s no problem, game is working good on my mac. So I can demo it in a few hours. I am literally the only person using defold at this game jam, so anyway. It works!

2 Likes

Looking forward to seeing the result!

2 Likes

I’ve filed a bug as DEF-1997

You can download the game here http://www.castlegamejam.com/en/2016/teams/unfolded/ It’s super simple. Only two sprites. Use spacebar. It’s my first time using defold so…

1 Like