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 2020-06-13 00:00:00Z and 2020-06-14 00:00:00Z
Avatar
justabutterflier 2020-06-13 00:08:09Z
@Learath2 what the difference between git bash and git cmd?
Avatar
@justabutterflier git bash uses msys to give you a unix like environment, like all the usual things, grep, sed, awk, rm, cp
07:38
Git cmd just puts git tools in your path before launching cmd
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 07:55:48Z
@Learath2 send brain
07:56
This turned out much uglier then expected but I just don't have it in me to scrap this again. This "mostly" works, what remains is: Map Conversions Whispers Serverinfo
07:56
how to i print the netobj?
07:56
u want the int Type?
Avatar
ᶰ°Konͧsti 2020-06-13 07:57:59Z
ChillerDragon when come to 0.6 again, Shocktsunami soon feelsbadman
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:00:00Z
nice is the rls finally progressing? o.O
08:00
hope ddnet siwtched to 0.7 already when its rlsd
08:00
u unbanned btw?
Avatar
ZillyHuhn: Yeah I want int Type
08:03
I'm assuming it's failing at Type < 0
08:03
if it's not can you find where the unpack is failing?
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:05:10Z
A incomplete port of ddnet client based on 0.6 to teeworlds 0.7 - ZillyWoods/ZillyWoods
08:05
oh wp vscode
08:05
worng link :D
08:05
SnapSize is -3
Avatar
eeeh? really?
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:06:11Z
Avatar
can you add a debug statement on the server to check what it's sending?
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:06:55Z
type=72 btw
Avatar
snapshot.cpp:L638 print Type ID and Size
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:07:22Z
btw how is it that u cant reproduce?
Avatar
That's what's weird
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:07:39Z
is it some mac feature to fix tw snaps?
Avatar
maybe some undefined behaviour that clang decided to fix and gcc decides to optimize around
08:08
it's a common occurance
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:08:16Z
yea probably
Avatar
type 72 sounds insane so I'm guessing some broken size is being sent for previous objects
Avatar
These snapshot issues are extremely annoying to fix
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:10:09Z
here is what the server sends
08:10
wanna ssh into mi machine?
Avatar
can I connect to this server?
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:10:45Z
nah its local
Avatar
Oh actually ssh would be nice
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:10:49Z
i can make a public one if u want
08:11
send ur ssh key
Avatar
the server actually seems to send that 72
Avatar
I hoped it'd happen for me to if I used a release build, but nope 😦
08:50
lets see if gcc makes it happen
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 08:50:28Z
yea ima get some breakfast feel free to hop into my machine later tho
Avatar
oh forgot I build with clang on my vm too
08:55
yeah no, gcc with a release build doesn't make it happen either
Avatar
I tested with GCC and an old TW 0.7 client version btw
09:07
self compiled, all in Debug
Avatar
I used current master of 0.7 but I don't remember a change that'd influence this
09:10
ah finally got it to happen with gcc
09:11
so I guess it's UB 😦
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 09:13:28Z
think its more a server thing i could reproduce it with old and new clients
09:13
well its obviously a server thing :D
Avatar
so unpleasant to debug
Avatar
are you sure you dont send any wrong snapshots?
09:57
snapshots that are meant for the 0.6 clients only for example
Avatar
Well compiling with clang fixes it, so it's doubtful that I'm doing something obviously wrong
10:00
besides the unknown objects should just be dropped, no?
10:05
hm the snap just looks truncated, very confused
Avatar
my terminal just doesn't have enough scroll buffer to debug this 😛
Avatar
full screen it
Avatar
@fokkonaut do you happen to know why we are looking for ItemSize space in the snap but only end up incrementing data by ItemSize/4?
11:01
what
Avatar
if(RangeCheck(pEnd, pData, ItemSize) || ItemSize < 0) return -3; Range check checks whether we have ItemSize bytes left in the snap
11:01
but we only do pData += ItemSize/4;
Avatar
I am not familiar with that code, sorry :/
Avatar
seems no one is, matricks wrote it and it has been sitting there for the last decade 😄
11:02
maybe when @heinrich5991 is around, he can give me a clue
11:03
heinrich should know about it
11:03
Is this a client problem or server?
Avatar
server
11:04
when compiled with gcc it does something wrong with the snap
Avatar
I dont have a clue, but an idea is to check your character snap handling. I think you do it differently than I do
11:06
I dont get any errors, not on a 0.7 client, not on ddnet Client and also not on the server
Avatar
well duh, It's from scratch it is supposed to be different
Avatar
true
11:06
does this error occur while using ddnet or 0.7 client?
Avatar
Yeah I have a feeling it's the character snap too
11:06
0.7
Avatar
Yep, then i am pretty sure
Avatar
on a broken server the character doesn't get snapped at all, I don't get an object of type 10
Avatar
No on a working one I don't get a character snap
11:07
wtf
Avatar
why do you do it the way you do it
11:07
With the cast and all that
11:08
The way you had it before was correct
Avatar
what cast?
11:09
The whole point of importing the protocol is to avoid using the ugly offsets into snap objects
11:09
oh, i see
11:10
But i guess the problem should be around this stuff
Avatar
If I had any idea wtf is up with the snap sizes I could figure this out
11:11
This is what a broken servers first snap looks like
Avatar
GitHub Gist: instantly share code, notes, and snippets.
11:12
And this is a working one
11:12
GitHub Gist: instantly share code, notes, and snippets.
Avatar
notice how the working one is missing the actual character snap but it has the ddnetcharacter
11:13
so odd
Avatar
i have an idea
11:15
Maybe you should pCore->Write(pCharacter) with the normal character from 0.6
11:15
Because the 0.7 character has a different size
11:16
Where you do the cast, i dont think thats needed
11:16
well wait
11:16
i am wrong
11:16
okay so
11:17
I am doing it the normal way, I just create the pCharacter with the normal size and also write that
11:18
then later on i change the values, but I dont write the 0.6 character (so for you, you shoudnt write the 0.7 one i think)
Avatar
that reinterpret_cast is horrible there
11:18
let me get rid of that
11:18
maybe that'll help
Avatar
I think you should just always create the 0.6 cnetobj_character
11:18
and always write that
11:19
And for 0.7 clients you just edit it. cast the pCharacter to a 07character and then set the vars for it i think?
11:20
Thats how i do it basically, but since i dont have the 0.6 protocol for my server, i need to do the offset thing
Avatar
I can always create it, I can't always write it
11:21
Still a violation of strict aliasing, which is why I think this is breaking anyway
Avatar
works for me
Avatar
Yeah this works for me aswell
11:21
case closed
11:21
lets ship this and everyone just use clang
Avatar
i wouldnt do that tbh
Avatar
ofc not...
Avatar
I was trying to make the point that "works for me" is not a great bar
11:28
it's not the cast but will change that anyway
11:35
oh the 4 is because of using ints
11:36
Imagine iterating your binary protocol with a pointer to a non-fixed size
Avatar
okay, now it disappeared with a debug build
12:00
maybe valgrind will bless me with the answer
Avatar
pf even more broke and I didn't even touch anything
12:19
@timakro you ever here anymore? 😄
Avatar
justabutterflier 2020-06-13 12:28:22Z
@justabutterflier git bash uses msys to give you a unix like environment, like all the usual things, grep, sed, awk, rm, cp
@Learath2 too much nonunderstandable words for me but thanks. Will book say me about this?
Avatar
I don't think it mentions git bash
12:29
msys is a unix environment that works in windows, it gives you the tools that you'd have on linux on windows
12:29
that's it
12:32
I should have used valgrind at the very beginning...
Avatar
-fsanitize=undefined is also a godsend
Avatar
@heinrich5991 you seem to have a uninitialized use in aio_write
Avatar
@Learath2 omg what is it?
13:41
is this the bug I've been wondering about for a couple of years?
Avatar
I'm trying to get a clean backtrace
13:42
you can check it out if you have clang with -fsanitize=memory
Avatar
what do you need to do to trigger it? just starting the server?
13:44
[vagrant@archlinux cross]$ ./DDNet-Server "sv_register 0" [2020-06-13 13:44:03][engine]: running on unix-linux-amd64 [2020-06-13 13:44:03][engine]: arch is little endian Uninitialized bytes in __interceptor_fwrite at offset 0 inside [0x7f9b4d71fe50, 112) ==8666==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x560f435119ba in io_write /vagrant/ddnet/cross/../src/base/system.c:341:9 #1 0x560f435119ba in aio_thread /vagrant/ddnet/cross/../src/base/system.c:483:3 #2 0x560f435135ac in thread_run /vagrant/ddnet/cross/../src/base/system.c:697:2 #3 0x7f9b4fdd1421 in start_thread (/usr/lib/libpthread.so.0+0x9421) #4 0x7f9b4fcdebf2 in clone (/usr/lib/libc.so.6+0xffbf2) SUMMARY: MemorySanitizer: use-of-uninitialized-value /vagrant/ddnet/cross/../src/base/system.c:341:9 in io_write Exiting ==8666==WARNING: MemorySanitizer: use-of-uninitialized-value
Avatar
this might be the bug we've been hitting on windwos
Avatar
io_write is inlined too well so I can't see what is actually uninitialized
Avatar
[0x7f9b4d71fe50, 112)
13:46
do you know what that means?
13:46
does that mean in a memory region of 112 bytes starting at 0x7f...?
Avatar
Yes, not including the 112th byte
Avatar
what is 112 bytes long even
Avatar
let me try at O0
13:48
if it doesn't disappear
Avatar
ASYNCIO is 88 bytes long on my machine
Avatar
takes a while to instrument code on a 1 core vm :/
13:53
oh cmake forces -O2 somewhy
13:54
is there a way to get an animated text (from after effects for example) into a tw map?
Avatar
I don't think I've ever heard of something like that
Avatar
@Learath2 by default it uses the release config which includes -O3(?) or -O2
Avatar
For release it adds -O3
13:58
idk how to override it
Avatar
remove the forced CMAKE_BUILD_TYPE in CMakeLists.txt or build with -DDEV=ON or -DCMAKE_BUILD_TYPE=Debug
Avatar
-DCMAKE_C_FLAGS_DEBUG helped
Avatar
ah, if that helped, only my first hint has a chance of working
Avatar
noooo with -O1 there is another bug that happens first
Avatar
also in asyncio? 😦
Avatar
in the uuid manager
Avatar
:((
Avatar
how though? I don't understand it
14:04
this is now -O1 with clang -fsanitize=memory?
Avatar
and -fno-optimize-sibling-calls
14:05
CFLAGS="-fsanitize=memory -fno-optimize-sibling-calls" CXXFLAGS="-fsanitize=memory -fno-optimize-sibling-calls" LDFLAGS="-fsanitize=memory" CC="clang" CXX="clang++" cmake -GNinja -DCLIENT=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS_DEBUG="-g -O1" -DCMAKE_CXX_FLAGS_DEBUG="-g -O1" ..
14:05
That was how I configured it
Avatar
[quakenet] ZillyHuhn BOT 2020-06-13 14:05:56Z
@Weezy take the after effects animation and create each frame as a image and then use alpha evelopes to play it frame by frame in the map
Avatar
and relwithdebinfo has yet another one at -g -O1 so 3 uninitialized uses
14:06
I'm wondering if MSan is broken 😛
Avatar
newest ddnet?
Avatar
../src/game/collision.cpp:902:247: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare] if(m_pDoor[TileOnTheRight].m_Index == TILE_STOPA || m_pDoor[TileOnTheLeft].m_Index == TILE_STOPA || ((m_pDoor[TileOnTheRight].m_Index == TILE_STOPS || m_pDoor[TileOnTheLeft].m_Index == TILE_STOPS) && m_pDoor[TileOnTheRight].m_Flags|ROTATION_270|ROTATION_90))
Avatar
RelWithDebInfo has an uninitialized use in LoadMap leading to digest_str
14:12
Debug has one in uuid manager
14:12
RelWithDebInfo at -O2 has one in io_write
14:12
I think those warnings already have an issue
Avatar
If you want MemorySanitizer to work properly and not produce any false positives, you must ensure that all the code in your program and in libraries it uses is instrumented (i.e. built with -fsanitize=memory). In particular, you would need to link against MSan-instrumented C++ standard library. We recommend to use libc++ for that purpose.
Avatar
Ah I left now but I bet trace origins would help
14:17
Msan has an exception for libc
14:17
It has interceptors
Avatar
yea, currently building with -fsanitize-memory-track-origins=2
Avatar
libc++ im not sure if they have interceptors for those, maybe you do need an instrumented libc++
Avatar
Uninitialized value was created by an allocation of 'retval' in the stack frame of function 'md5_finish'
14:18
sounds like a false positive
Avatar
Could be, can you reproduce the one in aio_write?
Avatar
which flags do I need for that again?
Avatar
RelWithDebInfo and just fsanitize=memory
14:22
I think relwithdebinfo defaults to o2
Avatar
hm
14:37
it tells me the buffer is wholly uninitialized, but it contains the bytes I'm expecting it to contain
Avatar
Hm I wonder what's wrong with it, it should be using a pattern
Avatar
112 is precisely the length even. maybe the variable just happens to still contain the bytes?
Avatar
Thatd be some luck
Avatar
note that we also had problems with bytes marked as uninitialized on windows
14:46
so maybe there's more to it
14:46
but I don't understand it ← that might well be the problem ^^
Avatar
Well the issue is very subtle on windows too, subtle enough to make it all the way to ntkernel before crashing
Avatar
you know, I wonder how the world fits together
15:11
on the one hand we have this issue in code I wrote, with an memsan and (back then) windows reporting a problem
15:11
and we can't figure it out
15:12
on the other hand one can go to ctf challenges and figure out bugs in a closed source or extremely undocumented software
Avatar
@Learath2 Hi
Avatar
Hi, I was having big trouble, but I figured it out
Avatar
@timakro have you seen my pr btw? It'd be nice to have a review as you were the first one to implement this
Avatar
For those of us that can copy/paste from DDNet: tl;dr: string copyPasteMe = base64encode(signWithPrivateServerKey(rawSaveData)); upon trying to load, the data has it's signature checked to make sure the user hasn't changed it the "codes" needn't be saved server side, users can exchange them among themselves freely
Avatar
8a8f2c9 No more ssmtp, use msmtp instead - def-
Exported 225 message(s)