Summary: | bus-test fails if extra fds are open on startup, e.g. under gdb | ||
---|---|---|---|
Product: | dbus | Reporter: | Simon McVittie <smcv> |
Component: | core | Assignee: | Simon McVittie <smcv> |
Status: | RESOLVED FIXED | QA Contact: | John (J5) Palmieri <johnp> |
Severity: | minor | ||
Priority: | low | CC: | adam.hawthorne, cosimo.alfarano, smcv, thiago, viseguy, walters |
Version: | unspecified | Keywords: | patch |
Hardware: | All | ||
OS: | All | ||
URL: | http://git.collabora.co.uk/?p=user/smcv/dbus-smcv.git;a=shortlog;h=refs/heads/fdleaks-35173 | ||
Whiteboard: | review+ | ||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 36074 | ||
Attachments: |
Don't report file descriptors as "leaked" if they were already open
_dbus_check_fdleaks_enter, _dbus_check_fdleaks_leave: whitespace |
Description
Simon McVittie
2011-03-10 05:16:17 UTC
Created attachment 44447 [details] [review] Don't report file descriptors as "leaked" if they were already open This is necessary to run the regression tests under valgrind (if telling it to output to a dedicated fd), gdb, fakeroot etc. --- This will fail for fds beyond FD_SETSIZE, but if you're using fds outside that range then you're weird. :-) Comment on attachment 44447 [details] [review] Don't report file descriptors as "leaked" if they were already open Hmm; what about a _DBUS_TESTS_FD_WHITELIST environment variable or something? >+_dbus_check_fdleaks_enter (void) The indentation in this function is inconsistent: >+ if ((d = opendir("/proc/self/fd"))) Space after identifier. Otherwise looks OK. (In reply to comment #2) > Hmm; what about a _DBUS_TESTS_FD_WHITELIST environment variable or something? Auto-detecting the initial set seems better than having to put it in the environment. (Rationale: I shouldn't have to remember which fd a particular version of gdb/fakeroot likes to use, and compensate for it, if we can pick it up automatically.) > >+_dbus_check_fdleaks_enter (void) > > The indentation in this function is inconsistent: The indentation looks fine to me? I assume you meant "whitespace"? > >+ if ((d = opendir("/proc/self/fd"))) > > Space after identifier. > > Otherwise looks OK. Thanks, I'll fix that and merge. Created attachment 44668 [details] [review] _dbus_check_fdleaks_enter, _dbus_check_fdleaks_leave: whitespace It turns out the code I converted into _dbus_check_fdleaks_leave (then modified for _dbus_check_fdleaks_enter) consistently got this wrong, so here's a separate patch that fixes both. (In reply to comment #4) > Created an attachment (id=44668) [details] > _dbus_check_fdleaks_enter, _dbus_check_fdleaks_leave: whitespace > > It turns out the code I converted into _dbus_check_fdleaks_leave (then modified > for _dbus_check_fdleaks_enter) consistently got this wrong, so here's a > separate patch that fixes both. Looks OK. Fixed in git for 1.4.10, 1.5.2 |
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.