Rubyko/RaptorQ

Segmentation fault (core dumped)

Closed this issue · 5 comments

Hello, I have built it successfully. Now, I run the complete.cpp file by using Decoder in folder build. I got some issue as follows:

  1. If the text.cpp file is small size, for example, the content in the file is 'This is txt file for testing RaptorQ'. Then the Decoder is crash. Segmentation fault (core dumped). I think the issue is from fixed packet size in your code. If it is correct. I think it is better to make a adaptive packet size based on the size of file

  2. I increase the content of file to larger about 70.4KB, then the new error is happen


decoded 1success 0 if 0 then success 
decoded 2success 0 if 0 then success 
decoded 3success 0 if 0 then success 
decoded 4success 0 if 0 then success 
decoded 5success 0 if 0 then success 
decoded 6success 0 if 0 then success 
decoded 7success 0 if 0 then success 
decoded 8success 0 if 0 then success 
*** Error in `./Decoder': double free or corruption (!prev): 0x00007f9418008e90 ***
Aborted (core dumped)

Thank you for providing a nice code

Okay. Let me see the cause of the error. I have been lazy last time. Haven't done much work. Keep in touch. Thanks.

The problem isn't so big as it seems.

  1. look at complete.cpp

  2. you generate packets

    for(int i = 0; i < pckt.blocks[Z].sys.K_prime + 2000; i++)

  3. here you erase packets and shuffle them
    std::random_shuffle(packets.begin(), packets.end());
    packets.erase(packets.begin(), packets.begin() + 4000);

  4. if your file is small then you erase more packets than it was created.

  5. Try to generate more packets or try erasing less packets.

  6. Conclusion:
    You erase more packets than it was created.

The code should work with big files as well.

Thank you. Sorry for my reply late.
Your solution looks complicate for me. what are 2000 and 4000? The 2000 is as number of repair symbols, right. I think these tuning parameters may be move to setting variables. As common channel loss, you can use BEC channel for making the loss packet, instead of using fixed number.

For suggestion, I think you can change your code as follows:

  1. Read the size of file, then number of redundant is as variable such as num_Re=10;
  2. Based on the total encoded size, and erasure probability (such as p=0.2). you can compute the received symbols and decode them.

Is it possible to do it? Thank you

Yes, of course, it is possible. I am planning to return to RaptorQ enough soon. Thank you for your help.