This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author miurahr
Recipients malin, miurahr
Date 2020-07-11.07:19:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594451989.18.0.674730192117.issue41210@roundup.psfhosted.org>
In-reply-to
Content
Here is a BCJ only CFFI test project.
https://github.com/miurahr/bcj-cffi

It imports two bcj_x86 C sources, one is from liblzma (src/xz_bcj_x86.c) taht is bind with python's lzma module, and the other is from xz-embbed project for linux kernel.(src/xz_simple_bcj.c)

We can observe that

1. it has an interface which overwrite buffer
2. it returns good resulted buffer (digest assertion) in both case
3. it returns 4 bytes less size than expected.

for 3, it is because return value  of BCJ is defined such as

```
	size -= 4;
	for (i = 0; i < size; ++i) {...}
        return i;
```
and  variable i sometimes increment 4 bytes when target sequence is found and processed.

It may be natural that a size value returned from BCJ filter is often 4 bytes smaller than actual.
History
Date User Action Args
2020-07-11 07:19:49miurahrsetrecipients: + miurahr, malin
2020-07-11 07:19:49miurahrsetmessageid: <1594451989.18.0.674730192117.issue41210@roundup.psfhosted.org>
2020-07-11 07:19:49miurahrlinkissue41210 messages
2020-07-11 07:19:49miurahrcreate