Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading 'length') #20731

@Flyingbeanss

Description

@Flyingbeanss

Hi! I want to deal with memory access out of bound in my program. After I add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") and set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") , the console print as follow:

Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at lengthBytesUTF8 (occt-webgl-sample.js?t=1700141293680:1746:26)
    at stringToNewUTF8 (occt-webgl-sample.js?t=1700141293680:5971:13)
    at occt-webgl-sample.js?t=1700141293680:10523:32
    at withBuiltinMalloc (occt-webgl-sample.js?t=1700141293680:5962:10)
    at _emscripten_pc_get_file (occt-webgl-sample.js?t=1700141293680:10519:37)
    at occt-webgl-sample.wasm.__sanitizer::EmscriptenSymbolizerTool::SymbolizePC(unsigned long, __sanitizer::SymbolizedStack*) (occt-webgl-sample.wasm:0x16a5673)
    at occt-webgl-sample.wasm.__sanitizer::Symbolizer::SymbolizePC(unsigned long) (occt-webgl-sample.wasm:0x16a5960)
    at occt-webgl-sample.wasm.__lsan::LeakSuppressionContext::GetSuppressionForAddr(unsigned long) (occt-webgl-sample.wasm:0x1696920)
    at occt-webgl-sample.wasm.__lsan::LeakSuppressionContext::Suppress(unsigned int, unsigned long, unsigned long) (occt-webgl-sample.wasm:0x1696a6b)
    at occt-webgl-sample.wasm.__lsan::LeakReport::ApplySuppressions() (occt-webgl-sample.wasm:0x1697c0f)

I just don't understand why.
Here is the original output.

occt-webgl-sample.js?t=1700142325331:14608 Uncaught RuntimeError: memory access out of bounds
    at occt-webgl-sample.wasm.math_FunctionSetRoot::math_FunctionSetRoot(math_FunctionSetWithDerivatives&, math_Vector const&, int) (occt-webgl-sample.wasm:0xa28b01)
    at invoke_iiiii (occt-webgl-sample.js?t=1700142325331:14605:36)
    at occt-webgl-sample.wasm.math_FunctionRoot::math_FunctionRoot(math_FunctionWithDerivative&, double, double, double, double, int) (occt-webgl-sample.wasm:0xa261a0)
    at occt-webgl-sample.wasm.Extrema_LocEPCOfLocateExtPC::Perform(gp_Pnt const&, double) (occt-webgl-sample.wasm:0x8a659a)
    at invoke_viid (occt-webgl-sample.js?t=1700142325331:14990:29)
    at occt-webgl-sample.wasm.Extrema_LocateExtPC::Perform(gp_Pnt const&, double) (occt-webgl-sample.wasm:0x8a56ff)
    at invoke_viid (occt-webgl-sample.js?t=1700142325331:14990:29)
    at occt-webgl-sample.wasm.Extrema_LocateExtPC::Extrema_LocateExtPC(gp_Pnt const&, Adaptor3d_Curve const&, double, double, double, double) (occt-webgl-sample.wasm:0x8a62af)
    at invoke_iiiidddd (occt-webgl-sample.js?t=1700142325331:16343:36)
    at occt-webgl-sample.wasm.ShapeAnalysis_Curve::ProjectAct(Adaptor3d_Curve const&, gp_Pnt const&, double, gp_Pnt&, double&) const (occt-webgl-sample.wasm:0x4957fd)

Thanks for help , sincerely!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions