Bug 723795

Summary: python-gudev 147.1 - memory corruption calling query_by_subsystem.
Product: [Fedora] Fedora Reporter: Sandro Bonazzola <sandro.bonazzola>
Component: python-gudevAssignee: Stanislav Ochotnicky <sochotni>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 14CC: sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-gudev-147.1-6.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-12 10:54:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Sandro Bonazzola 2011-07-21 07:43:59 UTC
Description of problem:
I'm experiencing some g_slice issue so I've set:
export G_SLICE="debug-blocks"
export MALLOC_CHECK_=2
export G_DEBUG="gc-friendly"

the following python code:
import gudev
gudev_client = gudev.Client(["usb", "input"])
input_devices = gudev_client.query_by_subsystem("input")

causes:
GSlice: MemChecker: attempt to release block with invalid size: 0x8e5b660 size=12 invalid-size=8

generating a coredump.

#0  0x001a9416 in __kernel_vsyscall ()
#1  0x0056f2f1 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0x00570d5e in abort () at abort.c:92
#3  0x00442b49 in g_slice_free_chain_with_offset (mem_size=8, mem_chain=
    0x8e5b660, next_offset=4) at gslice.c:980
#4  0x00442e2e in g_slist_free (list=0x8e5b660 = {...}) at gslist.c:166
#5  0x0038fcf6 in _wrap_g_udev_client_query_by_subsystem (self=0xb74e55a4, 
    args=('input',), kwargs=0x0) at gudev.override:156
#6  0x00218878 in PyCFunction_Call (func=
    <built-in method query_by_subsystem of gudev.Client object at remote 0xb74e55a4>, arg=('input',), kw=0x0)
    at /usr/src/debug/Python-2.7/Objects/methodobject.c:85

in frame #5:
154	    source = g_udev_client_query_by_subsystem(G_UDEV_CLIENT(self->obj), subsystem);
155	    dest = gslist_to_pylist_objs(source);
156	    g_slist_free(source);
157	    return dest;


at line 156 is called g_slist_free(source) but source is of type GList according to g_udev_client_query_by_subsystem documentation, so the free cause a memory corruption.


Version-Release number of selected component (if applicable):
python-gudev-debuginfo-147.1-5.fc14.i686
python-gudev-147.1-5.fc14.i686
libgudev1-161-8.fc14.i686
libgudev1-devel-161-8.fc14.i686


How reproducible:
Always reproducible

Comment 1 Fedora Update System 2011-07-21 08:15:05 UTC
python-gudev-147.1-6.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/python-gudev-147.1-6.fc14

Comment 2 Fedora Update System 2011-07-21 08:20:10 UTC
python-gudev-147.1-7.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/python-gudev-147.1-7.fc15

Comment 3 Sandro Bonazzola 2011-07-21 08:32:47 UTC
is there any reason for patching python-gudev-147.1 instead of updating it to python-gudev-147.3 ?

Comment 4 Fedora Update System 2011-07-21 09:19:31 UTC
python-gudev-147.2-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/python-gudev-147.2-1.fc15

Comment 5 Stanislav Ochotnicky 2011-07-21 09:21:42 UTC
There is no 147.3 version yet. Thanks for pointing out that there is a newer version though, forgot about it. Updated to 147.2 in F15+. I still prefer to keep F14 as bugfix-only with as few changes as possible.

Comment 6 Fedora Update System 2011-07-23 01:54:29 UTC
Package python-gudev-147.1-6.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-gudev-147.1-6.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/python-gudev-147.1-6.fc14
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-08-12 10:54:34 UTC
python-gudev-147.1-6.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2011-08-12 10:59:14 UTC
python-gudev-147.2-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2011-08-12 18:20:52 UTC
python-gudev-147.2-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2011-08-12 18:26:58 UTC
python-gudev-147.1-6.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.