ikaros-project / ikaros

An open infrastructure for system level brain modeling
GNU Affero General Public License v3.0
23 stars 23 forks source link

Webui: Adding an image crashes ikaros #110

Closed trondarild closed 5 years ago

trondarild commented 5 years ago

Partial stack:

GroupElement::GetSource(GroupElement const this, const std::__cxx11::string & name) (/home/trondarild/ikaros/ikaros/Source/Kernel/IKAROS.cc:511) Kernel::SendUIData(Kernel const this, char root, char args) (/home/trondarild/ikaros/ikaros/Source/Kernel/IKAROS.cc:3875) Kernel::HandleControlChange(Kernel const this, char uri, char args) (/home/trondarild/ikaros/ikaros/Source/Kernel/IKAROS.cc:4002) Kernel::HandleHTTPRequest(Kernel const this) (/home/trondarild/ikaros/ikaros/Source/Kernel/IKAROS.cc:4021) Kernel::HandleHTTPThread(Kernel const this) (/home/trondarild/ikaros/ikaros/Source/Kernel/IKAROS.cc:4172) Kernel::StartHTTPThread(Kernel k) (/home/trondarild/ikaros/ikaros/Source/Kernel/IKAROS.cc:4183)

ikaros-project commented 5 years ago

An example ikg would be useful.

trondarild commented 5 years ago

The following produces the bug on my computer, when I do "add image" in edit mode:


<?xml version="1.0"?>
<group title="Groupname" >
<!-- modules -->
            <module
                class = "Constant"
                name = "Weight_stn"
                outputsize  = "1"
                data  = "-.25 -.25 -.25"
            />
            <module
                class = "Expression"
                name = "Modifier_stn"
                expression  = "if(y >= x){0} else {x-y}"
                inputs  = "x,y"
                debug="false"
            />

            <module
            class = "Nucleus"
            name = "Subthalamic_nucleus_1"
            epsilon = "0.05"
        />
        <_module
            class = "Nucleus"
            name = "Subthalamic_nucleus_2"
            epsilon = "0.05"
        />
        <_module
            class = "Nucleus"
            name = "Subthalamic_nucleus_3"
            epsilon = "0.05"
        />
<!-- connections -->
    <connection source = "Weight_stn.OUTPUT"  target = "Modifier_stn.y" />
    <connection source = "Subthalamic_nucleus_1.OUTPUT"  target = "Modifier_stn.x" />
    <_connection source = "Subthalamic_nucleus_2.OUTPUT"  target = "Modifier_stn.x" />
    <_connection source = "Subthalamic_nucleus_3.OUTPUT"  target = "Modifier_stn.x" />
<view name="view">
</view>
</group>
ikaros-project commented 5 years ago

This probably fixed now. It appeared to only influence rgb-images. Please test and close if possible.

trondarild commented 5 years ago

Will do, check if you have committed

ikaros-project commented 5 years ago

Committed!

trondarild commented 5 years ago

Still got crashes, but added nullptr checks to all image types, which appears to fix bug

ikaros-project commented 5 years ago

Thanks! The bug will go away when all char * have been changed to std::string. Right now it is std::string(NULL) that causes the crash.