[ VW 7.4 ] CRC failure in the GZipWriteStream

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[ VW 7.4 ] CRC failure in the GZipWriteStream

Mark Pirogovsky-3
Hi,

I do use the GZipWriteStream to save compressed files.

I came across strange anomaly in the method:

cCrc32: crc buffer: collection length: position

if the collection is greater in size then the position  -- method fails.

I patched it as follow

GZipWriteStream>>writeBuffer: flush
        position > 0
                ifTrue:
                        [crc := [interface cCrc32: crc buffer: collection length:
position] on: ExternalAccessFailed do: [:ex | ex return: (
interface cCrc32: crc buffer: (collection copyFrom: 1
to: position)length: position)]].
        ^super writeBuffer: flush

        "@__markp 10/05/2007 01:16:10 pm"

But I am not sure if I am not fixing symptoms instead of problem.

Does anybody have any insight into this area ?

--Mark

Reply | Threaded
Open this post in threaded view
|

Re: [ VW 7.4 ] CRC failure in the GZipWriteStream

Reinout Heeck-2
Hi Mark,

There is something in the dllcc interface that goes wrong. The
translation of a string argument (collection) goes wrong in the vm. If
you use "interface cCrc32: crc buffer: collection fixedHeapAddress
length: position" everywhere it is called it works fine.
There will be a more elaborate post coming soon because flushing the
stream will break it for further use.

Regards,

Cham


Mark Pirogovsky wrote:

> Hi,
>
> I do use the GZipWriteStream to save compressed files.
>
> I came across strange anomaly in the method:
>
> cCrc32: crc buffer: collection length: position
>
> if the collection is greater in size then the position  -- method fails.
>
> I patched it as follow
>
> GZipWriteStream>>writeBuffer: flush
>     position > 0
>         ifTrue:
>             [crc := [interface cCrc32: crc buffer: collection length:
> position]                             on: ExternalAccessFailed do:
> [:ex |        ex return: (                    
> interface                                     cCrc32:
> crc                                    buffer: (collection copyFrom: 1
> to: position)length: position)]].
>     ^super writeBuffer: flush
>
>     "@__markp    10/05/2007 01:16:10 pm"
>
> But I am not sure if I am not fixing symptoms instead of problem.
>
> Does anybody have any insight into this area ?
>
> --Mark
>
>