After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785260 - gio/tests/appmonitor fails if local dir not writeable
gio/tests/appmonitor fails if local dir not writeable
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.52.x
Other Mac OS
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-07-22 04:51 UTC by Daniel Macks
Modified: 2017-08-23 10:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Fix leak in appmonitor test (912 bytes, patch)
2017-08-18 09:02 UTC, Philip Withnall
committed Details | Review
tests: Add temporary working directory for appmonitor test (3.03 KB, patch)
2017-08-18 09:02 UTC, Philip Withnall
committed Details | Review
tests: Add temporary working directory for monitor test (2.39 KB, patch)
2017-08-18 09:02 UTC, Philip Withnall
committed Details | Review

Description Daniel Macks 2017-07-22 04:51:26 UTC
Another user on my system reported a test failure, so he chmod +755 so I could look. I cd'ed into his build dir and ran ./appmonitor. Even before the tests ran, I got diagnostics that indicated the tempdir used by the test was not created. No such problem for the original user or if I was in a directory that was writeable by me.

appmonitor.c:main() uses g_mkdtemp() with a simple filename template, so it attempts to create the temp directory in the current directory where the test is run. If instead it used g_dir_make_tmp(), it would create the temp directory in a place that any user can write, so it wouldn't be affected by local dir permissions.

Either way, this function also seems to leak the 'path' variable (should g_free() it).
Comment 1 Philip Withnall 2017-08-18 09:02:18 UTC
Created attachment 357867 [details] [review]
tests: Fix leak in appmonitor test

Spotted by Daniel Macks.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Philip Withnall 2017-08-18 09:02:24 UTC
Created attachment 357868 [details] [review]
tests: Add temporary working directory for appmonitor test

Rather than creating a temporary directory in the current directory
(typically the builddir), then never deleting it; create one in the
system /tmp directory, and clean it up properly afterwards.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 3 Philip Withnall 2017-08-18 09:02:29 UTC
Created attachment 357869 [details] [review]
tests: Add temporary working directory for monitor test

Similarly to the previous commit, move the temporary directory for the
monitor test from $(cwd) to the system temporary directory.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 4 Emmanuele Bassi (:ebassi) 2017-08-23 10:09:08 UTC
Review of attachment 357867 [details] [review]:

+1
Comment 5 Emmanuele Bassi (:ebassi) 2017-08-23 10:10:03 UTC
Review of attachment 357868 [details] [review]:

:thumbs_up:
Comment 6 Emmanuele Bassi (:ebassi) 2017-08-23 10:10:42 UTC
Review of attachment 357869 [details] [review]:

:confetti_ball:
Comment 7 Philip Withnall 2017-08-23 10:21:03 UTC
(In reply to Emmanuele Bassi (:ebassi) from comment #6)
> Review of attachment 357869 [details] [review] [review]:
> 
> :confetti_ball:

You have no idea how long I’ve been waiting for someone to ack one of my patches with this much style.
Comment 8 Emmanuele Bassi (:ebassi) 2017-08-23 10:26:27 UTC
I've just been thwarted by Bugzilla's lack of emoji shorthand support; hopefully GitLab will fix this glaring omission.
Comment 9 Philip Withnall 2017-08-23 10:28:34 UTC
Thanks for the review! :rainbowfrog: :octopus:

Attachment 357867 [details] pushed as 3ce00b2 - tests: Fix leak in appmonitor test
Attachment 357868 [details] pushed as 0f5b523 - tests: Add temporary working directory for appmonitor test
Attachment 357869 [details] pushed as a60359a - tests: Add temporary working directory for monitor test