Zhibin Li's GSoC status report - #6 of #13

Zhibin Li 08826794brmt at gmail.com
Tue Jun 26 08:49:17 UTC 2018


Hi,

This week I've finished mpersifying the decoder of struct xfs_dqstats, see
[0].
I also added tests quotactl-xfs-success and quotactl-xfs-success-v. This
time
they could all fetch the struct correctly in multiple personalities and the
tests
passed.
And I've discussed a little bit about mpers and attribute packed with eSyr
on IRC.
Besides mpersifying the decoder, I tried just adding ATTRIBUTE_PACKED to
struct fs_qfilestat (see [1]) and then I re-run the tests and they all
passed.
I tried to figure out how or why the tests passed considering it will break
alignment on 64 bit.

Before all these changes, quotactl-xfs-success.test failed on tests-m32
because
the unmpersified decoder tries to fetch struct xfs_dqstats with alignment
on 64 bit
(because the my env is 64 bit) which is 80 bytes. In this specific test
TAIL_ALLOC_OBJECT_CONST_PTR is used so on 32 bit struct fs_quota_stat (it's
a little
confused since it's called xfs_dqstats in quota.c) just gets 68 bytes at
the end of
a mapped memory region, which means fetching 80 bytes will fail with
"strace: umoven: short read (68 < 80)".

After adding ATTRIBUTE_PACKED to struct fs_qfilestat, it seems to be a
coincidence
that both on 32 and 64 bit struct xfs_dqstats are 72 bytes so fetching it
will
succeed (I'm not so sure whether it's a coincidence or it's designed in
this way).

Anyway, I realize it's not the right way or at least not a good way to fix
this
decoder.

I will continue to revise the code I've wrriten and perhaps I should pay
part of
my attention to other tests, too. I will learn things about net and socket
next.

[0]
https://github.com/haoyouab/strace/commit/5d910b497b9ac079a6d5db48140e0db899373973
[1]
https://github.com/haoyouab/strace/commit/d3035a77a78c53b058ce3da3469eec9ed74dff45

Zhibin Li
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20180626/79bc9130/attachment.html>


More information about the Strace-devel mailing list