pauledd replied to the topic 'help on indi wiringPi gpio crash' in the forum. 4 years ago

I maybe made a bit of progress.
This "Uninitialised value was created by a heap allocation" (wiringpi_gpio.cpp) seems to be related to the part
in the updateProperties() function where you test for NULL:

if (InputDigitalLP[i]->lp != NULL)
    defineLight(InputDigitalLP[i]);
if (OutputDigitalSP[i]->sp != NULL)
    defineSwitch(OutputDigitalSP[i]);
My thought was that "InputDigitalLP->lp" and "OutputDigitalSP->sp" needs to be initialized with something...
So I assigned NULL to it right after its creation in the "WiringPiGPIO::WiringPiGPIO()" constructor:
WiringPiGPIO::WiringPiGPIO()
{
    for (int i = 0; i < NUMBER_OF_PINS; i++)
    {
        InputDigitalLP[i] = new ILightVectorProperty;
        OutputDigitalSP[i] = new ISwitchVectorProperty;
                
                // added
                InputDigitalLP[i]->lp = NULL;
                OutputDigitalSP[i]->sp = NULL;
                //
    }
    OutputPWMNP = new INumberVectorProperty;

    setVersion(0,1);
    setDriverInterface(AUX_INTERFACE);
}

I really dont know If this is the right way to do it but a first tests with the new code show normal behaviour of the driver (compiled with gcc-6.x).
I can set gpio's, switch them, and save them successfully B).
I will report back if there is any new fail.

Read More...