[PR #1694] [FIX] Fixed Unit Test Rust based on the new changes on Rust 1.86.0 #2411

Closed
opened 2026-01-29 17:22:00 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1694

State: closed
Merged: Yes


In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

While working on the share module, I came across the problem that on the main branch, the Unit Test Rust(test_rust.yml) was failing. Reverting commits didn't help, later I found out that the problem was due to Rust being upgraded to 1.86.0.
The New Changes to check for Null pointer De-referencing
This triggered a panic on 3 tests

  • test_do_cb in src/rust/src/lib.rs
  • test_process_cc_data in src/rust/src/decoder.rs
  • test_process_current_packet in src/rust/src/decoder.rs

The errors were fixed by checking for null pointers and reverting to a fallback value when true. I have used Box::leak in decoder.rs for now, it may be changed to a safer alternative later.

How to replicate the errors for the main branch

  • git clone https://github.com/CCExtractor/ccextractor && cd ccextractor
  • cd src/rust
  • rustup update
  • rustup run 1.86.0 cargo test
**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1694 **State:** closed **Merged:** Yes --- <!-- Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. --> **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [x] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [x] I am an active contributor to CCExtractor. --- While working on the `share` module, I came across the problem that on the main branch, [the Unit Test Rust(test_rust.yml) was failing](https://github.com/CCExtractor/ccextractor/actions/runs/14557403272/job/40836138898). Reverting commits didn't help, later I found out that the problem was due to Rust being upgraded to 1.86.0. [The New Changes to check for Null pointer De-referencing](https://github.com/rust-lang/rust/pull/134424) This triggered a panic on 3 tests - `test_do_cb` in `src/rust/src/lib.rs` - `test_process_cc_data` in `src/rust/src/decoder.rs` - `test_process_current_packet` in `src/rust/src/decoder.rs` The errors were fixed by checking for null pointers and reverting to a fallback value when true. I have used Box::leak in `decoder.rs` for now, it may be changed to a safer alternative later. ## How to replicate the errors for the main branch - `git clone https://github.com/CCExtractor/ccextractor && cd ccextractor ` - `cd src/rust` - `rustup update` - `rustup run 1.86.0 cargo test`
claunia added the pull-request label 2026-01-29 17:22:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2411