Skip to content

Frequent parameter update causes runtime error #4

Description

@hiroMTB

Issue

When I change a parameter in client.rabbitcontrol.cc, sometimes oF app crashes on macOS and Ubuntu.
This only happens when I have a ofParameter which is frequently updated from oF app.
The crash happens randomly as far as I use it in a normal way.

Location of the issue

parameterserver.cpp L189-L198

for (auto& p : parameterManager->dirtyParameter) {
// TODO send COMMAND_UPDATEVALUE
command_t cmd = COMMAND_UPDATE;
if (p.second->onlyValueChanged())
{
cmd = COMMAND_UPDATEVALUE;
}
Packet packet(cmd, p.second);
sendPacket(packet);
}

  • sometimes p or p->second becomes nullptr
  • sometimes iterator(of for loop) fails to increment

How to regenerate issue

  1. add following line in example app (ofxRabbitControl/example/src/ofApp.cpp)
void ofApp::update(){
    for(int i=0; i<10000; i++){
        int32Param = ofRandom(0, 100);
        floatParam = ofRandom(0, 10.0f);
    }
}
  1. run oF app and connect via client.rabbitcontrol.cc
  2. keep moving some of GUI slider or color palette quickly

Environment

A

  • macOS 10.15.7
  • Xcode 12.4
  • oF 0.11.0
  • Latest master branch with fake ofFloatColor fix

B

  • Ubuntu 20.04
  • CLion
  • oF 0.11.0
  • Latest master branch with fake ofFloatColor fix

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