Comments (15)
I don't get it. read_types
reads garbage for some values and then reads something correct again.
@mcepi: Can you upload the file auto/scheme.tlo
somewhere? That file is platform-dependent, so one can't just copy it from machine to machine, but thankfulyl the format is simple enough to inspect it with a hex-editor.
For the record: The shortest way to reproduce this bug is ./configure && make auto/auto-skip.h
(argument optional, but forces make to build only the failing target).
For reference, the output of generate should start like this (on my branch tmp/debug-tgp-98
):
Found 157 types
read_types: name=1885708031, id=#, print_id=#, custructors_num=0
read_types: name=3100684255, id=AccountDaysTTL, print_id=account_days_t_t_l, custructors_num=1
However, for the reporter it starts like this (first line not available yet, he ran the version without that line):
read_types: name=1885708031, id=, print_id=, custructors_num=0
read_types: name=3100684255, id=, print_id=, custructors_num=1869966964
from tgl.
Maybe he has big-endian platform?
from tgl.
Looks like s390 is big-endian. Probably there are many problems with big-endian platforms.
from tgl.
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).
from tgl.
1869966964 in 0x6F756E74
in hex, or ount
in ASCII, which suspiciously looks like the "ount" in either "AccountDaysTTL" or "account_days_t_t_l".
from tgl.
@vysheng: Why? tl-parser does a lot of parsing, and shouldn't care about the architecture it's running on.
from tgl.
@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.
from tgl.
Is there any change (it is 481689e now) in https://gist.github.com/mcepl/bd8585ca30cbfda6adff ?
from tgl.
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
from tgl.
I was not sure whether it was the same commit. Sorry for bothering.
from tgl.
@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.
from tgl.
Aargh, I was looking at get_int
and wint
all the time, assuming that get_string
would use it to read/write the length. I mean, get_int
is used everywhere ... except in the one place where it makes sense most. Instead:
int l = *(unsigned char *)buf_ptr;
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 .tlo
format (there's no compatibility and no need for it, so changing it should be okay), because get_int
already is endian-correct. I'll look out for more issues like this.
from tgl.
You can change tlo format. But TL uses almost the same serialization and there you'll need to make it compatible.
from tgl.
It's rather easy to fix tl-parser
and generate
, which was pleasantly easy: vysheng/tl-parser#5
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.
from tgl.
Here https://mcepl.fedorapeople.org/tmp/tgl.tar.gz is the whole build tree.
from tgl.
Related Issues (20)
- Command line msg command with secure chats HOT 1
- abrupt abort via spectrum/telegram-purple on arm7l HOT 16
- Strange "was online" time when changing status from online
- 2ASHIII
- Escape " and ' in channel_names
- Could you add layers description in Readme
- Compilation error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’ HOT 10
- force add contact does not work
- view last channel post without join channel
- How to implement method for add new contact or import Contact in golang( or any other language)
- nullptr derefence in the source .\tgl-master\queries.c HOT 1
- FLOOD_WAIT_* not handled well
- eventlib issues HOT 1
- compile error: queries.c: In function ‘_tgl_do_send_photo’ HOT 5
- tgl/queries.c:470: tglq_query_result: Assertion `0' failed on Downloading AUDIO FILES HOT 1
- Problem secret chat message to Iphone
- tgl/queries.c:470: tglq_query_result: Assertion `0' failed HOT 8
- New release tag?
- tl-parser/tl-parser.c:1907:9: note: 'sprintf' output between 2 and 21 bytes into a destination of size 20 HOT 1
- tgl/crypto/rsa_pem_openssl.c:49:37: error: invalid use of incomplete typedef ‘RSA’ {aka ‘struct rsa_st’} HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tgl.