00:49 <+bridge> [ddnet] it is possible to recover a deleted folder from github D: 00:56 <+bridge> [ddnet] a folder being a normal folder that is still in the git history or did you delete the repository @Nouaa ? 00:56 <+bridge> [ddnet] yes only the repository 00:56 <+bridge> [ddnet] ?xd 00:57 <+bridge> [ddnet] wat did you delete 00:57 <+bridge> [ddnet] https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/restoring-a-deleted-repository 01:09 <+bridge> [ddnet] thx, i wont even know this way 😄 01:09 <+bridge> [ddnet] thx, i dont even know this way 😄 02:14 < ***> Buffer Playback... 02:14 <+bridge> [02:06:57] [ddnet] That's why i never update my client it is always painful to see those changes 02:14 <+bridge> [02:14:43] [ddnet] this is why ppl should think before talking 02:14 < ***> Playback Complete. 02:19 < ***> Buffer Playback... 02:19 <+bridge> [02:19:43] [ddnet] this is why you dont update late 02:19 < ***> Playback Complete. 02:19 <+bridge> [ddnet] people were explaining this all the time when the update first came out 02:29 <+bridge> [ddnet] Ikr guess is my fault 02:29 <+bridge> [ddnet] btw fakeskin 02:34 <+bridge> [ddnet] u 13:31 <+bridge> [ddnet] :troll: 13:34 <+bridge> [ddnet] 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. 13:34 <+bridge> [ddnet] 13:34 <+bridge> [ddnet] 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` 13:34 <+bridge> [ddnet] 13:34 <+bridge> [ddnet] 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`. 13:34 <+bridge> [ddnet] 13:34 <+bridge> [ddnet] 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) 13:35 <+bridge> [ddnet] Two identical requests don't reliably trigger it, so it's not easy to debug at all 13:38 <+bridge> [ddnet] ah php 13:38 <+bridge> [ddnet] i only know u can increase the script size, but if its using so much mem its prob a bug 13:38 <+bridge> [ddnet] idk how to help u i suck at php 13:39 <+bridge> [ddnet] i didnt know u are bep 13:39 <+bridge> [ddnet] hi bep 13:39 <+bridge> [ddnet] :justatest: 13:39 <+bridge> [ddnet] 13:39 <+bridge> [ddnet] weeb 13:40 <+bridge> [ddnet] also its rly hard to help u with what u sent 13:40 <+bridge> [ddnet] 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 13:41 <+bridge> [ddnet] oh its public 13:41 <+bridge> [ddnet] 😄 13:41 <+bridge> [ddnet] xd 13:41 <+bridge> [ddnet] oh regex 13:41 <+bridge> [ddnet] is this some kind of regex ddos 13:41 <+bridge> [ddnet] xd 13:43 <+bridge> [ddnet] 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 13:44 <+bridge> [ddnet] i love reading php 13:44 <+bridge> [ddnet] "explode" 13:44 <+bridge> [ddnet] yea explode 13:44 <+bridge> [ddnet] makes sense 13:44 <+bridge> [ddnet] and functions that use snakecase and others that just simply dont 13:44 <+bridge> [ddnet] php ftw 13:46 <+bridge> [ddnet] hm, php is fairly consistent in it's snake_case for stdlib functions, and PascalCase for it's oop interfaces 13:46 <+bridge> [ddnet] strlen 13:46 <+bridge> [ddnet] why not str_len 13:46 <+bridge> [ddnet] u have 13:46 <+bridge> [ddnet] str_replace 13:47 <+bridge> [ddnet] basename 13:47 <+bridge> [ddnet] why not base_name 13:47 <+bridge> [ddnet] realpath why not real_path 13:47 <+bridge> [ddnet] they dont follow it 13:47 <+bridge> [ddnet] strpost 13:47 <+bridge> [ddnet] strpos* 13:47 <+bridge> [ddnet] Ah, libc functions retain their name and there is a subset of libc derived functions that are named like that 😄 13:48 <+bridge> [ddnet] anyway, less spam, more longer posts so my poor question doesn't get buried 13:49 <+bridge> [ddnet] @Learath2 hav u tried preg_replace 13:49 <+bridge> [ddnet] instead of `str_replace`? I could but I don't see what that's supposed to tackle 13:49 <+bridge> [ddnet] ah actually preg_replace is worse 13:50 <+bridge> [ddnet] is the file rly big? 13:51 <+bridge> [ddnet] if banfile is ending up in `escapetw` it' 13:51 <+bridge> [ddnet] it's about 21K 13:51 <+bridge> [ddnet] (but if the code is executed properly it should never end up in there) 13:52 <+bridge> [ddnet] idk then 13:52 <+bridge> [ddnet] can u even debug php code 13:52 <+bridge> [ddnet] xd 13:52 <+bridge> [ddnet] or profile 13:53 <+bridge> [ddnet] Sure, xdebug, but I can't debug a problem that randomly happens 13:55 <+bridge> [ddnet] this is my recommendation for you 13:55 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/866649472313851934/1llubk4wl6b71.png 13:55 <+bridge> [ddnet] 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 13:56 <+bridge> [ddnet] maybe change memory_limit 13:56 <+bridge> [ddnet] on php.ini 13:56 <+bridge> [ddnet] if it doesnt crash maybe its easier to debug 13:57 <+bridge> [ddnet] use memory_get_usage to check if its over 67mb maybe xd 13:57 <+bridge> [ddnet] This is me last night after spending 2 hours injecting a proxy connector into twilight to find a ratelimiter bug 13:58 <+bridge> [ddnet] :monkaS: 13:59 <+bridge> [ddnet] @Learath2 13:59 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/866650473401286697/xg3lkvr29o671.png 14:00 <+bridge> [ddnet] > If Java had true garbage collection, most programs would delete themselves upon execution. – Robert Sewell 14:00 <+bridge> [ddnet] lmao 14:00 <+bridge> [ddnet] http://harmful.cat-v.org/software/java 14:00 <+bridge> [ddnet] I would take rust over both so this animegirl is not an accurate representation of me 14:00 <+bridge> [ddnet] more quotes here 14:01 <+bridge> [ddnet] Now make is C or C++ and it'd be a fairly accuratd conversation between me and you 14:01 <+bridge> [ddnet] ye xD 14:01 <+bridge> [ddnet] s\/is/it/ 14:02 <+bridge> [ddnet] ^^ requesting more phppl 14:02 <+bridge> [ddnet] @NeXus i think u use php 14:02 <+bridge> [ddnet] ur the only last one standing 14:03 <+bridge> [ddnet] whats up 14:03 <+bridge> [ddnet] read this 14:03 <+bridge> [ddnet] maybe u know 14:03 <+bridge> [ddnet] https://github.com/ddnet/ddnet-web/blob/master/www/ban.php 14:03 <+bridge> [ddnet] here the file 14:04 <+bridge> [ddnet] @Learath2 i bet rewriting it in rust would solve it 14:04 <+bridge> [ddnet] 😉 14:04 <+bridge> [ddnet] :monkalaugh: 14:05 <+bridge> [ddnet] If you want to increase your allowed memory size, configure your `php.ini` file and set I think `memory_limit` to something higher 14:05 <+bridge> [ddnet] If you have a memory leak or smth I'll have a look at this take 14:05 <+bridge> [ddnet] code 14:05 <+bridge> [ddnet] It's trying to allocate 67 megabytes, whatever it wants to do it's an insanity 14:06 <+bridge> [ddnet] 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 14:07 <+bridge> [ddnet] for more context escapetw only ever works with single lines 14:08 <+bridge> [ddnet] `exec("sudo -n -u teeworlds ". $twdir. "execute-all.sh ". escapeshellarg($run). " > /dev/null 2>&1 &", $out, $rc);` 14:08 <+bridge> [ddnet] what does this bash script do 14:09 <+bridge> [ddnet] it will ssh to all servers and echo the line given to it to a fifo 14:09 <+bridge> [ddnet] @Learath2 its not possible u ever pass a empty string to replace right 14:09 <+bridge> [ddnet] https://bugs.php.net/bug.php?id=79951 14:10 <+bridge> [ddnet] its prob not this xd 14:10 <+bridge> [ddnet] Oh that's intriguing, let me take a look 14:11 <+bridge> [ddnet] If you are interested ^^ it's fairly simple in what it does though 14:12 <+bridge> [ddnet] This probably isnt the problem 14:12 <+bridge> [ddnet] (i have stupid question about mem_copy, if someone wants to answer, ping me pls xd 14:12 <+bridge> [ddnet] 14:12 <+bridge> [ddnet] there are so many mem_copys in tw code with references inside, isn't dest = source more idiomatic for cpp?) 14:13 <+bridge> [ddnet] @Learath2 maybe try using strtr 14:13 <+bridge> [ddnet] Well teeworlds is more C than C++, so `mem_copy`s are mostly a legacy 14:14 <+bridge> [ddnet] For POD types it's safe to do a byte by byte copy, so it's safe 14:14 <+bridge> [ddnet] huh, thanks for answer 14:14 <+bridge> [ddnet] is byte by byte copy called bitwise copy 14:15 <+bridge> [ddnet] ye 14:15 <+bridge> [ddnet] yep, but the smallest addressable thing is a byte, so I thought I'd use that 😄 14:16 <+bridge> [ddnet] i learnt the name bitwise copy from rust 14:16 <+bridge> [ddnet] xd 14:16 <+bridge> [ddnet] I don't see an empty string ever making it to escapetw so that's not it 14:17 <+bridge> [ddnet] also this thing makes me feel curious 14:17 <+bridge> [ddnet] ```cpp 14:17 <+bridge> [ddnet] // it is not allowed to aim in the center 14:17 <+bridge> [ddnet] if(m_LatestInput->m_TargetX == 0 && m_LatestInput->m_TargetY == 0) 14:17 <+bridge> [ddnet] m_LatestInput->m_TargetY = -1;``` 14:17 <+bridge> [ddnet] 14:17 <+bridge> [ddnet] why? xd 14:17 <+bridge> [ddnet] Though I wonder if it is somehow an uninitialized member in one of my classes 14:17 <+bridge> [ddnet] It'd make the angle undefined 14:17 <+bridge> [ddnet] uh oh 14:17 <+bridge> [ddnet] learath pro 14:17 <+bridge> [ddnet] so fast 14:18 <+bridge> [ddnet] tw wizard 14:18 <+bridge> [ddnet] :monkaS: 14:18 <+bridge> [ddnet] thanks a lot again :p 14:18 <+bridge> [ddnet] 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 14:20 <+bridge> [ddnet] 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? 14:20 <+bridge> [ddnet] @Learath2 Try to use the 4th parameter of `str_replace` and set it to 1 14:21 <+bridge> [ddnet] Eh, that won't work, I need to escape all instances of these in the string, not just one 14:22 <+bridge> [ddnet] Maybe you have some sort of recursion of each instance, when replacing \\ with even more \\ 14:22 <+bridge> [ddnet] Yeah that's what I was thinking too, but wouldn't that be reproducible? 14:23 <+bridge> [ddnet] Hm, I'll try a couple things, that sounds feasible 14:24 <+bridge> [ddnet] ok good luck 14:25 <+bridge> [ddnet] Hm, that could indeed be it, I wonder why it's `might` 14:25 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/866656889790398524/lol.png 14:29 <+bridge> [ddnet] Hm, this doesn't apply to me since I'm not doing multiple replacements 15:05 <+bridge> [ddnet] Okay, I couldn't figure it out so I added an error handler so next time it happens I have a backtrace 19:32 <+bridge> [ddnet] @Learath2 👀 19:32 <+bridge> [ddnet] it literally was in the wrong folder, nothing interesting 😄 19:32 <+bridge> [ddnet] :monkaS: 19:36 <+bridge> [ddnet] I get a 404 for the ban.php link 20:10 <+bridge> [ddnet] Today I learned a rust trick, you can force a reborrow of `t` using `&mut *t` 22:02 <+bridge> [ddnet] @heinrich5991 have a minute for my incompetence? 22:04 <+bridge> [ddnet] what is it? 22:05 <+bridge> [ddnet] and why u want that 22:05 <+bridge> [ddnet] https://paste.pr0.tips/0x?rust clippy is confident I can elide `'a`, I don't see how 22:06 <+bridge> [ddnet] doesn't look like you can, according to the rules I know 22:06 <+bridge> [ddnet] @Learath2 try &'_ 22:07 <+bridge> [ddnet] https://paste.pr0.tips/B2?rust this, took a while to figure out what was even going wrong 😄 22:07 <+bridge> [ddnet] Already tried it, eventhough I knew it wouldn't work 22:08 <+bridge> [ddnet] eh, I guess clippy bug since the ppl in the rust discord don't seem to see it either 22:29 <+bridge> [ddnet] Almost wrote `reboot` on ger2, a lot of ppl would be a lot of mad 22:29 <+bridge> [ddnet] :monkalaugh: 22:30 <+bridge> [ddnet] do it