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

Open
opened 2026-01-29 17:21:59 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1694
Author: @steel-bucket
Created: 4/25/2025
Status: Merged
Merged: 5/18/2025
Merged by: @prateekmedia

Base: masterHead: fix-unit-test


📝 Commits (1)

  • 1c6c22e Fix Unit Test Rust based on the new changes on Rust 1.86.0

📊 Changes

3 files changed (+24 additions, -8 deletions)

View changed files

📝 docs/CHANGES.TXT (+1 -0)
📝 src/rust/src/decoder/mod.rs (+18 -7)
📝 src/rust/src/lib.rs (+5 -1)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1694 **Author:** [@steel-bucket](https://github.com/steel-bucket) **Created:** 4/25/2025 **Status:** ✅ Merged **Merged:** 5/18/2025 **Merged by:** [@prateekmedia](https://github.com/prateekmedia) **Base:** `master` ← **Head:** `fix-unit-test` --- ### 📝 Commits (1) - [`1c6c22e`](https://github.com/CCExtractor/ccextractor/commit/1c6c22ecbda986543b8ff40ad999a9e063740581) Fix Unit Test Rust based on the new changes on Rust 1.86.0 ### 📊 Changes **3 files changed** (+24 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/CHANGES.TXT` (+1 -0) 📝 `src/rust/src/decoder/mod.rs` (+18 -7) 📝 `src/rust/src/lib.rs` (+5 -1) </details> ### 📄 Description <!-- 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` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:21:59 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2407