Comments (8)
Calling tgl_timer_insert multiple times shouldn't be an issue.
What the function appears to do is to iterate through all running queries to restart them. The reason why the function shows up multiple times is that tree.h implements it as a recursive function (https://github.com/vysheng/tgl/blob/master/tree.h#L133-L147).
from tgl.
There's something off about this. The issue appears to be caused by an assertion assert (-1 == t->fd), which is an assertion I'm not able to find anywhere in the code.
from tgl.
Of course it is an issue:
- instantiation
- call with insert, internal fd is set to
- another call with insert, internal fd is set to
- call to free, internal freeing stops the timer, but NOT the one.
- timer fires, doing a use-after-free
from tgl.
That assertion is written by me.
I'm making the assumption that when insert is called, there should be no other timer currently being "ticking"
from tgl.
You are right, of course it shouldn't be called multiple times on the same timer_alarm struct.
from tgl.
I've debugged this issue and printed a stacktrace for every time timer insert is called, while using the same assertion as Ben.
https://gist.github.com/majn/0c69dd738d7690222489
Apparently, tgl_do_get_difference is executed for the first time and starts the regular alarm timeout of (6 seconds) and then when work_new_session_created is received, the second timeout (0.001s) is called on the same struct.
@vysheng Is this behavior by design and the timer implementation is supposed to cancel all pending timeouts on its own?
from tgl.
One more thing:
work_new_session_created appears to happen every time the tgl is started, restarting all running queries on every restart.
from tgl.
From @vysheng: The intended meaning of that was precisely like we assumed.
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.