Crash while using TextFont.RMSolid render mode.

Bug #383251 reported by manu3d
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
Confirmed
High
Unassigned

Bug Description

OS: Vista (32)
Panda: 1.6.1, official release

Example code below. Comment/uncomment the font-loading lines as desired to reproduce working and not-working behaviours.
Mystral.TTF generates some debugging output. papyrus.ttf only a silent crash, that's why they've been included both.
-----
import direct.directbase.DirectStart
from pandac.PandaModules import TextNode, TextFont

font = loader.loadFont('/c/Windows/Fonts/arial.ttf') ## This works!
#font = loader.loadFont('/c/Windows/Fonts/Mistral.TTF') ## This doesn't!
#font = loader.loadFont('/c/Windows/Fonts/papyrus.ttf') ## Also doesn't!

font.setPixelsPerUnit(64)
font.setRenderMode(TextFont.RMSolid)

textNode = TextNode("aTextNode")
textNode.setFont(font)
textNode.setText("Meeeeeooow!!!")

textNodePath = aspect2d.attachNewNode(textNode)
textNodePath.setPos(-0.9, 0, 0.5)
textNodePath.setScale(0.2)

run()

Tags: crash font text
Revision history for this message
rdb (rdb) wrote :

Confirmed this on my linux box. Papyrus seems to take a lot of memory first followed by a crash.
Here is what it prints:
pvector.dec(array, 1610612744) -> -939463944
python: typeHandle.cxx:81: void TypeHandle::dec_memory_usage(TypeHandle::MemoryClass, int): Assertion `rnode->_memory_usage[memory_class] >= 0' failed.
Aborted

I'm attaching a traceback.

Changed in panda3d:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
rdb (rdb) wrote :
Revision history for this message
Treeform (starplant) wrote :

I think this function is rather heavy due to fonts being rather detailed. I propose some check on the font's file size and if its too big throw a warning like "font is to complex."

Revision history for this message
David Rose (droklaunchpad) wrote :

It's not a question of the size of the font. The font code takes advantage of our Triangulator class to create geometry in the RMSolid and RMPolygon modes. I got the implementation of this class from a free algorithm I found on the net, but it seems to have some bugs dealing with edge conditions in certain complex polygons, as found in certain fonts.

The right solution will be to fix the bugs in Triangulator, or replace it with an algorithm that doesn't suffer from these bugs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.