-
Notifications
You must be signed in to change notification settings - Fork 225
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
Works only on Little Endian #58
Comments
I don't get it. @mcepi: Can you upload the file For the record: The shortest way to reproduce this bug is For reference, the output of generate should start like this (on my branch
However, for the reporter it starts like this (first line not available yet, he ran the version without that line):
|
Maybe he has big-endian platform? |
Looks like s390 is big-endian. Probably there are many problems with big-endian platforms. |
That is my experience ... of course, nobody sane runs libpurple-driven anything on s390, but building it there shows a ton of crazy bugs, which would otherwise were ignored (not mentioning that it is 31-bit architecture). |
1869966964 in |
@vysheng: Why? tl-parser does a lot of parsing, and shouldn't care about the architecture it's running on. |
@BenWiederhake In tl-parser there is only one place (as I see now). It is serializing data. (And unserializing in generate). It's rather easy to fix. In tgl there are at least places that serialize/deserialize data from/to sockets. It's also not too hard to fix. But I'm not sure, that I don't use pointer casts, that are invalid in big-endian platforms. Like casting (long long *) to (int *). It needs to be checked. |
Is there any change (it is 481689e now) in https://gist.github.com/mcepl/bd8585ca30cbfda6adff ? |
How do you mean? Why do you expect a difference? What changed? The latest revision of your gist still shows the same error, with the same message |
I was not sure whether it was the same commit. Sorry for bothering. |
@mcepi: No problem XD Also, can you upload the file auto/scheme.tlo somewhere? I asked you before, but it seems my request got drowned out. |
Aargh, I was looking at
Vitaly, I am really thankful for libtgl, but this was a bad idea. It's the textbook example of what not to do. Literally! I'll change the |
You can change tlo format. But TL uses almost the same serialization and there you'll need to make it compatible. |
It's rather easy to fix However, it will be very troublesome to fix the main {en,de}coding, which assumes Little Endian everywhere. Here's an incomplete attempt that doesn't build but is hopefully at least on the right track. |
Here https://mcepl.fedorapeople.org/tmp/tgl.tar.gz is the whole build tree. |
Originally reported at majn/telegram-purple#98
All earlier discussion see there.
The text was updated successfully, but these errors were encountered: