Skip to content

Crash in correct_reed_solomon_decode() #48

Description

@burt2902

First of all, thank you for this great project.

I have been experiencing random crashes of the program that is decoding a reed-solomon protected data. I have managed to narrow down the issue to correct_reed_solomon_decode(). Below is a code snippet that eventually results in a crash.
The smaller the PARITY, the faster the crash happens. 2 is really fast, 4 takes quite some time, but eventually crashes.

#define PAYLOAD_SIZE      4
#define PARITY_SIZE       2

void rs_crash()
{
    correct_reed_solomon *rs = correct_reed_solomon_create(correct_rs_primitive_polynomial_ccsds, 1, 1, PARITY_SIZE);
    uint8_t encoded[PAYLOAD_SIZE + PARITY_SIZE];
    uint8_t decoded[PAYLOAD_SIZE];

    while(1)
    {
        for(int n = 0; n < PAYLOAD_SIZE + PARITY_SIZE; n++)
            encoded[n] = rand() % 256;
        correct_reed_solomon_decode(rs, encoded, PAYLOAD_SIZE + PARITY_SIZE, decoded); 
    }
}

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