View Issue Details

IDProjectCategoryView StatusLast Update
0002067NoesisGUIC++ SDKpublic2021-11-29 14:22
Reporterjsantos Assigned Tojsantos  
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Product Version3.0.11 
Target Version3.2.0 
Summary0002067: Divide by zero in SDFGenerator
DescriptionHowever, we then hit a divide by zero in SDFGenerator.cpp, line 348:
// Calculate bounding box
const SPoint _P1mP0 = s.pts[1] - s.pts[0];
SPoint t = _P1mP0 - s.pts[2] + s.pts[1];
t.x = _P1mP0.x / t.x;      <- Divide by zero
t.y = _P1mP0.y / t.y;

In this case, t.x was zero.

It’s not urgent – we’ve just disabled FP exceptions whenever we call into Noesis, so this is not blocking us. We’d just like to be able to remove this at some point in the future

I’ve added a check for zero in this case, and set it to a small value, and it prevents the crash.
TagsNo tags attached.
PlatformAny

Activities

jsantos

jsantos

2021-07-28 11:50

manager  

locals.txt (6,220 bytes)   
-    _P1mP0                      {x=1.29687500 y=-0.421875000 }    Noesis::Vector2
        x                        1.29687500    float
        y                        -0.421875000    float
    a                            6.951447854614e-310#DEN    const double
    b                            22.500000000000000    const double
    b12xProd                     -1.6646301808104909    const double
    b12yProd                     9.032218938908e-314#DEN    const double
    c                            6.365987372896e-314#DEN    const double
    cosTheta                     -1.6646304780391290    const double
    f                            3.013425599852e-312#DEN    const double
    fDef                         3.013234023294e-312#DEN    const double
    g                            6.951447854672e-310#DEN    const double
    gDef                         12.280461844601760    const double
    h                            0.0020751953125000009    const double
    lambda                       203423776.82861328    const double
    lambda_cosTheta              3.013234023176e-312#DEN    const double
    lambda_sinTheta              21.031250000000089    const double
