PATCH Check module version each time it is loaded

Michal Suchanek hramrach at centrum.cz
Mon Oct 10 01:10:23 PDT 2011


On 10 October 2011 05:38, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> On Fri, Oct 07, 2011 at 02:58:35PM +0200, Michal Suchanek wrote:
>> Hello,
>>
>> The X server "duplicates" modules by loading them again from the disk.
>>
>> Since this "duplication" happens on every input device hotplug, possibly weeks
>> after the X server has been started a different module might have been
>> installed by that time (eg. due to upgrading distribution packages) the X
>> server should check the module every time it is loaded to prevent weird issues
>> due to modules compiled for different ABI.
>>
>> I compiled an X server with the patch and it worked but I have no idea how to
>> test the error paths.
>>
>> https://bugs.freedesktop.org/attachment.cgi?id=51585
>> https://bugs.freedesktop.org/show_bug.cgi?id=41182
>
> fwiw, last time I tried this (about a year or so ago), the problem was
> dlopen(). even if you replace the file, dlopen() will simply re-load the
> original file. Not sure if this has been fixed yet but that's what you need
> to check first (would be simple to verify with a test program)
>

If it reloaded the original file no problem would occur.

There was a reference counting layer in the loader which was removed
supposedly because dlopen does just that.

Anyway, here is much simpler way to fix it.

Instead of the previous patch apply 2-5.

Applied to 1.11 branch X server and tested that unplugging and
replugging a wacom tablet works.

That's the only driver I know of for which all devices can be removed.

Thanks

Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Document-DuplicateModule-function.patch
Type: text/x-patch
Size: 1171 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111010/87c7e537/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Unload-submodules.patch
Type: text/x-patch
Size: 764 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111010/87c7e537/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Use-UnloadModuleOrDriver-for-UnloadSubModule.patch
Type: text/x-patch
Size: 1258 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111010/87c7e537/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Do-not-uselessly-reload-modules-in-DuplicateModule.patch
Type: text/x-patch
Size: 2365 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111010/87c7e537/attachment-0007.bin>


More information about the xorg-devel mailing list