Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misaligned ptr #26

Closed
George-Miao opened this issue May 9, 2023 · 3 comments · Fixed by #28
Closed

Misaligned ptr #26

George-Miao opened this issue May 9, 2023 · 3 comments · Fixed by #28

Comments

@George-Miao
Copy link

Error:

thread 'db::test::test_db' panicked at 'misaligned pointer dereference: address must be a multiple of 0x8 but is 0x7f877000191c', src/index.crates.io-6f17d22bba15001f/jammdb-0.9.0/src/freelist.rs:64:29

Code:

use jammdb::DB;

#[test]
fn test_db() -> Result<(), Box<dyn std::error::Error>> {
    let db = DB::open("data/123.db")?;

    let tx = db.tx(true)?;
    tx.create_bucket("test")?;
    tx.commit()?;

    Ok(())
}

Version:

cargo 1.71.0-nightly (d0a4cbcee 2023-04-16)
rustc 1.71.0-nightly (fec9adcdb 2023-04-21)
jammdb: 0.9.0
system: Linux 6.2.8-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC x86_64 GNU/Linux
@George-Miao George-Miao changed the title Misaigned ptr Misaligned ptr May 9, 2023
@pjtatlow
Copy link
Owner

Hmm, this is an interesting one. Only happens on nightly, not stable. Do you know of any changes to 1.71 that might impact pointer alignment?

@George-Miao
Copy link
Author

George-Miao commented May 17, 2023

Hmm, this is an interesting one. Only happens on nightly, not stable. Do you know of any changes to 1.71 that might impact pointer alignment?

Yes. I believe they added panic on misaligned ptr dereference to 1.71 in debug builds. This is a bug for sure, it's just not cause any error until now.

@pjtatlow
Copy link
Owner

@George-Miao thanks for reporting this! Sorry the fix took so long. I'll cut a new release now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants