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

[Homework 6] program stopped after scope #787

Closed
leesecre opened this issue Dec 19, 2022 · 4 comments
Closed

[Homework 6] program stopped after scope #787

leesecre opened this issue Dec 19, 2022 · 4 comments
Assignees
Labels
homework - hazard_pointer hazard_pointer/{mod,hazard,retire}.rs question Further information is requested

Comments

@leesecre
Copy link

leesecre commented Dec 19, 2022

Hello,

I got stucked in counter test in hazard_pointers.rs

The problem is the test program is just stop (At first, I thought it was infinite loop).
(The test program do nothing : no error message, no progress)

I used print function to find where the program goes down.

And I found that the program stopped in scope after for loop in fn counter.

Weird thing is that when I put print code on drop for Shield, it passed the test.

The last thing that program do was calling drop for RetiredSet and do collect. (It ends well).

asan, tsan does not give me information about why the program goes down.
Can you give me some hints to solve the problem?
(single thread does not make a problem)

The code in hazard_pointers.rs
`

    scope(|s| {
        for _ in 0..THREADS {
            s.spawn(|| {
                for _ in 0..ITER {
                    ...
                }
            });
        }
       // <----- here stop the program after call Drop for RetiredSet
    });
@leesecre leesecre added the question Further information is requested label Dec 19, 2022
@tomtomjhj
Copy link
Member


Maybe your solution is looping here. If that's the case, try fixing Shield::drop.

@leesecre
Copy link
Author

leesecre commented Dec 19, 2022

Thank you for answering.

I checked, that collect function returned and while loop is ended.

I put print after while loop and It printed the lines. Does it mean that loop ended well?

@Lee-Janggun
Copy link
Member

Yes, that means the loop ended. That is very weird then...

@leesecre
Copy link
Author

Oh, I think it is same problem, my program was stucked in protect too.

Thanks for your help

@Lee-Janggun Lee-Janggun added the homework - hazard_pointer hazard_pointer/{mod,hazard,retire}.rs label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
homework - hazard_pointer hazard_pointer/{mod,hazard,retire}.rs question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants