Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2021-07-19 00:00:00Z and 2021-07-20 00:00:00Z
Avatar
Waw we cant change game resolution anymore in the latest version and also we can't check ping number in the server list
00:06
So far we improving rlly gud !
00:06
That's why i never update my client it is always painful to see those changes
Avatar
this is why ppl should think before talking
Avatar
Avatar
Deleted User
Waw we cant change game resolution anymore in the latest version and also we can't check ping number in the server list
Connect to the server and you'll see the ping, it was changed bcs ddosers could get your IP address and send spoofed packages with your IP, which can help them to ddos servers more easily Your resolution can still be changed, send a picture of the graphic settings and we can probably easily fix it
Avatar
this is why you dont update late
00:19
people were explaining this all the time when the update first came out
Avatar
Avatar
plsplsplslol
people were explaining this all the time when the update first came out
Ikr guess is my fault
00:29
btw fakeskin
Avatar
u
Avatar
I tried looking for this bug a week or two ago, it seems to happen randomly and I have this odd feeling that it is a php issue. If any of you are familiar with php it'd be nice to get another pair of eyes on it. Error: "PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108922 bytes) in /var/www/bep/ban.php on line 14 This string is somehow growing to insane sizes and it doesn't always happen, so I could be invoking some ub somewhere and accidentally passing the entire generated file to escapetw. It is a bit of a mess and will be entirely rewritten in the future (it kinda grew organically to accommodate feature requests from mods)
11:35
Two identical requests don't reliably trigger it, so it's not easy to debug at all
Avatar
ah php
11:38
i only know u can increase the script size, but if its using so much mem its prob a bug
11:38
idk how to help u i suck at php
11:39
justatest
11:40
also its rly hard to help u with what u sent
Avatar
Avatar
Ryozuki
idk how to help u i suck at php
Maybe just give it a read going backwards from line 14? I've looked at it so much I might be blind to simple mistakes now
Avatar
oh its public
11:41
oh regex
11:41
is this some kind of regex ddos
11:41
xd
Avatar
I considered that but 2 problems with that, the regex has no backtracking in it, and the regex is applied to the banfile generated if it was catastrophic backtracking it would always happen since the file doesn't change
Avatar
i love reading php
11:44
"explode"
11:44
yea explode
11:44
makes sense
11:44
and functions that use snakecase and others that just simply dont
11:44
php ftw
Avatar
hm, php is fairly consistent in it's snake_case for stdlib functions, and PascalCase for it's oop interfaces
Avatar
strlen
11:46
why not str_len
11:46
u have
11:46
str_replace
11:47
basename
11:47
why not base_name
11:47
realpath why not real_path
11:47
they dont follow it
11:47
strpost
11:47
strpos*
Avatar
Ah, libc functions retain their name and there is a subset of libc derived functions that are named like that 😄
11:48
anyway, less spam, more longer posts so my poor question doesn't get buried
Avatar
@Learath2 hav u tried preg_replace
Avatar
instead of str_replace? I could but I don't see what that's supposed to tackle
Avatar
ah actually preg_replace is worse
11:50
is the file rly big?
Avatar
if banfile is ending up in escapetw it'
11:51
it's about 21K
justatest 1
11:51
(but if the code is executed properly it should never end up in there)
Avatar
idk then
11:52
can u even debug php code
11:52
xd
11:52
or profile
Avatar
Sure, xdebug, but I can't debug a problem that randomly happens
Avatar
this is my recommendation for you
Avatar
I could try to log everything that ever ends up in escapetw, but it's trying to allocate 67MB, cant exactly output that to the error log :D
Avatar
maybe change memory_limit
11:56
on php.ini
11:56
if it doesnt crash maybe its easier to debug
11:57
use memory_get_usage to check if its over 67mb maybe xd
Avatar
Avatar
Ryozuki
this is my recommendation for you
This is me last night after spending 2 hours injecting a proxy connector into twilight to find a ratelimiter bug
11:59
@Learath2
12:00
If Java had true garbage collection, most programs would delete themselves upon execution. – Robert Sewell
justatest 1
monkalaugh 1
12:00
lmao
Avatar
I would take rust over both so this animegirl is not an accurate representation of me
Avatar
more quotes here
Avatar
Now make is C or C++ and it'd be a fairly accuratd conversation between me and you
Avatar
s/is/it/
Avatar
Avatar
Learath2
I tried looking for this bug a week or two ago, it seems to happen randomly and I have this odd feeling that it is a php issue. If any of you are familiar with php it'd be nice to get another pair of eyes on it. Error: "PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108922 bytes) in /var/www/bep/ban.php on line 14 This string is somehow growing to insane sizes and it doesn't always happen, so I could be invoking some ub somewhere and accidentally passing the entire generated file to escapetw. It is a bit of a mess and will be entirely rewritten in the future (it kinda grew organically to accommodate feature requests from mods)
^^ requesting more phppl
Avatar
@NeXus i think u use php
12:02
ur the only last one standing
Avatar
whats up
Avatar
Avatar
Learath2
I tried looking for this bug a week or two ago, it seems to happen randomly and I have this odd feeling that it is a php issue. If any of you are familiar with php it'd be nice to get another pair of eyes on it. Error: "PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108922 bytes) in /var/www/bep/ban.php on line 14 This string is somehow growing to insane sizes and it doesn't always happen, so I could be invoking some ub somewhere and accidentally passing the entire generated file to escapetw. It is a bit of a mess and will be entirely rewritten in the future (it kinda grew organically to accommodate feature requests from mods)
read this
12:03
maybe u know
12:03
here the file
12:04
@Learath2 i bet rewriting it in rust would solve it
12:04
😉
12:04
monkalaugh
Avatar
If you want to increase your allowed memory size, configure your php.ini file and set I think memory_limit to something higher
12:05
If you have a memory leak or smth I'll have a look at this take
12:05
code
Avatar
It's trying to allocate 67 megabytes, whatever it wants to do it's an insanity
12:06
fwiw it's probably a good thing that it dies in escapetw, I don't want to know what would happen if I executed a 67 megabyte ssh line
12:07
for more context escapetw only ever works with single lines
Avatar
exec("sudo -n -u teeworlds ". $twdir. "execute-all.sh ". escapeshellarg($run). " > /dev/null 2>&1 &", $out, $rc); what does this bash script do
Avatar
it will ssh to all servers and echo the line given to it to a fifo
Avatar
@Learath2 its not possible u ever pass a empty string to replace right
12:10
its prob not this xd
Avatar
Oh that's intriguing, let me take a look
Avatar
If you are interested ^^ it's fairly simple in what it does though
Avatar
This probably isnt the problem
Avatar
(i have stupid question about mem_copy, if someone wants to answer, ping me pls xd there are so many mem_copys in tw code with references inside, isn't dest = source more idiomatic for cpp?)
Avatar
@Learath2 maybe try using strtr
Avatar
Avatar
gerdoe
(i have stupid question about mem_copy, if someone wants to answer, ping me pls xd there are so many mem_copys in tw code with references inside, isn't dest = source more idiomatic for cpp?)
Well teeworlds is more C than C++, so mem_copys are mostly a legacy
12:14
For POD types it's safe to do a byte by byte copy, so it's safe
Avatar
huh, thanks for answer
Avatar
is byte by byte copy called bitwise copy
12:15
ye
Avatar
Avatar
Ryozuki
is byte by byte copy called bitwise copy
yep, but the smallest addressable thing is a byte, so I thought I'd use that 😄
Avatar
i learnt the name bitwise copy from rust
12:16
xd
Avatar
I don't see an empty string ever making it to escapetw so that's not it
Avatar
also this thing makes me feel curious // it is not allowed to aim in the center if(m_LatestInput->m_TargetX == 0 && m_LatestInput->m_TargetY == 0) m_LatestInput->m_TargetY = -1; why? xd
Avatar
Though I wonder if it is somehow an uninitialized member in one of my classes
Avatar
Avatar
gerdoe
also this thing makes me feel curious // it is not allowed to aim in the center if(m_LatestInput->m_TargetX == 0 && m_LatestInput->m_TargetY == 0) m_LatestInput->m_TargetY = -1; why? xd
It'd make the angle undefined
Avatar
learath pro
12:17
so fast
Avatar
tw wizard
Avatar
thanks a lot again :p
Avatar
One could instead define the center to have angle 0, but I guess matricks decided it's safer to just never allow this 0/0 case to happen
Avatar
Avatar
Learath2
Though I wonder if it is somehow an uninitialized member in one of my classes
I really don't see how I can end up with an instance of Ban with uninitialized members though, can I even avoid calling the constructor somehow?
Avatar
@Learath2 Try to use the 4th parameter of str_replace and set it to 1
Avatar
Eh, that won't work, I need to escape all instances of these in the string, not just one
Avatar
Maybe you have some sort of recursion of each instance, when replacing \ with even more \
Avatar
Yeah that's what I was thinking too, but wouldn't that be reproducible?
12:23
Hm, I'll try a couple things, that sounds feasible
Avatar
ok good luck
Avatar
Hm, that could indeed be it, I wonder why it's might
12:29
Hm, this doesn't apply to me since I'm not doing multiple replacements
Avatar
51d2fe8 Add some heavy logging - Learath2
Avatar
Okay, I couldn't figure it out so I added an error handler so next time it happens I have a backtrace
Avatar
959ae14 Wrong place for this - Learath2
Avatar
@Learath2 👀
Avatar
it literally was in the wrong folder, nothing interesting 😄
Avatar
I get a 404 for the ban.php link
Avatar
Today I learned a rust trick, you can force a reborrow of t using &mut *t
Avatar
@fokkonaut said that sending more gameticks made the emoticon smoother, so I tried to look at the clientside render code. Does this fix it? @fokkonaut.

Checklist

  • [x] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physic...
Avatar
@heinrich5991 have a minute for my incompetence?
Avatar
what is it?
Avatar
Avatar
Learath2
Today I learned a rust trick, you can force a reborrow of t using &mut *t
and why u want that
Avatar
Avatar
heinrich5991
what is it?
https://paste.pr0.tips/0x?rust clippy is confident I can elide 'a, I don't see how
Avatar
doesn't look like you can, according to the rules I know
Avatar
@Learath2 try &'_
Avatar
Avatar
Ryozuki
and why u want that
https://paste.pr0.tips/B2?rust this, took a while to figure out what was even going wrong 😄
Avatar
Avatar
Ryozuki
@Learath2 try &'_
Already tried it, eventhough I knew it wouldn't work
Avatar
Avatar
heinrich5991
doesn't look like you can, according to the rules I know
eh, I guess clippy bug since the ppl in the rust discord don't seem to see it either
Avatar
Almost wrote reboot on ger2, a lot of ppl would be a lot of mad
Avatar
please make +/- keybinds for tele/switch
23:32
i beg u
Avatar
good first issue
Avatar
I HATE YOU FOR SAYING THAT
23:33
because you're right
Exported 160 message(s)