-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata format adds complexity for little benefits #23
Comments
FWIW, I agree. |
I agree that having a specific binary format metadata file adds unnecessary complexity. If I may, I'd like to suggest an alternate approach from the perspective of a new user. Is it necessary to have That I am aware of, Why not instead embed the preparation/validation logic of A couple drawbacks I see with this approach:
|
Yes, the metadata file is based on the description file, which is not only human readable, but written by-hand. That file is fed to As a matter of fact, in the test suite, the metadata generation process is even longer:
If we switch from binary to text files, we still have to record the build-id and the digest into the metadata. There are at least two ways to do it:
One of the goals of having the build-id and digest in the metadata file is to make sure that the metadata file and the live patch DSO match. Suppose you have a metadata file, but somehow you got the wrong live patch DSO. In this case, In other words, I think That said, I still think we shouldn't get rid of
Good point, but, for now, we don't care too much about it, specially because libpulp has never been released. :) |
Good to know.
This makes sense. Easy to overlook the complexity involved in the process of generating and applying a live patch!
Can you elaborate? From what I understand, it makes sense for
Sure. Easier on the user to have a tool do it for them. Once I submit PR's for #25 and #26, I'd be happy to work on this! |
What I mean is that So,
:))))) |
Metadata is now integrated into the livepatch container (.so). I think now getting rid of the binary metadata format is pointless: we now need a dump tool more than ever, and the binary format keep size of things determined, so we do not need to carry the size of the metadata when it is loaded in memory. What you guys think? |
I agree to that, though even binary meta-data can be complicated and not so complicated :-) Our metadata now (in the .so) has a determined size (from the section it's contained in), so, e.g. all strings therein could be null-terminated as usual in C, not size-prefixed. Overreads can be avoided as the overall size is known. And, of course, the meta-data in the .so could also just as well be text based as well, so that the "dump" tool would be trivial: |
The thing is that metadata extraction is not done in libpulp.so: it is now done in ulp and then ptraced to libpulp.so into a statically allocated buffer. We do that because we do not want to carry libelf with libpulp. We only check if the metadata will fit into the buffer on ulp side (buffer is 512k, which is plenty atm), and since the metadata itself has the size of it, we do not have to worry about passing its size around. |
Currently, the metadata file is in binary format.
Strings in the metadata file are not null-terminated and there are no lines, thus no end-of-line characters (or sequences of characters). As far as I can tell, the only benefit that it adds relies on the fact that end-of-line characters vary across platforms (or even across text editors), which could lead to broken parsing if Libpulp did not handle varying styles of newlines properly.
The benefit comes at a cost in complexity:
dump
tool, which adds maintenance burden;Apart from that, the
packer
tool, which is responsible for recording build-id and checksum information into the metadata file, also converts from text to binary format. If a text format was used, the packer tool would still be useful to handle build-ids and checksums, however it would allow users to handle them manually, with a regular text editor (on quick tests, for example).In my opinion, the drawbacks of the binary format outweigh the benefits.
The text was updated successfully, but these errors were encountered: