Bug 42850 - delete-device and delete-profile segfaults
Summary: delete-device and delete-profile segfaults
Status: RESOLVED FIXED
Alias: None
Product: colord
Classification: Unclassified
Component: client (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-12 07:34 UTC by Laurent Martelli
Modified: 2011-11-25 04:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Documentation fixes and improvements (5.96 KB, patch)
2011-11-12 17:58 UTC, Laurent Martelli
Details | Splinter Review

Description Laurent Martelli 2011-11-12 07:34:39 UTC
Those commands pretend to take a device or profile id as input, but they indeed require object paths, and segfault if you give them an id.

I'd be happy to send patch, but I don't know if I should fix the documentation or the code.
Comment 1 Richard Hughes 2011-11-12 11:28:51 UTC
Eeek, it certainly shouldn't segfault. Have you got a backtrace? The methods should certainly take a object path rather than an ID.
Comment 2 Laurent Martelli 2011-11-12 17:58:07 UTC
Created attachment 53471 [details] [review]
Documentation fixes and improvements
Comment 3 Laurent Martelli 2011-11-12 18:19:59 UTC
Here's a backtrace:

#0  0xb75d47b7 in ?? () from /lib/libglib-2.0.so.0
#1  0xb75d395a in ?? () from /lib/libglib-2.0.so.0
#2  0xb75d3bc8 in g_variant_new_va () from /lib/libglib-2.0.so.0
#3  0xb75d3c7f in g_variant_new () from /lib/libglib-2.0.so.0
#4  0xb77c0fed in cd_client_delete_device (client=0x9bc2848, device=0x9bdd120, cancellable=0x0, 
    callback=0xb77c48a0 <cd_client_delete_device_finish_sync>, user_data=0xbf8a8f78) at cd-client.c:1161
#5  0xb77c4aed in cd_client_delete_device_sync (client=0x9bc2848, device=0x9bdd120, cancellable=0x0, 
    error=0xbf8a8ffc) at cd-client-sync.c:188
#6  0x0804be12 in cd_util_delete_device (priv=0x9bc77a0, values=0xbf8a90cc, error=0xbf8a8ffc)
    at cd-util.c:1160
#7  0x0804b195 in cd_util_run (error=0xbf8a8ffc, values=0xbf8a90cc, command=0xbf8aa5b4 "delete-device", 
    priv=0x9bc77a0) at cd-util.c:506
#8  main (argc=3, argv=0xbf8a90c4) at cd-util.c:1631

You should check that all paths coming from the command line are valid. I don't know how to do that. But I've fixed the documentation.
Comment 4 Richard Hughes 2011-11-25 04:21:06 UTC
Committed to git master, thanks!


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.