Skip to content
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

Call threaddata() only once before each loop #1512

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented Nov 30, 2023

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:
Call threaddata() only once before each loop

Additional description (if needed):
found with ltrace

Test cases demonstrating functionality (if applicable):
ltrace ./eggdrop -t BotA.conf
Before:

[...]
time(0)                                                                        = 1701312730
Tcl_GetThreadData(0x56237a204b88, 40, 15, 0)                                   = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 0, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 1, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 2, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 3, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 4, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 5, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 6, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 7, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 8, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 9, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 10, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 11, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 12, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 13, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 14, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 15, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 16, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 17, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 18, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 19, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 0x7fff6a24d5ac, 0x56237b51d480)          = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 0, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 1, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 2, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 3, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 4, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 5, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 6, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 7, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 8, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 9, 0x56237b5f47b0)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 10, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 11, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 12, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 13, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 14, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 15, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 16, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 17, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 18, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 19, 0x56237b5f47b0)                      = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 3, 0x56237b51d480)                       = 0x56237b51d480
Tcl_GetThreadData(0x56237a204b88, 40, 0x56237b5f47b0, 20)                      = 0x56237b51d480
select[...]

After:

[...]
time(0)                                                                        = 1701312776
Tcl_GetThreadData(0x556d578bfb88, 40, 0x556d578b8be0, 0)                       = 0x556d582dc480
Tcl_GetThreadData(0x556d578bfb88, 40, 0x7fffa675be8c, 0x556d583b37b0)          = 0x556d582dc480
Tcl_GetThreadData(0x556d578bfb88, 40, 0x556d583b37b0, 20)                      = 0x556d582dc480
select[...]

@michaelortmann michaelortmann changed the title Call threaddata() once before loop Call threaddata() once before each loop Nov 30, 2023
@michaelortmann michaelortmann changed the title Call threaddata() once before each loop Call threaddata() only once before each loop Nov 30, 2023
@vanosg vanosg added this to the v1.10.0 milestone Dec 30, 2023
@vanosg vanosg merged commit c45924c into eggheads:develop Dec 30, 2023
1 check passed
@michaelortmann michaelortmann deleted the mainloop.threaddata branch January 3, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants