[Spice-devel] Patch to support LZ4 compression algorithm‏‏

Fabio Fantoni fantonifabio at tiscali.it
Fri Jan 9 02:16:15 PST 2015


Il 08/01/2015 17:15, Fabio Fantoni ha scritto:
> Il 07/01/2015 10:13, LgDoor ha scritto:
>> I think the cause of this problem is the unnecessary step of flipping the bitmap buffer lines when encoding, since the surface in the client will be created with the top-down param. 
>> this patch just works.
> I tried your patch in attachment removing 2 parts (see below) and I can
> confirm that it partially solves critical lz4 bug.
> I'll post details with backtrace tomorrow.
>
> I had this error on compile:
> red_worker.c:264:1: error: 'inline' is not at beginning of declaration
> [-Werror=old-style-declaration]
> red_worker.c: In function 'print_compress_stats':
> red_worker.c:1172:5: error: 'CommonChannel' has no member named 'id'
> Solved removing this part of patch:
>> -//#define COMPRESS_STAT
>> +#define COMPRESS_STAT
> I think should be posted to mailing list for better review and add in
> upstream.
> Before post it I think that 2 changes should be remove, first the
> mentioned above and this:
>> -            if (image_compression == SPICE_IMAGE_COMPRESS_LZ4 &&
>> +            if (true &&
> Thanks for any reply and sorry for my bad english.

In details:
I tried windows 7 vm with qxl and qxl driver installed from spice guest
tools 0.74, working good without setting lz4 compression.
Using lz4 before this patch when arrive to windows login have always
"broken image" and spice client crash.
After this patch there is anymore broken image but spice client still
crash always after short time with this error major of cases:
*** Error in `/usr/bin/remote-viewer': free(): invalid next size
(normal): 0x0000000001b9eb30 ***

I tried some times also to take full backtrace but I have to force close
of remote-viewer window to be able to write bt full, so probablyit isn't
full the backtrace:
Program received signal SIGABRT, Aborted.
0x00007ffff517bbb9 in __GI_raise (sig=sig at entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: File o directory non
esistente.
(gdb) bt full
#0  0x00007ffff517bbb9 in __GI_raise (sig=sig at entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
        resultvar = 0
        pid = 3297
        selftid = 3297
#1  0x00007ffff517efc8 in __GI_abort () at abort.c:89
        save_stage = 2
        act = <error reading variable act (Cannot access memory at
address 0x7fffd10ee5b0)>
        sigs = <error reading variable sigs (Cannot access memory at
address 0x7fffd10ee530)>
Cannot access memory at address 0x7fffd10ee658

And this anoter case:
Program received signal SIGSEGV, Segmentation fault.
0x00007f4e00479b5d in _int_free (av=0x7f4e007b9760 <main_arena>,
    p=<optimized out>, have_lock=0) at malloc.c:3987
3987    malloc.c: File o directory non esistente.
(gdb) bt full
#0  0x00007f4e00479b5d in _int_free (av=0x7f4e007b9760 <main_arena>,
    p=<optimized out>, have_lock=0) at malloc.c:3987
        size = 3174896
        fb = <optimized out>
        nextchunk = 0x1541e10
        nextsize = 2602528
        nextinuse = <optimized out>
        prevsize = <optimized out>
        bck = 0xffffff00ffffff
        fwd = 0xffffff00ffffff
        errstr = 0x0
        locked = <optimized out>
#1  0x00007f4e01c1608c in release_data (image=<optimized out>,
    release_data=<error reading variable: Cannot access memory at
address 0x7f4dd3ffe958>) at canvas_utils.c:47
        data = <error reading variable data (Cannot access memory at
address 0x7f4dd3ffe958)>
#2  0x00007f4dfd990274 in ?? () from
/usr/lib/x86_64-linux-gnu/libpixman-1.so.0
No symbol table info available.
#3  0x00007f4dfd990239 in pixman_image_unref ()
   from /usr/lib/x86_64-linux-gnu/libpixman-1.so.0
No symbol table info available.
Cannot access memory at address 0x7f4dd3ffe9c8


If you need more informations/tests tell me and I'll post them.

Thanks for any reply and sorry for my bad english.

>
>
>> ----------------------------------------
>>> From: javier.celaya at flexvm.es
>>> To: spice-devel at lists.freedesktop.org
>>> Date: Wed, 7 Jan 2015 09:22:52 +0100
>>> Subject: Re: [Spice-devel] Patch to support LZ4 compression algorithm‏‏
>>>
>>> Hello
>>>
>>> To enable LZ4 from the qemu command line, you have to add this to ui/spice-
>>> core.c:
>>>
>>> static const char *compression_names[] = {
>>> [ SPICE_IMAGE_COMPRESS_OFF ] = "off",
>>> [ SPICE_IMAGE_COMPRESS_AUTO_GLZ ] = "auto_glz",
>>> [ SPICE_IMAGE_COMPRESS_AUTO_LZ ] = "auto_lz",
>>> [ SPICE_IMAGE_COMPRESS_QUIC ] = "quic",
>>> [ SPICE_IMAGE_COMPRESS_GLZ ] = "glz",
>>> [ SPICE_IMAGE_COMPRESS_LZ ] = "lz",
>>> + [ SPICE_IMAGE_COMPRESS_LZ4 ] = "lz4",
>>> };
>>>
>>> Build qemu, and then you can use --spice image-compression=lz4.
>>>
>>> About the problem with SPICE_BITMAP_FLAGS_TOP_DOWN, I'll have a look at it
>>> ASAP.
>>>
>>> Thanks for your feedback.
>>>
>>> El Miércoles, 7 de enero de 2015 15:48:43 LgDoor escribió:
>>>> i'm not sure but it seems lz4 won't be enabled unless adding a new value of
>>>> the image_compress parameter in QEMU.
>>>> so i just replace lz with lz4, at red_compress_image() in red_worker.c,
>>> 6680:
>>>>> if (image_compression == SPICE_IMAGE_COMPRESS_LZ4 &&
>>>>> red_channel_client_test_remote_cap(&dcc->common.base,
>>>>> SPICE_DISPLAY_CAP_LZ4_COMPRESSION)) {
>>>> changes to
>>>>
>>>>> if (true && .......
>>>> and launch qemu with --spice image-compression=auto_lz.
>>>>
>>>> ----------------------------------------
>>>>
>>>>> Date: Wed, 7 Jan 2015 08:15:07 +0100
>>>>> From: fantonifabio at tiscali.it
>>>>> To: lgdoor at outlook.com; spice-devel at lists.freedesktop.org
>>>>> Subject: Re: [Spice-devel] Patch to support LZ4 compression algorithm‏‏
>>>>>
>>>>> Il 07/01/2015 08:01, LgDoor ha scritto:
>>>>>> has anybody tried this feature and encountered the displaying problems?
>>>>>>
>>>>>> I just made a small change to enable lz4, but the image turns out to be
>>>>>> broken (see the screenshots). And I observed that it goes wrong only for
>>>>>> the SpiceBitmap w/o SPICE_BITMAP_FLAGS_TOP_DOWN flag in the
>>>>>> red_compress_image() function from red_worker.c .>
>>>>> What change you did?
>>>>> I tried it only using both server and client compiled with it and FWIK
>>>>> should be used automatically if no image compression specified.
>>>>>
>>>>>> 2014-11-14 0:11 GMT+08:00 Javier Celaya <javier.celaya at flexvm.es>:
>>>>>>> Hello
>>>>>>>
>>>>>>> There they go.
>>>>>>>
>>>>>>> However, don't forget that, since spice-protocol is a submodule of
>>>>>>> spice-
>>>>>>> common, once you push the commit for spice-protocol, the commit for
>>>>>>> spice-
>>>>>>> common should point to it. The same with spice and spice-gtk in relation
>>>>>>> to
>>>>>>> spice-common.
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> El Jueves, 13 de noviembre de 2014 16:04:00 Christophe Fergeau escribió:
>>>>>>>> Hey,
>>>>>>>>
>>>>>>>> On Fri, Nov 07, 2014 at 10:17:11AM +0100, Javier Celaya wrote:
>>>>>>>>> Hello
>>>>>>>>>
>>>>>>>>> I resend the patch for the spice repository. I just realized I forgot
>>>>>>>>> to
>>>>>>>>> remove a debug message from red_worker.c, sorry.
>>>>>>>> Thanks for the updated patches, they look good to me. There are 2 blank
>>>>>>>> lines at the end of lz4_encoder.[ch] which should be removed.
>>>>>>>> Can you resend these patches generated with git-format-patch so that
>>>>>>>> they contain a commit log, and an author name/address? Then they can be
>>>>>>>> pushed upstream.
>>>>>>>>
>>>>>>>> Christophe
>>>>>>> _______________________________________________
>>>>>>> Spice-devel mailing list
>>>>>>> Spice-devel at lists.freedesktop.org
>>>>>>> http://lists.freedesktop.org/mailman/listinfo/spice-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4297 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150109/cdc90c75/attachment.bin>


More information about the Spice-devel mailing list