Bug 39836 - add a regression test/stress-test for thread-safe reference counting
Summary: add a regression test/stress-test for thread-safe reference counting
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.4.x
Hardware: All All
: medium enhancement
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL: http://cgit.freedesktop.org/~smcv/dbu...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks: dbus-1.5
  Show dependency treegraph
 
Reported: 2011-08-04 09:05 UTC by Simon McVittie
Modified: 2011-08-11 03:59 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
[PATCH 1/2] relay test: don't leak the server's address (1.53 KB, patch)
2011-08-04 09:09 UTC, Simon McVittie
Details | Splinter Review
[PATCH 2/2] Add a regression test for fd.o #38005 (16.39 KB, patch)
2011-08-04 09:10 UTC, Simon McVittie
Details | Splinter Review
patch 2/2 adapted for dbus-1.4 (16.41 KB, patch)
2011-08-04 09:19 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2011-08-04 09:05:30 UTC
I've written a test for Bug #38005, which I'll attach in a moment. It basically refs and unrefs an object 4 million times in 200 threads, and checks that the refcount hits 0 at the right time.

(Perhaps those numbers are a bit enthusiastic, but on my dual-core laptop it takes 4 seconds and peaks at 15 MB resident, and even on a single-core ARM device it only takes 10 seconds.)
Comment 1 Simon McVittie 2011-08-04 09:09:04 UTC
Created attachment 49922 [details] [review]
[PATCH 1/2] relay test: don't leak the server's address

Not entirely related, but I noticed this while writing the new test.
Comment 2 Simon McVittie 2011-08-04 09:10:27 UTC
Created attachment 49923 [details] [review]
[PATCH 2/2] Add a regression test for fd.o #38005

This uses internal API so it can exercise (for instance) both the ref and ref_unlocked code paths, and also so it can create pending call objects.
Comment 3 Simon McVittie 2011-08-04 09:19:08 UTC
Created attachment 49924 [details] [review]
patch 2/2 adapted for dbus-1.4

The code is the same, only the Makefile.am differs.
Comment 4 Will Thompson 2011-08-05 04:32:37 UTC
Review of attachment 49922 [details] [review]:

++
Comment 5 Will Thompson 2011-08-05 04:56:52 UTC
Well, I was about to complain that 4 seconds seems like a lot, but it's dwarfed by the rest of the test suite. (Which is in itself not a good thing, but silences my vague objection. ☺) ++
Comment 6 Simon McVittie 2011-08-11 03:59:54 UTC
Thanks, fixed in 1.4.16, 1.5.8


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.