-    m                           {x=3.643e-44#DEN y=25.5000000 }    Noesis::Vector2
        x                        3.643e-44#DEN    float
        y                        25.5000000    float
-    p0                          {x=21.140625000000000 y=20.656250000000000 }    DPoint
            x                    21.140625000000000    double
            y                    20.656250000000000    double
    p0x                          21.140625000000000    const double
    p0xSqd                       3.013425599852e-312#DEN    const double
    p0y                          20.656250000000000    const double
    p0ySqd                       3.013234023171e-312#DEN    const double
    p01xProd                     22.500000000000000    const double
    p01yProd                     2.121995792942e-314#DEN    const double
    p1x                          -5.9836730957031250    const double
    p1xSqd                       6.951447853965e-310#DEN    const double
    p1y                          3.013425599615e-312#DEN    const double
    p1ySqd                       201326592.01562497    const double
    p02xProd                     0.00000000000000000    const double
    p02yProd                     21.031250000000000    const double
-    p2                          {x=23.734375000000000 y=19.687500000000000 }    DPoint
        x                        23.734375000000000    double
        y                        19.687500000000000    double
    p2x                          23.734375000000000    const double
    p2xSqd                       3.013425599536e-312#DEN    const double
    p2y                          19.687500000000000    const double
    p2ySqd                       7.953263348316e-310#DEN    const double
-    s                           {type=Quad (1) pts=0x0000008e024fab94 {{x=21.1406250 y=20.6562500 }, {x=22.4375000 y=20.2343750 }, {...}} ...}    PathSegmentData &
        type                     Quad (1)    PathSegmentData::<unnamed-type-type>
-        pts                     0x0000008e024fab94 {{x=21.1406250 y=20.6562500 }, {x=22.4375000 y=20.2343750 }, {x=23.7343750 y=19.6875000 }}    Noesis::Vector2[3]
-            [0]                 {x=21.1406250 y=20.6562500 }    Noesis::Vector2
                x                21.1406250    float
                y                20.6562500    float
-            [1]                 {x=22.4375000 y=20.2343750 }    Noesis::Vector2
                x                22.4375000    float
                y                20.2343750    float
-            [2]                 {x=23.7343750 y=19.6875000 }    Noesis::Vector2
                x                23.7343750    float
                y                19.6875000    float
-        bbox                    {left=21.1406250 top=19.6875000 right=23.7343750 ...}    SRect
            left                 21.1406250    float
            top                  19.6875000    float
            right                23.7343750    float
            bottom               20.6562500    float
-        p0T                     {x=3.3197278911564609 y=11.020593271324529 }    DPoint
            x                    3.3197278911564609    double
            y                    11.020593271324529    double
-        p2T                     {x=2.0782312925170032 y=4.3190453051993245 }    DPoint
            x                    2.0782312925170032    double
            y                    4.3190453051993245    double
-        mtx                     {mat=0x0000008e024fabe0 {0.54051552593826557, 5.1348974964135223, -115.41633115831347, -5.1348974964135223, ...} }    DAffineMatrix
-            mat                 0x0000008e024fabe0 {0.54051552593826557, 5.1348974964135223, -115.41633115831347, -5.1348974964135223, ...}    double[6]
                [0]              0.54051552593826557    double
                [1]              5.1348974964135223    double
                [2]              -115.41633115831347    double
                [3]              -5.1348974964135223    double
                [4]              0.54051552593826557    double
                [5]              101.70896385765414    double
            scalingFactor        0.19367581409677992    double
            scalingFactorSqd     0.037510320966050455    double
            nearlyZeroScaled     1.9696301695774949e-05    double
            tangentTolScaledSqd  6.3560794192443326e-06    double
        sinTheta                 6.951447853924e-310#DEN    const double
        sqrtA                    4.880590320356e-313#DEN    const double
        sqrtB                    7.953263348323e-310#DEN    const double
-        t                       {x=0.000000000 y=0.125000000 }    Noesis::Vector2
            x                    0.000000000    float
            y                    0.125000000    float
        x0                       2.121995791953e-314#DEN    const double
        y0                       19.698566475863114    const double
locals.txt (6,220 bytes)   
Callstack.txt (14,226 bytes)   
>	ZwiftAppDBG.exe!Init(PathSegmentData & s) Line 348	C++
 	ZwiftAppDBG.exe!Noesis::SDFGenerator::AddQuadSegment(const Noesis::Vector2 * pts) Line 1163	C++
 	ZwiftAppDBG.exe!Noesis::GlyphCache::RenderSDF::__l54::<lambda>(const Noesis::FT_Vector_ * c, const Noesis::FT_Vector_ * p, void * user_) Line 355	C++
 	ZwiftAppDBG.exe!int <lambda>(const Noesis::FT_Vector_ *, const Noesis::FT_Vector_ *, void *)::<lambda_invoker_cdecl>(const Noesis::FT_Vector_ * c, const Noesis::FT_Vector_ * p, void * user_) Line 357	C++
 	ZwiftAppDBG.exe!Noesis::FT_Outline_Decompose(Noesis::FT_Outline_ * outline, const Noesis::FT_Outline_Funcs_ * func_interface, void * user) Line 188	C++
 	ZwiftAppDBG.exe!Noesis::GlyphCache::RenderSDF(Noesis::GlyphCache::Glyph * glyph, Noesis::FT_FaceRec_ * face, unsigned int index, unsigned int size, long stroke) Line 397	C++
 	ZwiftAppDBG.exe!Noesis::GlyphCache::GetGlyph(Noesis::VGLFontFace * face, unsigned int index, unsigned int size, long stroke, bool inLayer) Line 518	C++
 	ZwiftAppDBG.exe!Noesis::GlyphCache::CacheGlyph(Noesis::VGLFontFace * face, unsigned int index, unsigned int size, long stroke) Line 139	C++
 	ZwiftAppDBG.exe!Noesis::VGLContext::DrawRunForeground(Noesis::VGLTextLayout * layout, const Noesis::Transform2 & mtx, const Noesis::Transform2 & paintMtx, Noesis::Glyph * glyphs, const Noesis::GlyphRun & run, const Noesis::TextProperties & p, const Noesis::VGLPaint & paint, const Noesis::BatchGroup & k, float scale, Noesis::GeoBuilderType builder, unsigned short runIndex, unsigned char flags) Line 3079	C++
 	ZwiftAppDBG.exe!Noesis::VGLContext::DrawTextLayout(Noesis::VGLTextLayout * layout, const Noesis::Transform2 & mtx, float opacity, Noesis::ArrayRef<Noesis::VGLPaint const *> paints, Noesis::ArrayRef<Noesis::Transform2> fgMatrices, Noesis::ArrayRef<Noesis::Transform2> bgMatrices, Noesis::ArrayRef<Noesis::Transform2> stMatrices, unsigned int flags_) Line 1252	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::DrawTextLayout(Noesis::FormattedTextProxy * text, float opacity, unsigned int flags, const Noesis::Rect & bounds, const Noesis::Transform2 & transform) Line 545	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::DrawCommands(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, Noesis::DrawingCommandsProxy * drawCommands, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, unsigned int bitmapScalingMode) Line 283	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderDraw(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity) Line 799	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 756	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderChildren(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 815	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::RenderNodeRecursive(Noesis::RenderNode * node, const Noesis::Recti & surfaceRect, const Noesis::Transform2 & transform, const Noesis::Matrix4 & projection, bool isProjectionIdentity, float opacity, unsigned int depth) Line 758	C++
 	ZwiftAppDBG.exe!Noesis::RenderTreeHelper::Render(Noesis::RenderNode * node, float x, float y, float width, float height, bool flipY, const Noesis::Matrix4 & projection) Line 125	C++
 	ZwiftAppDBG.exe!Noesis::RenderTree::Render(float x, float y, float width, float height, bool flipY, const Noesis::Matrix4 & projection) Line 297	C++
 	ZwiftAppDBG.exe!Noesis::Renderer::Render(const Noesis::Matrix4 & projection, bool flipY) Line 225	C++
 	ZwiftAppDBG.exe!Noesis::Renderer::Render(bool flipY) Line 189	C++
 	ZwiftAppDBG.exe!NoesisLib::NoesisGUI::OnscreenRender() Line 80	C++
 	ZwiftAppDBG.exe!Render(float dTime) Line 9203	C++
 	ZwiftAppDBG.exe!doFrame() Line 10358	C++
 	ZwiftAppDBG.exe!CODEmain(int argc, const char * * argv) Line 18951	C++
 	ZwiftAppDBG.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 757	C++
Callstack.txt (14,226 bytes)   

Issue History

Date Modified Username Field Change
2021-07-28 11:50 jsantos New Issue
2021-07-28 11:50 jsantos File Added: locals.txt
2021-07-28 11:50 jsantos File Added: Callstack.txt
2021-07-28 11:50 jsantos Assigned To => jsantos
2021-07-28 11:50 jsantos Status new => assigned
2021-07-28 11:50 jsantos Target Version => 3.0.13
2021-09-15 20:58 jsantos Target Version => 3.1.2
2021-11-29 14:22 jsantos Target Version 3.1.2 => 3.2.0