Easy to crash when using " Create dummies on mesh surface"

Report crashes, strange behaviour, or apparent bugs
Post Reply
zorro
Posts: 56
Joined: 06 Nov 2023, 09:31

Easy to crash when using " Create dummies on mesh surface"

Post by zorro »

CoppeliaSim 4.7.0 rev.4:
[Geometry / Mesh >> Create dummies on mesh surface@addOnScript:info] This tool allows to create dummies from points sampled on mesh surfaces
[Misc >> Point sampler service@addOnScript:error] plugin simIGL: Cannot load library C:\Program Files\CoppeliaRobotics\CoppeliaSimEdu\simIGL.dll: 找不到指定的模块。
[Misc >> Point sampler service@addOnScript:error] ...ram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/simIGL.lua:7: attempt to index a nil value (local 'simIGL')
stack traceback:
...ram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/simIGL.lua:7: in main chunk
[C]: in upvalue 'origRequire'
...ram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/buffer.lua:180: in field 'require'
...ogram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/base.lua:98: in function <...ogram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/base.lua:84>
(...tail calls...)
[string "Misc >> Point sampler service@addOnScript"]:252: in function 'enable'
[string "Misc >> Point sampler service@addOnScript"]:188: in function 'sysCall_msg'


CMD:
[Misc >> Point sampler service@addOnScript:error] plugin simIGL: Cannot load library C:\Program Files\CoppeliaRobotics\CoppeliaSimEdu\simIGL.dll: 鎵句笉鍒版寚瀹氱殑妯″潡銆?
CoppeliaSim: debug: 40: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 39: UnhandledExceptionFilter - 0x7FFA04BDB030
CoppeliaSim: debug: 38: RtlCopyMemory - 0x7FFA073D6C40
CoppeliaSim: debug: 37: _C_specific_handler - 0x7FFA073BF5F0
CoppeliaSim: debug: 36: _chkstk - 0x7FFA073D5050
CoppeliaSim: debug: 35: RtlFindCharInUnicodeString - 0x7FFA0734DDC0
CoppeliaSim: debug: 34: KiUserExceptionDispatcher - 0x7FFA073D4140
CoppeliaSim: debug: 33: KiUserExceptionDispatcher - 0x7FFA073D4140
CoppeliaSim: debug: 32: KiUserExceptionDispatcher - 0x7FFA073D4140
CoppeliaSim: debug: 31: KiUserExceptionDispatcher - 0x7FFA073D4140
CoppeliaSim: debug: 30: KiUserExceptionDispatcher - 0x7FFA073D4140
CoppeliaSim: debug: 29: KiUserExceptionDispatcher - 0x7FFA073D4140
CoppeliaSim: debug: 28: DrvValidateVersion - 0x7FF9676F82D0
CoppeliaSim: debug: 27: DumpRegistryKeyDefinitions - 0x7FF9677B7E60
CoppeliaSim: debug: 26: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 25: simGetJointCallbackCallOrder - 0x7FF97229B7B0
CoppeliaSim: debug: 24: simSetDynamicJointLocalTransformationPart2IsValid - 0x7FF9721D3420
CoppeliaSim: debug: 23: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 22: simAddBanner - 0x7FF972339720
CoppeliaSim: debug: 21: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 20: simAddBanner - 0x7FF972339720
CoppeliaSim: debug: 19: simAddBanner - 0x7FF972339720
CoppeliaSim: debug: 18: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 17: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 16: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 15: QObject::event - 0x7FF979AEBE70
CoppeliaSim: debug: 14: QApplicationPrivate::notify_helper - 0x7FF978F556E0
CoppeliaSim: debug: 13: QApplication::notify - 0x7FF978F52EA0
CoppeliaSim: debug: 12: QCoreApplication::notifyInternal2 - 0x7FF979AC4770
CoppeliaSim: debug: 11: QCoreApplicationPrivate::sendPostedEvents - 0x7FF979AC63C0
CoppeliaSim: debug: 10: qt_plugin_query_metadata - 0x7FF977DE57B0
CoppeliaSim: debug: 9: QEventDispatcherWin32::processEvents - 0x7FF979B0EDB0
CoppeliaSim: debug: 8: qt_plugin_query_metadata - 0x7FF977DE57B0
CoppeliaSim: debug: 7: QEventLoop::exec - 0x7FF979AC07C0
CoppeliaSim: debug: 6: QCoreApplication::exec - 0x7FF979AC36A0
CoppeliaSim: debug: 5: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 4: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 3: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 2: simWriteTexture_D - 0x7FF972376D60
CoppeliaSim: debug: 1: BaseThreadInitThunk - 0x7FFA061E2560
CoppeliaSim: debug: 0: RtlUserThreadStart - 0x7FFA0738AEE0

coppelia
Site Admin
Posts: 10647
Joined: 14 Dec 2012, 00:25

Re: Easy to crash when using " Create dummies on mesh surface"

Post by coppelia »

Hello,

it seems that the IGL plugin fails to load. Can you confirm again if you type following?

Code: Select all

simIGL = require('simIGL')
Does above instruction alone crash CoppeliaSim?

We will release CoppeliaSim V4.8 in the next few minutes, please try also with that version.

Cheers

zorro
Posts: 56
Joined: 06 Nov 2023, 09:31

Re: Easy to crash when using " Create dummies on mesh surface"

Post by zorro »

OK, I have installed the latest CoppeliaSim 4.8 rev.0. Now, when I click "Create dummies on mesh surface," the component appears to be loaded correctly, the corresponding UI interface displays normally, the points representing dummy previews in the scene also display correctly, and the bottom control bar displays as follows:

Code: Select all

[Geometry / Mesh >> Create dummies on mesh surface@addOnScript:info] This tool allows to create dummies from points sampled on mesh surfaces.
However, when I click on a mesh in the scene, the software crashes immediately. The CMD displays the following:

Code: Select all

[Misc >> Point sampler service@addOnScript:loadinfo]   plugin simIGL: loading...
[Misc >> Point sampler service@addOnScript:loadinfo]   plugin simIGL: done.
[CoppeliaSim:loadinfo]   plugin simGeom: loading...
[CoppeliaSim:loadinfo]   plugin simGeom: done.
CoppeliaSim: debug: 42: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 41: ImeExtension - 0x7FFCB5F6E870
CoppeliaSim: debug: 40: GetHandleVerifier - 0x7FFCD1A9FD90
CoppeliaSim: debug: 39: UnhandledExceptionFilter - 0x7FFD951FB030
CoppeliaSim: debug: 38: RtlCopyMemory - 0x7FFD97AD6C40
CoppeliaSim: debug: 37: _C_specific_handler - 0x7FFD97ABF5F0
CoppeliaSim: debug: 36: _chkstk - 0x7FFD97AD5050
CoppeliaSim: debug: 35: RtlFindCharInUnicodeString - 0x7FFD97A4DDC0
CoppeliaSim: debug: 34: KiUserExceptionDispatcher - 0x7FFD97AD4140
CoppeliaSim: debug: 33: KiUserExceptionDispatcher - 0x7FFD97AD4140
CoppeliaSim: debug: 32: KiUserExceptionDispatcher - 0x7FFD97AD4140
CoppeliaSim: debug: 31: KiUserExceptionDispatcher - 0x7FFD97AD4140
CoppeliaSim: debug: 30: KiUserExceptionDispatcher - 0x7FFD97AD4140
CoppeliaSim: debug: 29: KiUserExceptionDispatcher - 0x7FFD97AD4140
CoppeliaSim: debug: 28: DrvValidateVersion - 0x7FFCD27882D0
CoppeliaSim: debug: 27: DumpRegistryKeyDefinitions - 0x7FFCD2847E60
CoppeliaSim: debug: 26: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 25: simGetJointCallbackCallOrder - 0x7FFCD50633D0
CoppeliaSim: debug: 24: simAddBanner - 0x7FFCD4FCF6E0
CoppeliaSim: debug: 23: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 22: simGetJointCallbackCallOrder - 0x7FFCD50633D0
CoppeliaSim: debug: 21: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 20: simGetJointCallbackCallOrder - 0x7FFCD50633D0
CoppeliaSim: debug: 19: simGetJointCallbackCallOrder - 0x7FFCD50633D0
CoppeliaSim: debug: 18: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 17: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 16: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 15: QObject::event - 0x7FFCD630BE70
CoppeliaSim: debug: 14: QApplicationPrivate::notify_helper - 0x7FFCD42956E0
CoppeliaSim: debug: 13: QApplication::notify - 0x7FFCD4292EA0
CoppeliaSim: debug: 12: QCoreApplication::notifyInternal2 - 0x7FFCD62E4770
CoppeliaSim: debug: 11: QCoreApplicationPrivate::sendPostedEvents - 0x7FFCD62E63C0
CoppeliaSim: debug: 10: qt_plugin_query_metadata - 0x7FFCD93057B0
CoppeliaSim: debug: 9: QEventDispatcherWin32::processEvents - 0x7FFCD632EDB0
CoppeliaSim: debug: 8: qt_plugin_query_metadata - 0x7FFCD93057B0
CoppeliaSim: debug: 7: QEventLoop::exec - 0x7FFCD62E07C0
CoppeliaSim: debug: 6: QCoreApplication::exec - 0x7FFCD62E36A0
CoppeliaSim: debug: 5: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 4: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 3: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 2: simWriteTexture_D - 0x7FFCD515F5B0
CoppeliaSim: debug: 1: BaseThreadInitThunk - 0x7FFD976D2560
CoppeliaSim: debug: 0: RtlUserThreadStart - 0x7FFD97A8AEE0
Additional note: In previous versions, although this plugin would occasionally cause the application to crash, it never resulted in a 100% crash rate as it does now. The day before yesterday, following a certain response, I modified the Lua script to enable local toppra invocation. However, after installing version 4.8 today, the modified Lua script should have been overridden.

coppelia
Site Admin
Posts: 10647
Joined: 14 Dec 2012, 00:25

Re: Easy to crash when using " Create dummies on mesh surface"

Post by coppelia »

Thank you for the info. Can you help me identify when the crash happens exactly (the Windows stack trace is not usable)? There are 2 components that play together: addOns/Point sampler service.lua and addOns/Create dummies on mesh surface.lua.

Please try to add some printToConsole commands here and there and identify the exact moment the crash is triggered.

Cheers

zorro
Posts: 56
Joined: 06 Nov 2023, 09:31

Re: Easy to crash when using " Create dummies on mesh surface"

Post by zorro »

Sure, so I added some printToConsole commands to Create dummies on mesh surface.lua and Point sampler service.lua.

For Create dummies on mesh surface.lua, the code modifications are roughly as follows:

Code: Select all

function sysCall_msg(event)
    printToConsole("cD:sysCall_msg: Received event with id: ", event.id)
    if not event.data or not event.data.key or event.data.key ~= 'createDummiesOnMeshSurf' then
        printToConsole("cD:sysCall_msg: Event data is not valid or key does not match")
        return
    end
    if event.id == 'pointSampler.click' then
        printToConsole("cD:sysCall_msg: pointSampler.click event received")
        if event.data.pointNormalMatrix then
            printToConsole("cD:sysCall_msg: pointNormalMatrix data received")
            createDummy(event.data.pointNormalMatrix)
            sim.announceSceneContentChange()
            printToConsole("cD:sysCall_msg: Dummy created")
        else
            printToConsole("cD:sysCall_msg: No pointNormalMatrix data in event")
        end
    else
        printToConsole("cD:sysCall_msg: Event id does not match pointSampler.click")
    end
end
....
function createDummy(m)
    local h = sim.createDummy(dummySize)
    sim.setObjectColor(h, 0, sim.colorcomponent_ambient_diffuse, dummyColor)
    printToConsole("cD:Set object color")
    sim.setObjectMatrix(h, m, sim.handle_world)
    printToConsole("cD:Set object matrix")
    sim.setObjectPose(h, {0, 0, zOffset, 0, 0, 0, 1}, h)
    printToConsole("cD:Set object pose")
    sim.setObjectAlias(h, alias)
    printToConsole("cD:Set object alias")
end
...



For Point sampler service.lua, the code modifications are roughly as follows:

Code: Select all

function sysCall_nonSimulation()
....
if pt then
            if currentFlags().handle then event.handle = o end
            if currentFlags().surfacePoint then
                event.point = pt
                if currentFlags().surfaceNormal then
                    event.normal = n
                    event.pointNormalMatrix = simIGL.pointNormalToMatrix(pt, n)
                    printToConsole("PS:sysCall_nonSimulation: pointNormalMatrix data created")
                end
            end
....
function sysCall_msg(event)
    printToConsole("PS:sysCall_msg: Received event with id: " .. event.id)
    if event.id == 'pointSampler.enable' then
        if not event.data.key then
            sim.addLog(sim.verbosity_errors, 'missing required field data.key')
            printToConsole("PS:sysCall_msg: missing required field data.key")
            return
        end
        if flags[event.data.key] then
            sim.addLog(sim.verbosity_warnings, 'already enabled')
            printToConsole("PS:sysCall_msg: already enabled")
            return
        end
        flags[event.data.key] = event.data
        table.insert(flagsStack, 1, event.data.key)
        enable()
        printToConsole("PS:sysCall_msg: pointSampler enabled with key: " .. event.data.key)
    elseif event.id == 'pointSampler.disable' then
        if not event.data.key then
            sim.addLog(sim.verbosity_errors, 'missing required field data.key')
            printToConsole("PS:sysCall_msg: missing required field data.key")
            return
        end
        flags[event.data.key] = nil
        table.remove(flagsStack, 1)
        disable()
        printToConsole("PS:sysCall_msg: pointSampler disabled with key: " .. event.data.key)
    elseif event.id == 'pointSampler.setFlags' then
        if not event.data.key then
            sim.addLog(sim.verbosity_errors, 'missing required field data.key')
            printToConsole("PS:sysCall_msg: missing required field data.key")
            return
        end
        if not flags[event.data.key] then
            sim.addLog(sim.verbosity_warnings, 'invalid key')
            printToConsole("PS:sysCall_msg: invalid key")
            return
        end
        for k, v in pairs(event.data) do flags[event.data.key][k] = v end
        printToConsole("PS:sysCall_msg: flags set for key: " .. event.data.key)
    end
end
...

The console output is as follows:

Code: Select all

[Geometry / Mesh >> Create dummies on mesh surface@addOnScript:loadinfo]   plugin simUI: loading...
[Geometry / Mesh >> Create dummies on mesh surface@addOnScript:loadinfo]   plugin simUI: done.
cD:Entering showDlg function
cD:Creating UI with XML: <ui title="Create dummies on mesh surface" layout="form" activate="false" closeable="true" resizable="true" on-close="close_callback" position="-50,150" placement="relative">
            <label id="9" text="" />
            <checkbox id="10" text="Constrain to vertices" on-change="changedConstrain" />
            <label id="11" text="Size:" />
            <spinbox id="12" value="0.02" step="0.001" decimals="3" suffix="m" on-change="changedDummySize" />
            <label id="13" text="Color:" />
            <edit id="14" value="0, 1, 0" on-editing-finished="changedColor" />
            <label id="5" text="Alias:" />
            <edit id="6" value="Dummy" on-editing-finished="changedAlias" />
            <label id="7" text="Offset:" />
            <spinbox id="8" value="0" step="0.001" suffix="m" on-change="changedZOffset" />
        </ui>
cD:UI created
PS:sysCall_msg: Received event with id: pointSampler.enable
[Misc >> Point sampler service@addOnScript:loadinfo]   plugin simIGL: loading...
[Misc >> Point sampler service@addOnScript:loadinfo]   plugin simIGL: done.
PS:sysCall_msg: pointSampler enabled with key: createDummiesOnMeshSurf
PS:sysCall_msg: Received event with id: systemCall
[CoppeliaSim:loadinfo]   plugin simGeom: loading...
[CoppeliaSim:loadinfo]   plugin simGeom: done.
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
PS:sysCall_nonSimulation: pointNormalMatrix data created
cD:sysCall_msg: Received event with id:         pointSampler.click
cD:sysCall_msg: pointSampler.click event received
cD:sysCall_msg: pointNormalMatrix data received
cD:Set object color
cD:Set object matrix
cD:Set object pose
cD:Set object alias
cD:sysCall_msg: Dummy created
CoppeliaSim: debug: 42: simWriteTexture_D - 0x7FFCCF73F5B0
CoppeliaSim: debug: 41: ImeExtension - 0x7FFCB5F6E870
CoppeliaSim: debug: 40: GetHandleVerifier - 0x7FFCD1A9FD90
CoppeliaSim: debug: 39: UnhandledExceptionFilter - 0x7FFD951FB030
....
I'm not too sure where to printToConsole.

zorro
Posts: 56
Joined: 06 Nov 2023, 09:31

Re: Easy to crash when using " Create dummies on mesh surface"

Post by zorro »

So I just tested on another computer with CoppeliaSim 4.7 rev.4. Still doesn't work:

Code: Select all

[Geometry / Mesh >> Create dummies on mesh surface@addOnScript:info] This tool allows to create dummies from points sampled on mesh surfaces
[Misc >> Point sampler service@addOnScript:error] plugin simIGL: Cannot load library C:\Program Files\CoppeliaRobotics\CoppeliaSimEdu\simIGL.dll: 找不到指定的模块。
[Misc >> Point sampler service@addOnScript:error] ...ram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/simIGL.lua:7: attempt to index a nil value (local 'simIGL')
stack traceback:
    ...ram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/simIGL.lua:7: in main chunk
    [C]: in upvalue 'origRequire'
    ...ram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/buffer.lua:180: in field 'require'
    ...ogram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/base.lua:98: in function <...ogram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/base.lua:84>
    (...tail calls...)
    [string "Misc >> Point sampler service@addOnScript"]:252: in function 'enable'
    [string "Misc >> Point sampler service@addOnScript"]:188: in function 'sysCall_msg'
> simIGL = require('simIGL')
[sandboxScript:error] plugin simIGL: Cannot load library C:\Program Files\CoppeliaRobotics\CoppeliaSimEdu\simIGL.dll: 找不到指定的模块。
...ram Files/CoppeliaRobotics/CoppeliaSimEdu/lua/simIGL.lua:7: attempt to index a nil value (local 'simIGL')
Are you able to reproduce this bug?

coppelia
Site Admin
Posts: 10647
Joined: 14 Dec 2012, 00:25

Re: Easy to crash when using " Create dummies on mesh surface"

Post by coppelia »

Indeed, we are able to reproduce this on some Windows machines... strangely it appears to be related to rendering.

A temporary workaround would be to click (in order to generate a dummy) and shift the mouse a few pixels before releasing the mouse button.

Cheers

zorro
Posts: 56
Joined: 06 Nov 2023, 09:31

Re: Easy to crash when using " Create dummies on mesh surface"

Post by zorro »

Thanks! That really worked, hope you guys fix this bug soon~

zorro
Posts: 56
Joined: 06 Nov 2023, 09:31

Re: Easy to crash when using " Create dummies on mesh surface"

Post by zorro »

Hi!
This bug still exists in V4.9.0

Post Reply