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

Fix undefined behavior of RefMutContainer #34

Merged
merged 13 commits into from
Jun 27, 2023
Merged

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Jun 23, 2023

Fixes #33, #27, #17, #18.

>>> import rraft
>>> c = rraft.Config()
>>> r = c.make_ref()
>>> c = None
>>> r
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
Exception: Cannot use a destroyed object's reference!
>>> r.get_id()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
Exception: Cannot use a destroyed object's reference!
>>> 

@jopemachine jopemachine self-assigned this Jun 23, 2023
@jopemachine jopemachine added the bug Something isn't working label Jun 23, 2023
@jopemachine jopemachine marked this pull request as ready for review June 23, 2023 01:54
@jopemachine
Copy link
Member Author

Only applied to Config type at first.

@jopemachine jopemachine marked this pull request as draft June 23, 2023 01:57
@jopemachine
Copy link
Member Author

I also try to fix #27 here.

@jopemachine
Copy link
Member Author

jopemachine commented Jun 23, 2023

I checked that this PR also resolve #17.
Passing the Logger_Ref variable to Network.new no longer causes weird behavior.

@jopemachine jopemachine changed the title PoC RefMutContainer V2 Fix undefined behavior of RefMutContainer Jun 27, 2023
@jopemachine
Copy link
Member Author

jopemachine commented Jun 27, 2023

CI fails currently regardless of the test result.
I will look into it.

@jopemachine jopemachine marked this pull request as ready for review June 27, 2023 06:25
@jopemachine jopemachine force-pushed the fix-ref-mut-container branch 2 times, most recently from 98140b6 to 933843f Compare June 27, 2023 08:03
@jopemachine jopemachine merged commit 1566964 into main Jun 27, 2023
2 checks passed
@jopemachine jopemachine deleted the fix-ref-mut-container branch June 27, 2023 08:20
@jopemachine jopemachine removed the WIP label Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment