Skip to content

Fix race conditions on Init #2102

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

Merged
merged 3 commits into from
Jul 12, 2019
Merged

Fix race conditions on Init #2102

merged 3 commits into from
Jul 12, 2019

Conversation

gpotter2
Copy link
Member

@gpotter2 gpotter2 commented Jun 24, 2019

fixes #1966

@guedou
Copy link
Member

guedou commented Jun 25, 2019

That is not my definition of a simple fix =)

I am ok with the PR if it fixes the initial issue, however I still think that a race condition can appear.

@codecov
Copy link

codecov bot commented Jun 26, 2019

Codecov Report

Merging #2102 into master will increase coverage by 0.17%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2102      +/-   ##
==========================================
+ Coverage   87.12%   87.29%   +0.17%     
==========================================
  Files         198      199       +1     
  Lines       44679    45184     +505     
==========================================
+ Hits        38926    39445     +519     
+ Misses       5753     5739      -14
Impacted Files Coverage Δ
scapy/packet.py 80.36% <100%> (+0.36%) ⬆️
scapy/fields.py 91.91% <100%> (+0.01%) ⬆️
scapy/sessions.py 95.9% <0%> (-1.93%) ⬇️
scapy/utils.py 81.39% <0%> (-0.63%) ⬇️
scapy/arch/bpf/supersocket.py 77.77% <0%> (-0.37%) ⬇️
scapy/sendrecv.py 84.09% <0%> (-0.18%) ⬇️
scapy/compat.py 100% <0%> (ø) ⬆️
scapy/error.py 100% <0%> (ø) ⬆️
scapy/layers/http.py 86.54% <0%> (ø)
scapy/layers/inet.py 72.84% <0%> (+0.02%) ⬆️
... and 11 more

@gpotter2 gpotter2 added the bug label Jun 27, 2019
@gpotter2 gpotter2 mentioned this pull request Jun 29, 2019
27 tasks
@guedou
Copy link
Member

guedou commented Jul 4, 2019

@gpotter2 could you rebase?

@gpotter2
Copy link
Member Author

gpotter2 commented Jul 4, 2019

Do you know if this actually fixes the issue ?

@guedou
Copy link
Member

guedou commented Jul 4, 2019

I am able to quickly (less than 50 runs of the PoC with n set to 2000) reproduce the issue on master on two different setups. 1000 runs of the same PoC with this branch did not trigger the issue.

Copy link
Member

@guedou guedou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine on two different setups.

Copy link
Member

@guedou guedou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that it breaks test in fields.uts. Can you have a look?

@gpotter2
Copy link
Member Author

Right. MultipleTypeField doesn't like the new system. It should be possible to work around that though

@gpotter2
Copy link
Member Author

@guedou
Fixed !

@guedou guedou merged commit cae2813 into secdev:master Jul 12, 2019
@gpotter2 gpotter2 deleted the racepatch branch July 12, 2019 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition when instantiating Packet subclasses in multiple threads
2 participants