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 2022-06-22 00:00:00Z and 2022-06-23 00:00:00Z
Avatar
does anyone here still use RSS feeds?
00:27
seems like in the last year Chrome for Android now has support (again) (edited)
00:27
i never used them but i kinda wanna make one for my stream for fun
02:55
copilot has pricing now
Avatar
isn't Ninecloud on this server? i want to kindly yell at them for not using the standard library JSON implementation in Python
07:30
i didnt compile with vulkan on windows 11 msvc. qhen i selected vulkan ingame the game wouldnt start anymore. would be nice to have an error message or automatic switch to opengl.
Avatar
Avatar
f
yes, for const int^^
lol in C it is still the same
07:51
but it's not being shipped to users yet
Avatar
Avatar
ReiTW
lol in C it is still the same
m? what is still the same?
Avatar
I mean, int or const int, it's still somewhere in the stack
08:04
so "a variable is an address in which you can find the value"
Avatar
well its true what ryozuki said, compilers might optimize things by using direct constants
08:04
that are not in RAM
Avatar
Avatar
ReiTW
so "a variable is an address in which you can find the value"
ye unless its a const or a constified variable
08:04
i agreed with ryuzuki xd
Avatar
@f a variable might be in a register or even never in memory at all
08:05
it's definitely not "always an address"
Avatar
well i dont agree with that
08:05
you knew two things for a value contained somewhere
08:05
an address and the value inside that location
08:06
it is a dynamic memory such as ram or a static memory such a flip flop registry?
Avatar
well, that's wrong
Avatar
thats irrelevant
Avatar
not all variables have main memory addresses, and not even all variables are stored somewhere
08:06
some are optimized out entirely
Avatar
how to change the value of something
08:07
if its not contained anywhere?
08:07
where to store it after you change it?
Avatar
the C compiler only has to produce code that works as-if it was executed
08:07
it doesn't actually have to perform the computation
08:08
(this isn't a theoretical concern, this is what actually happens)
Avatar
even if you want to go deep down cpu architeture i dont agree with that
08:08
registries are memory locations that have addresses and you reference those in machine code
08:09
address is an information like another
08:09
variable = address + value (unless excpetions)
08:09
i see you like focussing on the expetions
08:09
but the general rule is this
Avatar
okay, so you call registers a memory location as well
08:09
fine
08:09
and then call everything that doesn't work with your rule an exception
Avatar
i mean im not talking about something i made up
Avatar
okay, I can make any rule work with that
Avatar
nah, the only expection i see
08:10
is an actual constant
08:10
written in machine code, inside the code
08:10
that has no memory location
08:11
but when you do var x = 4; now x must have a location somehwere
08:11
or it will be forgotten, like doing 5 + 5 without assignments
Avatar
no, that's false
08:11
c++ int abc() { int i = 5; i += 10; if (i == 15) { return 0; } else { return 1; } }
08:11
compile this with your favorite C compiler with optimizations
08:12
i will never have a memory location
Avatar
there is a conceptual problem maybe thats why we are not understanding each others
08:13
i mean, cpu operates on local registry, if its not enough on local caches, if its not enough on main ram, if its not enough it swappes to hard drive
08:13
its the memory pyramid
Avatar
I do know all that
Avatar
so you say that something has an address only if it is in main memory??
08:13
why
Avatar
I'm not arguing that right now
Avatar
your code is so simple it can be run instantly on local registries
08:13
no need to use main memory
Avatar
I'm saying in the above example, i is never in any kind of memory
Avatar
so... that means your var i has no address?
Avatar
it's not even in registers (edited)
Avatar
Avatar
f
your code is so simple it can be run instantly on local registries
His code is so simple it won't ever run
Avatar
It'll be completely optimized out
Avatar
Avatar
heinrich5991
I'm saying in the above example, i is never in any kind of memory
i is in a static memory based on flip flops
Avatar
the variable i will never be in main memory and it will never be in a register
Avatar
that is a cpu registry
Avatar
no
Avatar
i will never be in any register
Avatar
// Type your code here, or load an example. int abc() { int i = 5; i += 10; if (i == 15) { return 0; } else { return 1; } }
Avatar
so thats what im not getting
Avatar
check this
Avatar
the assembly listing only has xor eax, eax
08:15
which is similar to return 0
08:15
so the assembly definitely doesn't contain anything about the variable i
08:15
i understand what you are saying
08:16
its because your code is so simple ye
Avatar
this also happens in more complicated code
08:16
I chose a simple example to make it very clear
Avatar
Avatar
heinrich5991
the assembly listing only has xor eax, eax
don't forget the ret overwise it's not similar to return 0
Avatar
the rule "all variables are manifested in memory or registers somewhen" is false
Avatar
i understand compiler optimization things ye
Avatar
but afaik xor eax, eax is better than mov eax, 0
Avatar
in my view its because the compiler understood that's not a "real variable" sort to say
08:17
you just need it on the fly for local working then forget it
Avatar
Avatar
ReiTW
but afaik xor eax, eax is better than mov eax, 0
It's a performance thing about how the pipeline is organized iirc. I think I read something about it once but can't seem to dig it back up
Avatar
but yeye i agree with you now thanks for clarification 😛
Avatar
@Learath2 for me if I remember
Avatar
Avatar
ReiTW
but afaik xor eax, eax is better than mov eax, 0
for one, its encoding is shorter
Avatar
the instruction set is smaller
08:17
31 ed xor ebp,ebp
08:17
only 2 bytes
08:18
while mov eax, 0 would be of size 3
Avatar
also, it's hardcoded into the CPU
Avatar
not 3 sry
08:18
more
Avatar
zeroing a register takes 0 cycles IIRC
Avatar
but you see what I mean
Avatar
because it's just a register renaming
Avatar
@f btw saying registers have an address is a little out there. On most architectures you can't refer to them with a memory address for they wouldn't be even mapped into the memory
Avatar
Avatar
Learath2
@f btw saying registers have an address is a little out there. On most architectures you can't refer to them with a memory address for they wouldn't be even mapped into the memory
yes i meant the registry address
Avatar
(registers are different from cache and main memory btw)
08:20
referencing them its different ofc, they are organized differently
Avatar
cache is supposed to be a invisible abstraction
08:20
whereas you have to use registers explicitly
Avatar
I've seen some toy architectures messing around with address tags letting users address registers. But even then as far as C is concerned if you so much as suggest a compiler to store a variable in a register you are just not allowed to take the address of it, even if the compiler doesnt end up putting it in a register
Avatar
Avatar
Learath2
I've seen some toy architectures messing around with address tags letting users address registers. But even then as far as C is concerned if you so much as suggest a compiler to store a variable in a register you are just not allowed to take the address of it, even if the compiler doesnt end up putting it in a register
thats interesting
Avatar
The standard rarely makes such a restriction, but in this case it's sort of justified since well there really are no real architectures that allow this
08:22
Anyway, too semantic of a discussion before breakfast. Need food
Avatar
Avatar
Learath2
Anyway, too semantic of a discussion before breakfast. Need food
hahah true
08:24
thats because you like to go in deep details to find exceptions to a general picture that, even if its a semplification, cannot be stated as fundamentally wrong
08:24
08:24
i mean this is how you represent variables, its like a pointer to an address that contains the value
08:24
it is always true? nope
08:25
but this picture is useful and its not wrong under an accpetable generalization
08:25
its like to say newton laws are wrong because it doesn't concieve relativity xd
Avatar
I can't prove newton's laws wrong in my backyard
08:26
(maybe I can, but I don't know how)
08:26
I know how to prove this wrong
Avatar
then prove me that also this is wrong xD
Avatar
that has nothing to do with newton's mechanics? ^^
Avatar
you said you could prove that
08:27
so i took something harder maybe? xd
Avatar
I said I can't prove newton's laws wrong
Avatar
ooh sorry misread
Avatar
Depends on your goal I guess. Is programming a means to an end goal or your goal. If you are interested in learning a language well, it's imho in your best interest to keep your terminology and concepts as accurate as possible without going overly deep
Avatar
Avatar
Learath2
Depends on your goal I guess. Is programming a means to an end goal or your goal. If you are interested in learning a language well, it's imho in your best interest to keep your terminology and concepts as accurate as possible without going overly deep
its true it depends on the level of abstraction you are positioning
08:28
and thats important
Avatar
you can talk about variables in the abstract machine I guess
Avatar
because i could comment: dont talk about structured loops, they dont exist, only gotos
08:29
well they exist in a certain level of abstraction xd
Avatar
but you sounded like you were talking about stuff that happens on the silicon
Avatar
Avatar
heinrich5991
but you sounded like you were talking about stuff that happens on the silicon
peole answered me talking about compiling optimizations
08:30
i followed that line of discussion cause im curious too about how the compile could change the abstraction in which the programmer is working on
08:30
and i learned something today thanks to you
08:30
but i still think thats correct
08:30
on a certain level of abastraction
08:30
its not conceptual wrong
Avatar
what would go wrong if you replaced the last person pointing to 69 with 69 itself?
Avatar
well i'd say if the compiler technically doesn't optimize anything it'd work, even for the example of @heinrich5991
Avatar
Chillerdragon: are u there?
Avatar
Avatar
heinrich5991
you can talk about variables in the abstract machine I guess
This is what I'd think would be useful
Avatar
Avatar
heinrich5991
what would go wrong if you replaced the last person pointing to 69 with 69 itself?
not complete in my view, cause the int has an l-value and r-value (unless expetions)
08:32
the last picture say that int is the address that contains the actual number 69
Avatar
No fair, you accuse us of being pedantic but you bring up l and r values 😀
Avatar
Avatar
heinrich5991
what would go wrong if you replaced the last person pointing to 69 with 69 itself?
actually if you do the same than the int -> 69 to the others you have to add like 2 values each being the address of
Avatar
Avatar
Learath2
No fair, you accuse us of being pedantic but you bring up l and r values 😀
i use jargon cause i know we understand eachothers XD i just meant address + value
Avatar
might it be that you identify int with the location of the int instead of where its value is stored?
Avatar
Avatar
heinrich5991
might it be that you identify int with the location of the int instead of where its value is stored?
yes
Avatar
so you always add one level of indirection over my model?
Avatar
cause if i do a = &b;
08:34
im assigning the address not the value
08:34
i like to keep that information in the meme
Avatar
yes, but I'm doing a = &b and not a = b
Avatar
I'd associate int with the location where 69 is stored
Avatar
the first you assign l-value, the second r-value
Avatar
when doing &, I'd look where this location is
Avatar
yes cause b its two things not just one
08:35
the address and the value
08:35
you can decide what to consider in expressions thanks to &
Avatar
but ints can exist without being able to get their address taken
Avatar
Assigning an l-value doesnt really make much sense. You can assign TO an l-value
Avatar
Avatar
Learath2
Assigning an l-value doesnt really make much sense. You can assign TO an l-value
you do that for pointers xd
Avatar
(& refers to memory address exclusively, in all architectures that I know of)
Avatar
Avatar
heinrich5991
(& refers to memory address exclusively, in all architectures that I know of)
if you are gonna talk about how the compiler will change your logic
08:36
i agree with you 100% now
Avatar
you got me understand that better than i did before
Avatar
you can type register int x in C
08:36
you cannot take an address of this variable
08:37
even though the compiler might put this into main memory
08:37
it's still an l-value
Avatar
interesting, i have to admit i never use register and im n ot an expert but
08:37
as i knew it is just a restriction to enforce safety somehow
Avatar
You take the address of something it immediately becomes an r-value if we are talking C
Avatar
like visiblity modificators in classes
Avatar
You are using an abstract machine concept but trying to apply it to silicon, which is what is causing your problems imo
Avatar
Avatar
heinrich5991
you can type register int x in C
thus it has its l-value but the compiler will stop building if it detects you are using it
08:38
why you say that
Avatar
I can still assign to it
Avatar
i use the words l-value and r-value just for rapidity
Avatar
that's most of what being an l-value is about
Avatar
i intend address and value
Avatar
for me, an l-value is something you can assign to
Avatar
"Has an l-value" isn't really a thing. An expression can be an lvalue expression or an rvalue expression. There is no silicon equivalent of "expression"
Avatar
and an r-value is a value you cannot assign to
Avatar
Avatar
heinrich5991
and an r-value is a value you cannot assign to
agree
Avatar
Avatar
Learath2
"Has an l-value" isn't really a thing. An expression can be an lvalue expression or an rvalue expression. There is no silicon equivalent of "expression"
dude i dont really understand you xD
08:40
there is no operations there are just electrical impulses that changes voltages
08:40
so? xd
08:40
i positioned myself on the abstraction layer that C creates for you
08:40
and i consider that as truth
08:41
as i consider linear time as a truth even if its not like that
Avatar
Avatar
f
dude i dont really understand you xD
Lvalue is a misnomer for address. Rvalue is a misnomer for value. They do not correspond
Avatar
if you dont like the term address i can use "place in memory"
08:42
i dont see the mistake honestly
Avatar
This is why I said terminology is very important if you want to learn a language or programming in general at this level. If you care about very pedantic things you'll need to learn very accurate terms for things
Avatar
or at least that might explain why @Learath2 and I had strong opinions on it ^^
08:43
if we have different definitions, then it explains the misunderstanding
Avatar
before trying to teach me how to learn something
08:43
let me understand why l-value and r-value i used wrongly
08:43
An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address). rvalues are defined by exclusion.
Avatar
Aand there he goes on the defensive. I'm out. Food awaits
Avatar
that's wikipedia, tell me what im missing
08:43
wtf dude im not going defensive
Avatar
Avatar
Learath2
Aand there he goes on the defensive. I'm out. Food awaits
hum?
Avatar
maybe you went aggressive? xd
Avatar
both sides: try to not psychologically analyze the other person
Avatar
Avatar
heinrich5991
hum?
[10:43 AM] f.: before trying to teach me how to learn something
I don't think this is conducive to a discussion and I don't have the energy for a hostile one, if you want to go on feel free. I don't feel like it today
Avatar
i just meant to say that it would be more useful to me if you just tell me specifically what is wrong about what i said about l-values and r-values
08:45
that just saying i should learn how to use the technical terms better
Avatar
I think l-value means "something that can be assigned to"
08:45
and r-value is the rest
Avatar
Avatar
heinrich5991
I think l-value means "something that can be assigned to"
i.e. an address as it says
08:46
someone calls l-value locator value
08:46
if there is something im missing id like to know more ^^
Avatar
the l in l-value most certainly comes from "left"
Avatar
yeye i know xd
Avatar
An lvalue is an expression with object type. If you want a more layman form of it something that can be assigned to also works fine since that was actually how it was initially defined. If something can appear on the left side of an assignment it's an l-value
Avatar
L-value: “l-value” refers to memory location which identifies an object. l-value may appear as either left hand or right hand side of an assignment operator(=).
08:48
whats wrong with this statement
Avatar
int array[10];, array is an lvalue as it's an expression with object type, however it's not a modifiable l-value, so it can't appear on the LHS of an assignment
Avatar
for now there is no "silicon" stuff involved
08:50
so i still dont understand
08:50
its something conceptual
08:50
l-value is the location, r-value is the value
08:50
i still dont understand whats wrong with this statement
Avatar
An lvalue is a type of expression. It's not the address. It refers to an object, it doesn't say anything about whether it's in memory or in a register or whatever physical location it might be
Avatar
i dont agree that its a type of expression
08:51
it can be used in an expression
08:51
its an operand
Avatar
The standard is fairly clear on what an lvalue is
Avatar
*(int *)123 is an l-value
Avatar
that is an expression
08:53
&a; is an expression
08:53
5; is an expression
08:53
what are we talking about here?
Avatar
without the semicolon, yes
08:53
5; is a statement
08:53
5 is an expression
08:53
5 is an r-value
Avatar
ok i see we are playing with words here
Avatar
&a is an r-value
Avatar
ok an expression without operators and just operands are still expressions
08:53
i can agree, so l-value even without operands is an expression
Avatar
Avatar
heinrich5991
&a is an r-value
This one is the one I think is causing confusion here
Avatar
still doesnt make me understand what is wrong about my l-value r-value interpretations
Avatar
*((int *)x + 5) is still an l-value
08:54
even though it contains "operands"
Avatar
Avatar
heinrich5991
&a is an r-value
explain me this pls
08:55
maybe this is the thing 😛
Avatar
&a is an address, but it's an r-value. if you define l-value as address, then you get misled
Avatar
why &a is r-value?
Avatar
because I cannot assign to it
Avatar
ooooooooooooooh w8 maybe im getting it
Avatar
I cannot say &a = &b
Avatar
By heinrich's easy definition, it can't appear on the left side, so it's not an l-value
Avatar
okok maybe im understang better
08:56
it just depends on the position because ofc everything is just a number
08:56
so you say &a even if its the address it can be considered r-value inside an expression
Avatar
&a is always an r-value, in every context
Avatar
no w8 i still have a doubt
Avatar
When you write &a you mean address of a which is just a normal value
Avatar
&a is the r-value
08:58
but a is the l-value?
08:58
The unary & (address-of) operator requires an l-value as its operand. That is, &n is a valid expression only if n is an l-value. Thus, an expression such as &12 is an error. Again, 12 does not refer to an object, so it’s not addressable. For instance,
Avatar
a is an lvalue, &a is an rvalue. Yep
Avatar
okok ... but this brings me at the start xD
08:59
a has l-value and r-value
Avatar
made a shit error just for u
08:59
test.cpp:11:11: error: cannot bind non-const lvalue reference of type ‘int*&’ to an rvalue of type ‘int*’ 11 | PrintInt(&a);
09:00
&a = p; // error: &a is an r-value
Avatar
yes that would have been easier to do
Avatar
@Learath2 ok maybe i understand
Avatar
Avatar
f
a has l-value and r-value
int a = 0;. a is an object. a is also an l-value. a has a value it's 0
Avatar
&a : a is the l-value of this subexpression (edited)
09:03
and &a is the l-value of the entire expression
Avatar
&a is the address, &a is an r-value
Avatar
but a is an l-value
Avatar
yes
09:04
the expression a is an l-value
Avatar
yes yes i think i get it
09:05
its a composed expression so you have to treat l-values and r-values differently in every sub-expression
Avatar
As you apply operators and functions, you can go from an l-value to an r-value. a is an l-value, we apply the & operator, we get &a an r-value, we apply the * operator, we get *a an l-value
Avatar
Avatar
f
yes yes i think i get it
Isn't that you by any chance?)
Avatar
or we apply the sizeof operator, sizeof a and we get a r-value
Avatar
yes i think im starting to get that this terminology is very related to expressions
09:07
its not a general thing about variables
Avatar
Yes, that's all I ever wanted to say
Avatar
Avatar
Matodor
Isn't that you by any chance?)
doubt
Avatar
so i should say that l-values are typically addresses and r-values are typically just values inside an expression
09:08
@Learath2 is this more correct?
Avatar
Avatar
Matodor
Isn't that you by any chance?)
nope xd but i probably stole the icon from him
09:08
i remembered changing the color
Avatar
Avatar
f
so i should say that l-values are typically addresses and r-values are typically just values inside an expression
l-values refer to objects, r-values don't. That's how I'd think about it
Avatar
you should always add "inside expressions"
09:09
right?
Avatar
Because when you say l-values are addresses, you get the issue of &a which is an r-value but is the address of a
Avatar
yes thats what enlightned me
09:09
heinrich gets to the point quickly xd
Avatar
Avatar
f
you should always add "inside expressions"
Well normally it's implied. When you talk about something being an lvalue or an rvalue, you are always talking about an expression
Avatar
yeye was just to be sure
09:10
i think im getting this better now
09:10
@Learath2 but do you agree with me that this is not silicon related stuff?
09:10
its an higher level concept as i see it
Avatar
Well obviously, this is a concept of the abstract machine. That's why I was not sure why you were talking about silicon and lvalues
Avatar
okok now i think thats clear
09:11
thank you^^
Avatar
About the original meme, I'm not sure if you don't take anya pointing as meaning this is a pointer, then there is some truth to it
Avatar
i still think the meme is right xD
09:12
at a certain level of abstraction
09:12
we were talking about the misuse of l-value and r-value terminology now
Avatar
But I think anya should probably just not be pointing in the last frame and instead have a 69 on her forehead
Avatar
i agree i should use address and values not a synonyms of that
Avatar
Avatar
Learath2
But I think anya should probably just not be pointing in the last frame and instead have a 69 on her forehead
yes thats probably a better representation
09:13
maybe she could "puke" the number xd
Avatar
Or that
Avatar
i dont like the second one pointing to "int"
09:13
thats not right for me
09:13
where is the value?
09:14
but ye, she should "contain" it, not poiting at it
09:14
what i didnt like most that int had no anya on it
09:14
why? its a variable like int*
Avatar
int anya1 = 69; int *anya2 = &anya1; int **anya3 = &anya2 This is sort of the mental picture I'd have about the meme
Avatar
anya?
Avatar
Avatar
Learath2
int anya1 = 69; int *anya2 = &anya1; int **anya3 = &anya2 This is sort of the mental picture I'd have about the meme
exactly
Avatar
Avatar
heinrich5991
anya?
Avatar
a sad turd, thanks discord
09:17
Avatar
💩 @murpi for you
09:18
💩
Avatar
2258939 Update translation stats - def-
09:20
cf7570c Version 16.2 - def- f12f971 Update Korean translations by CHaBek - cwh7435 ec684f2 Added new translations + fixed current one - crqch 42f4d93 Fix Leak IP not visible - crqch 4bef015 Remove accidentally added double type - Robyt3 9933b3c Update comment - Robyt3 342b5b5 Fix editor value scrollers not working and panning being slow - Robyt3 48c4cfd Improve some german translations - Jupeyy be4ae02 Update Brazilian Portuguese translation (supersedes #5304) - def-
Avatar
Damn i missed s interesting convo
10:01
I love how that meme sparked this tho
10:01
TOOBASED
Avatar
Avatar
Ryozuki
Damn i missed s interesting convo
You wouldn't like it, it was about C, very pedantic C at that
10:15
Im still interested thi
10:15
Tho
10:16
All the l,r,pr values i alwsys gotta check up their definitions again and again
10:16
Its not something i actively think of when coding in c++ honestly xD
10:17
Avatar
Avatar
Learath2
Click to see attachment 🖼️
The face i make when i see another memory unsafety or race due to c++ usage
10:21
TOOBASED
Avatar
@Ryozuki afaik C only has rvalues and lvalues
10:23
it's C++ that goes overboard 😛
Avatar
Avatar
Ryozuki
Its not something i actively think of when coding in c++ honestly xD
Me neither, except when thinking about rvalue references and perfect forwarding. These concepts are more used when talking about C/C++ rather than coding
Avatar
perfect forwarding?
Avatar
std::forward
10:25
For when you do template magic
Avatar
hmm, I guess I'm going to learn some C++ today
10:26
do you happen to know whether the thing std::forward does is automatic in rust?
Avatar
Avatar
heinrich5991
do you happen to know whether the thing std::forward does is automatic in rust?
I dont know rust remotely well enough to know if that applies
10:28
I think you get sane code in rust in similar situations without the need of something like std::forward
Avatar
okay
10:31
okay, I think it's automatic in rust due to the way how moves are the default
10:31
c++ template <typename T1, typename T2> void wrapper(T1 e1, T2 e2) { func(e1, e2); }
10:31
this is the example that the article is saying 'obviously' doesn't work, but I think it's the correct way to write it in rust
Avatar
I think so too but I can't say it with any certainty
Avatar
chillerdragon BOT 2022-06-22 10:34:08Z
murpi: bra
You're invited to talk on Matrix
Avatar
The result is the reference collapsing rule. The rule is very simple. & always wins. So & & is &, and so are && & and & &&. The only case where && emerges from collapsing is && &&. You can think of it as a logical-OR, with & being 1 and && being 0.
10:34
oh, TIL these reference collapsing rules
10:34
quite simple, even 🙂
Avatar
thats for rust right?
Avatar
no
Avatar
thanks, that article was quite clear
10:37
@Learath2 do you also have an article about move references?
Avatar
rust auto derefs multple & to a single & iirc
Avatar
if you use it in a place where & is acceptable but not &&&&…
Avatar
I don't have a good model of move references
Avatar
Avatar
heinrich5991
@Learath2 do you also have an article about move references?
Move references as in rvalue references?
Avatar
I mean && references, not & references
10:39
probably rvalue
10:39
do they behave as the actual value type inside the function?
Avatar
Hm, I do remember I read a really nice blog on them but I can't seem to remember who wrote it
Avatar
and only parameter passing is different?
10:41
helps filter false positives
Avatar
Z3 is fun, I'm impressed if they only get a 15x slowdown for larger programs. I co-wrote a paper a while ago using constraint solvers to find regressions: http://felsin9.de/nnis/pubs/ase2014.pdf
poggers 1
Avatar
Couldn't find the blog post :/
10:52
@heinrich5991 rvalue references are lvalue expressions inside functions confusingly enough
Avatar
so they behave like a bare parameter?
10:52
inside the function
Avatar
(Or anywhere else, but you mostly use them in functions)
Avatar
they also don't reference memory outside the function, do they?
Avatar
Avatar
heinrich5991
so they behave like a bare parameter?
Bare? Idk what that'd imply but yes they do act like any other parameter
Avatar
well, a & reference parameter changes the variable that was passed if I change it inside the function
Avatar
Avatar
deen
Z3 is fun, I'm impressed if they only get a 15x slowdown for larger programs. I co-wrote a paper a while ago using constraint solvers to find regressions: http://felsin9.de/nnis/pubs/ase2014.pdf
Avatar
AIUI, the && reference behaves the same as no reference at all inside the function; the difference is that you cannot pass lvalues to it directly
Avatar
ChillerDragon: I got dmed by someone with ur name on Discord, that wasn't you, right? (edited)
Avatar
Avatar
heinrich5991
AIUI, the && reference behaves the same as no reference at all inside the function; the difference is that you cannot pass lvalues to it directly
I don't think that's quite correct, an rvalue reference can reference outside the function afaik
Avatar
@Learath2 so it's more like a reference, but you're allowed to move out of it?
12:14
hm no, I think I have to think about it some more
Avatar
Can someone tell me if the line (void)pMsg; can be omitted or does it do anything? (edited)
12:32
I'm only wondering what it does or if it was there because of the old C age.
Avatar
i think it does nothing
12:33
Casting to void is used to suppress compiler warnings. The Standard says in §5.2.9/4 says, Any expression can be explicitly converted to type “cv void.” The expression value is discarded.
12:33
maybe if pmsg was unused at some point in history this was added
Avatar
Ah makes sense
12:34
Like this:
Avatar
thank you 😄
Avatar
Today, June 21, 2022, Cloudflare suffered an outage that affected traffic in 19 of our data centers
Avatar
good read
14:15
it also led me to read something else about their Quicksilver DB
Avatar
Ye i read it yesterfay
Avatar
Cloudflare is always on point with their blogposts
Avatar
they posted it just some hours after it happened (edited)
14:16
they are also fast af
Avatar
fast to serve, fast to fail, fast to tell the world about how they failed
14:17
honorable
Avatar
i wonder
14:18
they are the reason half internet dies when they go down
14:18
centralization bad
Avatar
its like facebook
14:18
their engineers
Avatar
but matrix sucks
tee_thinking 1
Avatar
are top top notch
14:18
have u seen their blog posts?
14:18
but the corporation sucks
Avatar
i haven't no
Avatar
Avatar
lynn
but matrix sucks
the protocol is super convoluted and not a great base for open communication
14:19
my friend probably has more details about it
14:20
it's a functional implementation of decentralized chatting but apparently not ideal
Avatar
-Transparent memory offloading (TMO) is Meta’s data center solution for offering more memory at a fraction of the cost and power of existing technologies -In production since 2021, TMO saves 20 percent to 32 percent of memory per server across millions of servers in our data center fleet We are witnessing massive growth in the [...]Read More...
Avatar
Avatar
Ryozuki
centralization bad
centralization necessary to prevent ddos
14:20
rip
Avatar
i wonder
Avatar
Avatar
Ryozuki
they are the reason half internet dies when they go down
Vali: Write that down, write that down
Avatar
why does the tsin smile look wrong as a frown
14:21
but good as a smile
14:21
is this just psychology
Avatar
vali should ddos cloudflare, they are a big company maybe they can get him into a jail cell
Avatar
vali would feel like someone poking to them
Avatar
He can't because he does not have any power that could take down even 0.001% of their services
Avatar
nice nick u got btw
troll 1
Avatar
same message different words
Avatar
he also lacks cuz of knowledge
Avatar
@lynn could you give me some links to read up on criticism on the matrix protocol?
Avatar
ill try to find some
Avatar
Avatar
Ryozuki
vali would feel like someone poking to them
we should donate, so he can afford bigger ddos
Avatar
lmao (edited)
Avatar
day 14 of remembering Learath is not 30
14:30
let's keep the streak going
Avatar
i think learath is 24
14:31
im 22 btw
14:31
@Patiga how old are you?
Avatar
what we gonna do to this fat guys
Avatar
wrong channel bro
14:32
also did you know that Patiga has a nice voice
14:32
uwu
Avatar
I do not know if we changed something for building related to ASAN, but when I build using CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" CFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" cmake -DCMAKE_BUILD_TYPE=Debug .. make -j$(nproc) I get a lot of the following warnings: /usr/bin/ld.gold: warning: Cannot export local symbol '__asan_extra_spill_area'
Avatar
@lynn I keep that information kinda private, sorry
Avatar
that's fair
Avatar
asking someone ages
14:33
rude smh
Avatar
you still have a nice voice sorry
14:33
doxxed i guess
happy 1
Avatar
thanks ^^
Avatar
i used to care alot about that, when i was 15 that is
Avatar
Avatar
c0d3d3v
I do not know if we changed something for building related to ASAN, but when I build using CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" CFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" cmake -DCMAKE_BUILD_TYPE=Debug .. make -j$(nproc) I get a lot of the following warnings: /usr/bin/ld.gold: warning: Cannot export local symbol '__asan_extra_spill_area'
At least I think I did not have these warnings before
14:39
Has someone in the last time also compiled with ASAN?
Avatar
Avatar
c0d3d3v
I do not know if we changed something for building related to ASAN, but when I build using CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" CFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" cmake -DCMAKE_BUILD_TYPE=Debug .. make -j$(nproc) I get a lot of the following warnings: /usr/bin/ld.gold: warning: Cannot export local symbol '__asan_extra_spill_area'
same
Avatar
================================================================= ==14741==ERROR: LeakSanitizer: detected memory leaks Direct leak of 216320 byte(s) in 3 object(s) allocated from: #0 0x4e11df (/home/arda/ddnet/build/DDNet+0x4e11df) #1 0x56b9d5 (/home/arda/ddnet/build/DDNet+0x56b9d5) #2 0x54ab3a (/home/arda/ddnet/build/DDNet+0x54ab3a) #3 0x9b63fb (/home/arda/ddnet/build/DDNet+0x9b63fb) #4 0x9b2308 (/home/arda/ddnet/build/DDNet+0x9b2308) #5 0x1d9cb53 (/home/arda/ddnet/build/DDNet+0x1d9cb53) #6 0x7fa3b5532ead (/usr/lib/libpthread.so.0+0x8ead) Direct leak of 6240 byte(s) in 3 object(s) allocated from: #0 0x4e1387 (/home/arda/ddnet/build/DDNet+0x4e1387) #1 0x7fa3aaad1251 (/usr/lib64/dri/radeonsi_dri.so+0xbb5251) Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x4e1548 (/home/arda/ddnet/build/DDNet+0x4e1548) #1 0x7fa3b7af7a11 (/usr/lib/libSDL2-2.0.so.0+0x9da11) SUMMARY: AddressSanitizer: 222664 byte(s) leaked in 7 allocation(s). Hmm, i get this message when i close the game
15:14
uh
Avatar
Avatar
nori
================================================================= ==14741==ERROR: LeakSanitizer: detected memory leaks Direct leak of 216320 byte(s) in 3 object(s) allocated from: #0 0x4e11df (/home/arda/ddnet/build/DDNet+0x4e11df) #1 0x56b9d5 (/home/arda/ddnet/build/DDNet+0x56b9d5) #2 0x54ab3a (/home/arda/ddnet/build/DDNet+0x54ab3a) #3 0x9b63fb (/home/arda/ddnet/build/DDNet+0x9b63fb) #4 0x9b2308 (/home/arda/ddnet/build/DDNet+0x9b2308) #5 0x1d9cb53 (/home/arda/ddnet/build/DDNet+0x1d9cb53) #6 0x7fa3b5532ead (/usr/lib/libpthread.so.0+0x8ead) Direct leak of 6240 byte(s) in 3 object(s) allocated from: #0 0x4e1387 (/home/arda/ddnet/build/DDNet+0x4e1387) #1 0x7fa3aaad1251 (/usr/lib64/dri/radeonsi_dri.so+0xbb5251) Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x4e1548 (/home/arda/ddnet/build/DDNet+0x4e1548) #1 0x7fa3b7af7a11 (/usr/lib/libSDL2-2.0.so.0+0x9da11) SUMMARY: AddressSanitizer: 222664 byte(s) leaked in 7 allocation(s). Hmm, i get this message when i close the game
looks normal... we did not fix these for a while
Avatar
tho the debug symbols are missing... but I guess these are the normal leaks
Avatar
ddnet bot just SHIT itself hard
Avatar
Avatar
c0d3d3v
tho the debug symbols are missing... but I guess these are the normal leaks
why is it missing? i add -DCMAKE_BUILD_TYPE=Debug
Avatar
did you build in a clean diretory
15:17
also -- Build type: Debug
Avatar
I do not even get these leaks currently, but for me the log normaly contains code lines, and function names
15:23
like this
15:26
memory is so hard to make right in C++ xD
Avatar
thats why rust exists (edited)
☑️ 1
15:27
BASED
Avatar
true. I only wished Rust is more easily readable ^^
Avatar
@c0d3d3v try with ld instead of gold
15:29
I hate that code in mobile looks white on dark mode
justatest 1
15:30
Unreadable
Avatar
Avatar
deen
@c0d3d3v try with ld instead of gold
is there an option to use ld?
Avatar
-DFUSE_LD=ld
Avatar
btw. I'm nearly finished with the requests heinrich had for https://github.com/ddnet/ddnet/pull/5210 ... (I hope) I only have to fix this heap-buffer-overflow xD Then we can finaly move DDNetCharacterDisplayInfo in DDNetCharacter
15:36
Took me way longer then I expected. My first idea hadn't worked out, and I needed to find out a lot more about our snap system.... But the solution I have now should be quite acceptable, if it works 😄 But at least I have now a very good understanding of our snap-system (edited)
Avatar
Avatar
deen
-DFUSE_LD=ld
worked
Avatar
does it fix the asan issues too or just compiler warnings?
15:40
I'm wondering if we should use ld again 😄
15:40
all this LTO and ld stuff caused more problems than it solved
Avatar
Avatar
deen
does it fix the asan issues too or just compiler warnings?
for me asan also worked with the warning (at least it detected the heap-buffer-overflow and an other mem_copy error from me). But with ld there are no warnings.
15:42
and the output is the same 😄 as before
15:43
only @nori had no debug symbols in the asan output, but I guess that is an other problem
15:47
DDraceNetwork, a cooperative racing mod of Teeworlds - ddnet/ubsan.supp at f8810aeef88fa907c4d035c198d3c50055acbaaf · ddnet/ddnet
Avatar
CCharacter *pLocalChar = m_pClient->m_GameWorld.GetCharacterByID(m_pClient->m_Snap.m_LocalClientID); return null when use spec. but i need to get a variable for the local player, is it possible to do this during spec? (edited)
15:53
for this
Avatar
Avatar
c0d3d3v
only @nori had no debug symbols in the asan output, but I guess that is an other problem
@nori install llvm-symbolizer
15:56
if it's in $PATH, then the symbols should be automagically resolved
Avatar
yes, you can make a PR to remove this
Avatar

Checklist

  • [ ] 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 physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--u...
Avatar
Avatar
deen
@nori install llvm-symbolizer
worked :) (edited)
16:00
================================================================= ==4866==ERROR: LeakSanitizer: detected memory leaks Direct leak of 216320 byte(s) in 3 object(s) allocated from: #0 0x4e11df in malloc (/home/arda/ddnet/build/DDNet+0x4e11df) #1 0x56b9d5 in CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferObject(CCommandBuffer::SCommand_CreateBufferObject const*) /home/arda/ddnet/src/engine/client/backend/opengl/backend_opengl.cpp:1901:25 #2 0x54ab3a in CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*) /home/arda/ddnet/src/engine/client/backend/opengl/backend_opengl.cpp:1107:49 #3 0x9b63fb in CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*) /home/arda/ddnet/src/engine/client/backend_sdl.cpp:248:20 #4 0x9b2308 in CGraphicsBackend_Threaded::ThreadFunc(void*) /home/arda/ddnet/src/engine/client/backend_sdl.cpp:77:25 #5 0x1d9cb53 in thread_run(void*) /home/arda/ddnet/src/base/system.cpp:721:2 #6 0x7ffaf5e76ead in start_thread /builddir/glibc-2.32/nptl/pthread_create.c:463:8 Direct leak of 6240 byte(s) in 3 object(s) allocated from: #0 0x4e1387 in calloc (/home/arda/ddnet/build/DDNet+0x4e1387) #1 0x7ffaeb3f8251 (/usr/lib64/dri/radeonsi_dri.so+0xbb5251) Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x4e1548 in realloc (/home/arda/ddnet/build/DDNet+0x4e1548) #1 0x7ffaf843ba11 (/usr/lib/libSDL2-2.0.so.0+0x9da11) SUMMARY: AddressSanitizer: 222664 byte(s) leaked in 7 allocation(s).
16:00
this bot :d
Avatar
I don't know who made this bot, but I think we don't need linking github issues with # . @Learath2 can you remove that from the bot?
16:02
It's the DDNet#9607 bot
Avatar
[ddnet/ddnet-libs] New branch created: pr-drmingw-revert
16:05
This reverts commit 9138d1edd90f47c8c62bcab766fa072a72e895f2. Pastoer reported on Discord that this causes warnings when closing client: !Screenshot 2022-06-22 at 18 04 01
16:06
Pastoer reported on Discord that this causes warnings when closing client: !Screenshot 2022-06-22 at 18 04 01

Checklist

  • [ ] 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 poi...
Avatar
Avatar
deen
I don't know who made this bot, but I think we don't need linking github issues with # . @Learath2 can you remove that from the bot?
I made it ;(
Avatar
don't delete it 😄 it's learn material for me
Avatar

Checklist

  • [ ] 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 physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--u...
Avatar
Then maybe don't detect # numbers inside of monospace blocks?
Avatar
Avatar
σℓí♡
for this
this is only the predicted character. There is no prediction done when you spectate... so you have to use the real data.
16:37
You could use CCharacterCore *pCharacter = &m_pClient->m_aClients[ClientID].m_Predicted if you really nead a CCharacterCore and want the predicted data if available. Thats what I have done in the new hud. But if you do not need predicted data you should use the snap data in m_pClient->m_Snap, that contains most of data the client got from the server. (edited)
16:39
@σℓí♡ ^
Avatar
2abbfed Upgrade Discord SDK to version 3.2.1 (includes macOS arm64) - def-
16:41
[ddnet/ddnet-libs] New branch created: pr-discord-3.2.1
16:41
8b64081 Upgrade Discord SDK to version 3.2.1 (includes macOS arm64) - def-
16:43

Checklist

  • [ ] 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 physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--u...
Avatar
Avatar
c0d3d3v
@σℓí♡ ^
i need m_StrongWeakID in CCharacter. Is it not possible to update this for someone who is even in spec? m_StrongWeakID update here
16:46
Avatar
Avatar
σℓí♡
i need m_StrongWeakID in CCharacter. Is it not possible to update this for someone who is even in spec? m_StrongWeakID update here
why would you want it in spec?
17:00
you can not hook anyone in spec
Avatar
diff without spec and in spec (edited)
Avatar
on ddnet server, you can get the m_StrongWeakID from the snap... in extended data. On other servers it is not possible
Avatar
[quakenet] ChillerDragon BOT 2022-06-22 17:02:43Z
@murpi nah i did not dm you o.O
Avatar
m_pClient->m_Snap->m_aCharacters[ClientID]->m_ExtendedData.m_StrongWeakID its availibe if m_pClient->m_Snap->m_aCharacters[ClientID]->m_HasExtendedData is true
17:03
ty
17:03
i try it
Avatar
You've got a faker then ^^
Avatar
Avatar
σℓí♡
diff without spec and in spec (edited)
I would not show m_StrongWeakID when you spectate... it is strange because you can not hook anyone and since it is invalid if you are able to pause... its unnecessary. But that is only my opinion (edited)
Avatar
0bfd10d Remove pnglite shift ubsan - ardadem 83479c8 Merge #5476 - bors[bot]
Avatar
Avatar
c0d3d3v
I would not show m_StrongWeakID when you spectate... it is strange because you can not hook anyone and since it is invalid if you are able to pause... its unnecessary. But that is only my opinion (edited)
okay, anyway m_pClient->m_Snap.m_aCharacters[pPlayerInfo->m_ClientID].m_Strong update after exiting spec
Avatar
it's probably better to leave it like this already
Avatar
I also wondered why it was done using the predicted data... but that is so, because on other servers you do not have extended data. You could try to implement it, and make a video so that we get a feeling for it if it is good.
Avatar
Avatar
c0d3d3v
I also wondered why it was done using the predicted data... but that is so, because on other servers you do not have extended data. You could try to implement it, and make a video so that we get a feeling for it if it is good.
I can try to do this, but I do not know how to update this variable during spec
Avatar
It happens sometimes when i join Back in Time 3 ``` /home/arda/ddnet/src/game/client/prediction/gameworld.cpp:147:20: runtime error: member access within address 0x61900144dd80 which does not point to an object of type 'CEntity' 0x61900144dd80: note: object has invalid vptr 00 00 00 00 2a 00 80 78 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 84 14 e8 ^~~~~~~ invalid vptr SUMMARY: UndefinedBehaviorSanitizer: undefined-...
Avatar
Avatar
σℓí♡
I can try to do this, but I do not know how to update this variable during spec
it is updated automaticly
18:15
@nori are you ardadem on github?
Avatar
are you really sure you are on latest master?
Avatar
yes i am pretty sure :D
Avatar
what does git log tell as last commit?
Avatar
83479c8f51bb8031aec5efd9b0ac8c428f66bbaa
18:16
which is latest commit
Avatar
mh did you build in a clean directory?
18:19
i know how to build, it is still happening
18:19
just i can't get backtrace :\
Avatar
Avatar
nori
just i can't get backtrace :\
I will try to reproduce it 😄
Avatar
it happens me almost all the time :d easy to reproduce
Avatar
Avatar
nori
it happens me almost all the time :d easy to reproduce
probably a driver problem as in the issues Robyt3 linked
Avatar
Avatar
c0d3d3v
it is updated automaticly
After exit spec
Avatar
Avatar
σℓí♡
After exit spec
yes you do not get a new id while in spec
Avatar
Then others press kill -> indicator dont display
Avatar
@nori are you on wayland?
Avatar
Avatar
nori
yes i am
I guess it is a wayland driver problem. I can join Back in Time 3 without problem
18:30
If I try it with your enviroment variables ... (edited)
Avatar
try only DDNET_DRIVER=GLES
Avatar
Avatar
nori
try only DDNET_DRIVER=GLES
works for me
18:32
no problem
18:33
@Jupstar ✪ you had wayland installed too right?
Avatar
Avatar
nori
no idea
if you have X11 you could try that... For me wayland does not work...
Avatar
but i don't think it is driver related, it happens only in back in time 3
18:34
i can join too but with few tries
Avatar
Avatar
nori
but i don't think it is driver related, it happens only in back in time 3
It is probably only on that map because a lot of players where there and since it is a big map, some have huge numbers. -> so a lot of potential for overflows Does it also happen on a empty server with that map? (edited)
Avatar
yes it happens on server with no players too
Avatar
Avatar
nori
but i don't think it is driver related, it happens only in back in time 3
its a very big map, there is also a big hill climb map, try that too. If the driver overflows some buffer it could overflow into the heap area used by our entites... so it could be the driver I think (edited)
18:40
I think it is Chill+Let's+Climb (2/3) (edited)
Avatar
Avatar
c0d3d3v
I think it is Chill+Let's+Climb (2/3) (edited)
it opened in a second without problem (edited)
Avatar
Avatar
nori
@Jupstar ✪ you had wayland installed too right?
yes but wayland also was the only thing that made problems with SDL2's surface detection for vulkan
18:51
but that was like half a year ago
18:51
i assume its fixed already
Avatar
Avatar
nori
83479c8f51bb8031aec5efd9b0ac8c428f66bbaa
is it same commit as in the issue? or a different?
Avatar
Avatar
c0d3d3v
if you have X11 you could try that... For me wayland does not work...
u simply didnt use a wayland session
18:56
"unable to init SDL video: wayland not available" it fails before it can even start
Avatar
Avatar
Jupstar ✪
is it same commit as in the issue? or a different?
I have the commit you said, yes
19:07
it is here
19:07
-,-
19:11
is it can be related to wayland @Jupstar ✪? but it fails on prediction code
Avatar
Avatar
nori
I have the commit you said, yes
how did u start ddnet?
Avatar
Avatar
nori
is it can be related to wayland @Jupstar ✪? but it fails on prediction code
yes the code is defs not from latest master
19:11
u somehow use an old client
Avatar
do i need to take a video to proof it is from ddnet github :D
Avatar
ok, but did you also run asan?
Avatar
but why would it not detect a memory corruption
19:12
the*
Avatar
i mean i compiled with it
19:13
export CC=clang export CXX=clang++ export CXXFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" export CFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" make -DCMAKE_BUILD_TYPE=Debug ../
Avatar
ok really weird then, i mean could be caused by a different thread maybe
19:14
so yeah maybe wayland somehow writes into ddnet ram
Avatar
it is happening to me for a long time, i just didn't report it :D
Avatar
could try valgrind
19:15
maybe it finds out more
19:15
valgrind --show-reachable=yes --show-possibly-lost=yes --error-limit=no --log-fd=2 --track-fds=yes --trace-children=yes --redzone-size=256 --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt --fair-sched=yes ./DDNet
Avatar
Avatar
nori
================================================================= ==4866==ERROR: LeakSanitizer: detected memory leaks Direct leak of 216320 byte(s) in 3 object(s) allocated from: #0 0x4e11df in malloc (/home/arda/ddnet/build/DDNet+0x4e11df) #1 0x56b9d5 in CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferObject(CCommandBuffer::SCommand_CreateBufferObject const*) /home/arda/ddnet/src/engine/client/backend/opengl/backend_opengl.cpp:1901:25 #2 0x54ab3a in CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*) /home/arda/ddnet/src/engine/client/backend/opengl/backend_opengl.cpp:1107:49 #3 0x9b63fb in CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*) /home/arda/ddnet/src/engine/client/backend_sdl.cpp:248:20 #4 0x9b2308 in CGraphicsBackend_Threaded::ThreadFunc(void*) /home/arda/ddnet/src/engine/client/backend_sdl.cpp:77:25 #5 0x1d9cb53 in thread_run(void*) /home/arda/ddnet/src/base/system.cpp:721:2 #6 0x7ffaf5e76ead in start_thread /builddir/glibc-2.32/nptl/pthread_create.c:463:8 Direct leak of 6240 byte(s) in 3 object(s) allocated from: #0 0x4e1387 in calloc (/home/arda/ddnet/build/DDNet+0x4e1387) #1 0x7ffaeb3f8251 (/usr/lib64/dri/radeonsi_dri.so+0xbb5251) Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x4e1548 in realloc (/home/arda/ddnet/build/DDNet+0x4e1548) #1 0x7ffaf843ba11 (/usr/lib/libSDL2-2.0.so.0+0x9da11) SUMMARY: AddressSanitizer: 222664 byte(s) leaked in 7 allocation(s).
@Jupstar ✪ did you also see it? i get it when i close the ddnet
Avatar
that means u run opengl 2
19:16
or 3
Avatar
it is opengl es
19:16
3 es
19:16
afaik
Avatar
doubt
19:16
GLES 3 uses opengl 3.3 code
19:16
that shouldnt leak any memory™️
Avatar
[2022-06-22 21:44:43][gfx]: GPU vendor: AMD [2022-06-22 21:44:43][gfx]: GPU renderer: AMD RENOIR (LLVM 12.0.1, DRM 3.42, 5.15.47_1) [2022-06-22 21:44:43][gfx]: GPU version: OpenGL ES 3.2 Mesa 22.1.1
19:17
wrong window:p
Avatar
xd
Avatar
Avatar
nori
[2022-06-22 21:44:43][gfx]: GPU vendor: AMD [2022-06-22 21:44:43][gfx]: GPU renderer: AMD RENOIR (LLVM 12.0.1, DRM 3.42, 5.15.47_1) [2022-06-22 21:44:43][gfx]: GPU version: OpenGL ES 3.2 Mesa 22.1.1
and it leaks with that?
Avatar
Avatar
nori
================================================================= ==4866==ERROR: LeakSanitizer: detected memory leaks Direct leak of 216320 byte(s) in 3 object(s) allocated from: #0 0x4e11df in malloc (/home/arda/ddnet/build/DDNet+0x4e11df) #1 0x56b9d5 in CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferObject(CCommandBuffer::SCommand_CreateBufferObject const*) /home/arda/ddnet/src/engine/client/backend/opengl/backend_opengl.cpp:1901:25 #2 0x54ab3a in CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*) /home/arda/ddnet/src/engine/client/backend/opengl/backend_opengl.cpp:1107:49 #3 0x9b63fb in CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*) /home/arda/ddnet/src/engine/client/backend_sdl.cpp:248:20 #4 0x9b2308 in CGraphicsBackend_Threaded::ThreadFunc(void*) /home/arda/ddnet/src/engine/client/backend_sdl.cpp:77:25 #5 0x1d9cb53 in thread_run(void*) /home/arda/ddnet/src/base/system.cpp:721:2 #6 0x7ffaf5e76ead in start_thread /builddir/glibc-2.32/nptl/pthread_create.c:463:8 Direct leak of 6240 byte(s) in 3 object(s) allocated from: #0 0x4e1387 in calloc (/home/arda/ddnet/build/DDNet+0x4e1387) #1 0x7ffaeb3f8251 (/usr/lib64/dri/radeonsi_dri.so+0xbb5251) Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x4e1548 in realloc (/home/arda/ddnet/build/DDNet+0x4e1548) #1 0x7ffaf843ba11 (/usr/lib/libSDL2-2.0.so.0+0x9da11) SUMMARY: AddressSanitizer: 222664 byte(s) leaked in 7 allocation(s).
i get it yeah
Avatar
nori: is this the line of code it crashed at? "pEnt->m_pParent->m_DestroyTick = GameTick();"
Avatar
Avatar
nori
i get it yeah
what does gl_major print in f1?
19:20
i honestly dont see how this is possible
19:20
all gles code is called CCommandProcessorFragment_OpenGL2ES
Avatar
why do i have all the weirdest bugs xd
Avatar
not CCommandProcessorFragment_OpenGL2
Avatar
Avatar
Jupstar ✪
all gles code is called CCommandProcessorFragment_OpenGL2ES
CCommandProcessorFragment_OpenGLES2
19:23
19:23
for me the code doesnt get called
19:23
i dont see how this should be different for u
Avatar
@Jupstar ✪ i'll try again, maybe i didn't export the gles backend when i get this
Avatar
u dont need to export it anymore btw
19:24
u can now just select GLES ingame
Avatar
probably i didn't export it before, it was normal opengl
19:26
i get this now ================================================================= ==27217==ERROR: LeakSanitizer: detected memory leaks Direct leak of 6240 byte(s) in 3 object(s) allocated from: #0 0x4e1387 in calloc (/home/arda/ddnet/build/DDNet+0x4e1387) #1 0x7eff73a46251 (/usr/lib64/dri/radeonsi_dri.so+0xbb5251) Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x4e1548 in realloc (/home/arda/ddnet/build/DDNet+0x4e1548) #1 0x7eff80a97a11 (/usr/lib/libSDL2-2.0.so.0+0x9da11) SUMMARY: AddressSanitizer: 6344 byte(s) leaked in 4 allocation(s).
19:26
with gles
Avatar
ok
19:27
the other bug, really weird, i really wonder what corrupts the memory
19:27
must be smth asan cant detect i assume
19:27
have u tried the valgrind?
Avatar
Avatar
trml
nori: is this the line of code it crashed at? "pEnt->m_pParent->m_DestroyTick = GameTick();"
how can i try it? by putting break here?
Avatar
Avatar
Jupstar ✪
have u tried the valgrind?
not yet
Avatar
I meant the line of code in gameworld.cpp:147
Avatar
i put breakpoint there
19:31
client closed again
Avatar
Avatar
Jupstar ✪
valgrind --show-reachable=yes --show-possibly-lost=yes --error-limit=no --log-fd=2 --track-fds=yes --trace-children=yes --redzone-size=256 --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt --fair-sched=yes ./DDNet
trying this now
Avatar
Avatar
Jupstar ✪
valgrind --show-reachable=yes --show-possibly-lost=yes --error-limit=no --log-fd=2 --track-fds=yes --trace-children=yes --redzone-size=256 --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt --fair-sched=yes ./DDNet
it didn't launch ddnet and print bunch of library and hex stuff, is it normal? :D
Avatar
not really
19:37
it should start it normally(but very slow)
19:38
and then put everything in the file valgrind-output.txt
Avatar
another year
Avatar
ah arch and dbg symbols suck i guess? xd
19:39
dunno what it wants
Avatar
Avatar
nori
Click to see attachment 🖼️
ah but did u disable asan?
19:40
i think asan + valgrind wont work
19:40
same build
19:40
okay i just build it as debug release right?
Avatar
can also use debug if its reproducable
19:41
but dunno, since u the only one its probs wayland anyway
Avatar
ok it is starting
19:41
very slow
19:41
:D
Avatar
but i have rdna2 now too, maybe i can see if it crashes for me too on wayland in the weekend
Avatar
ye valgrind is rly slow
Avatar
hardly moving the cursor
Avatar
yeah its slow, but it works without compile dependencies
19:45
and finds all kind of stuff
19:45
even uninitialized stuff
Avatar
takes eternity
Avatar
cant u like connect ip
Avatar
no i mean joining the server
19:56
ok it is happened i guess
19:56
==31109== LEAK SUMMARY: ==31109== definitely lost: 11,772 bytes in 260 blocks ==31109== indirectly lost: 0 bytes in 0 blocks ==31109== possibly lost: 3,130,503 bytes in 47,191 blocks ==31109== still reachable: 11,516,001 bytes in 3,660 blocks ==31109== suppressed: 0 bytes in 0 blocks ==31109== ==31109== ERROR SUMMARY: 237 errors from 231 contexts (suppressed: 2 from 2)
19:56
is it catch it
19:56
Avatar
3mb leak
Avatar
how do you even read it xd
Avatar
possibly lost: 3,130,503 bytes in 47,191 blocks
19:58
xd
19:58
how long did u run it?
19:59
i think leaks add up so the more u run it with valgrind the more u find
Avatar
dunno 5-10 mins
Avatar
@nori does it also crash with vulkan btw?
Avatar
oh thats reasonable
Avatar
Conditional jump or move depends on uninitialised value(s) ==31109== at 0xEA773E8: ??? ==31109== by 0xE286FBE: ??? ==31109== by 0xDEFD5E1: ??? ==31109== by 0xDEFD92A: ??? ==31109== by 0xE289067: ??? ==31109== by 0xE2891A4: ??? ==31109== by 0xE28C08D: ??? ==31109== by 0xE377511: ??? ==31109== by 0xE377B87: ??? ==31109== by 0xE3381F4: ??? ==31109== by 0xE50F6E4: ??? ==31109== by 0x165867: CCommandProcessorFragment_OpenGLES3::Cmd_Clear(CCommandBuffer::SCommand_Clear const*) (backend_opengl3.cpp:816) ==31109== Uninitialised value was created by a heap allocation But that's probably deep inside the driver
19:59
Conditional jump or move depends on uninitialised value(s) ==31109== at 0xEA773E8: ??? ==31109== by 0xE286FBE: ??? ==31109== by 0xDEFD5E1: ??? ==31109== by 0xDEFEF1F: ??? ==31109== by 0xDEF3C1D: ??? ==31109== by 0xDEE6FFC: ??? ==31109== by 0x4FF6A8D: ??? (in /usr/lib/libSDL2-2.0.so.0.22.0) ==31109== by 0x212CF4: CCommandProcessorFragment_SDL::Cmd_Swap(CCommandBuffer::SCommand_Swap const*) (backend_sdl.cpp:188) same with this
Avatar
Avatar
Jupstar ✪
@nori does it also crash with vulkan btw?
i'll try
Avatar
and the uninitialized value way created by wayland
20:00
was*
Avatar
Avatar
Robyt3
and the uninitialized value way created by wayland
How did yo ufigure that? From the call?
20:00
you*
Avatar
yeah, at least that's what I assume from the callstack
20:02
but is this really related to all the crashes in RemoveEntity?
Avatar
Avatar
Jupstar ✪
@nori does it also crash with vulkan btw?
i can't choose vulkan, it is not saving after restart
20:03
can i launch it with env variable?
Avatar
./DDNet "gfx_backend Vulkan"
Avatar
[2022-06-22 23:04:31][sdl]: SDL version 2.0.22 (compiled = 2.0.22) [2022-06-22 23:04:31][gfx]: Created Vulkan 1.0 context. [2022-06-22 23:04:31][gfx]: unable to create window: Installed Vulkan doesn't implement the VK_KHR_surface extension [2022-06-22 23:04:31][sdl]: SDL version 2.0.22 (compiled = 2.0.22) [2022-06-22 23:04:31][gfx]: Created OpenGL 3.0 context.
20:05
it is switching to opengl?
Avatar
lmao
20:06
i really hope this is a SDL limitation
20:06
bcs else wayland drivers are really hard behind xD
20:06
but i also had bugs with wayland vulkan last time i tried :/
Avatar
oh ok solved
20:07
i haven't installed vulkan driver before :D
Avatar
ah ok 😄
20:07
weird that it even loads some other vulkan driver 😄
20:07
but probably its just the stub of the vulkan loader
20:08
works great
20:08
:D
Avatar
xd
20:08
at least half a screen works
Avatar
happened on vulkan too
Avatar
Avatar
Jupstar ✪
at least half a screen works
xD
20:09
[2022-06-22 23:08:35][vulkan]: warning: requested presentation mode was not available. falling back to mailbox / fifo relaxed. [2022-06-22 23:08:35][vulkan]: vulkan error: The device surface format fetching failed. [2022-06-22 23:08:35][assert]: /home/arda/ddnet/src/engine/client/backend/vulkan/backend_vulkan.cpp(1129): The device surface format fetching failed. [1] 32221 illegal hardware instruction SDL_VIDEODRIVER=wayland ./DDNet
20:09
print this
20:09
i can join others severs
20:09
but not bit3
Avatar
mhh ok
20:10
but i think i had the exact same issue on vulkan on wayland
20:10
tabbing in and out killed it
20:10
but not related to joining any map xD
Avatar
wayland kek
Avatar
i got backtrace on vulkan
20:13
13.38 KB
Avatar
but is that really related to joining the map?
20:14
looks to me like u tabbed out and in
Avatar
i can join others
Avatar
InitVulkanSwapChain
20:14
it somehow recreates the swapchain
20:15
could try ./DDNet "dbg_gfx 4"
20:15
ah and wait
20:15
install these
Avatar
ok i tried and it joined, next try crashed again
20:15
without tab out
20:16
Vulkan-ValidationLayers-1.3.204.1_1
20:16
these i guess
Avatar
yeah
Avatar
Avatar
Jupstar ✪
install these
i did
20:16
now what
Avatar
/DDNet "dbg_gfx 4" "gfx_backend Vulkan"
20:17
and dont show crashlog, just the terminal output should be enough
Avatar
i had crash while opening the game too now xd
Avatar
ok lets see
20:19
im on wayland now too
20:20
[2022-06-22 23:20:19][vulkan]: allocated chunk of memory with size: 129601200 for frame 2 (staging buffer) [2022-06-22 23:20:19][vulkan]: allocated chunk of memory with size: 129601200 for frame 2 (buffer) [2022-06-22 23:20:19][vulkan]: allocated chunk of memory with size: 14862640 for frame 2 (staging buffer) [2022-06-22 23:20:19][vulkan]: allocated chunk of memory with size: 14862640 for frame 2 (buffer) [2022-06-22 23:20:19][vulkan]: allocated chunk of memory with size: 9778080 for frame 2 (staging buffer) [2022-06-22 23:20:19][vulkan]: allocated chunk of memory with size: 9778080 for frame 2 (buffer) [2022-06-22 23:20:19][vulkan]: recreating swap chain requested by acquire next image (prepare frame). [2022-06-22 23:20:20][vulkan]: recreating swap chain. [2022-06-22 23:20:20][vulkan]: warning: requested presentation mode was not available. falling back to mailbox / fifo relaxed. [2022-06-22 23:20:20][vulkan]: minimal swap image count 4 [2022-06-22 23:20:20][vulkan_debug]: Validation Warning: [ UNASSIGNED-BestPractices-Error-Result ] Object 0: handle = 0x55bc2e50ff80, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x5f379b89 | vkGetPhysicalDeviceSurfaceFormatsKHR(): Returned error VK_ERROR_SURFACE_LOST_KHR. [2022-06-22 23:20:20][vulkan]: vulkan error: The device surface format fetching failed. [2022-06-22 23:20:20][assert]: /home/arda/ddnet/src/engine/client/backend/vulkan/backend_vulkan.cpp(1129): The device surface format fetching failed. [1] 757 illegal hardware instruction ./DDNet "dbg_gfx 4"
20:20
it is after crash
Avatar
yeah i assume this is SDL2 or driver limitation, tho its weird the swapchain change is triggered for no sense "recreating swap chain requested by acquire next image (prepare frame)."
20:21
VK_ERROR_SURFACE_LOST_KHR is usually GPU crash
20:21
ah nice
20:21
for me it works
Avatar
SDL_VIDEODRIVER=wayland used this right?
20:22
otherwise it is x11
Avatar
SDL_VIDEODRIVER=wayland ./DDNet "dbg_gfx 4"
20:22
i hope its wayland, can i somehow check ingame?
Avatar
don't think so :D
Avatar
Avatar
nori
Click to see attachment 🖼️
maybe if you see this xD
Avatar
i can compare fps
20:23
wayland is usually a bit faster
Avatar
input lag comparable too
Avatar
i think xwayland is still on wayland
20:26
so both get input lag
20:26
but it does load x11 library apparently mhh
20:28
xD
20:28
xeyes
20:28
can detect it
20:28
so yes, was native wayland, no crashes for me on mesa (driver: 22.0.5)
20:28
u probs have 22.2
Avatar
wtf is this resolution wayland reports xD
20:31
2048 xD, lets add all power of 2 resolutions xd
20:31
when i click on a small resolution it suddenly reports 8k resolutions xD wtf going on
20:31
its really buggy, just not crashing on back in times 3
20:32
it also crashes when i try to select them xD
Avatar
i never had bugs with gles on wayland
20:32
only bit2
20:32
bit3*
Avatar
but hear me out, im the first person on the planet with 8k 240hz
monkalaugh 1
justatest 1
20:33
yeah sry cant help, just accept xwayland for now if that runs better
20:33
maybe in 10 years wayland is king, then we all switch and are happy^^
Avatar
Avatar
Jupstar ✪
yeah sry cant help, just accept xwayland for now if that runs better
lol
20:33
:D
20:33
i am okay with trying yo join 5 times :D
20:34
it eventually joins
Avatar
xD
Avatar
@Jupstar ✪ did you try gles on wayland too?
20:35
vulkan itself already buggy
20:36
maybe it is triggering another thing :d
Avatar
But vk worked for me ^^ can try tomorrow if i don't forget
Avatar

Checklist

  • [ ] 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 physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--u...
Avatar
@deen if we want to have https://github.com/ddnet/ddnet/pull/5210 in 16.2 should I rebase it on your 16.2 PR or on latest master?
21:56
make all PRs on master, I cherry-pick them to 16.2
Avatar
It should be extremely rare that we have to make a change on 16.2 but not on master
21:57
for example if we reworked an entire feature in master, but the old version in 16.2 has a small bug, we could make the fix directly on 16.2
21:57
16.2-devel is basically forked off of master, and will die at some point, never gets merged back into master
Avatar
I see... I have mixed things up again 😄
Avatar
is there a way to get more verbose log than just ./DDNet?
Avatar
4e20de1 Updated french translation - Chairn 6055a7d Merge #5479 - bors[bot]
Avatar
Avatar
cauldron
is there a way to get more verbose log than just ./DDNet?
some messages are only displayed with the debug hud active [CTR + SHIFT + D]
Avatar
Avatar
cauldron
is there a way to get more verbose log than just ./DDNet?
what version are you on?
22:11
But ./DDNet "debug 1" might help
Avatar
master branch from yesterday or few days ago. using debug 1 gave me a few [uuid] tagged logs with api calls or something
Avatar

Checklist

  • [ ] 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 physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--u...
23:52
Would be nice if we could use a formatter for python files, agree on project settings for the formatter and also add it to scripts/fix_style.py. There are two well known Python formatter: autopep8 and black. I would recommend black because I have good experiences with it, and I think black has the better default rules but both are good formatter, and we probably want to customize the formatting rules anyway.
Avatar
well okay @Patiga my friend didn't have much to say and maybe their opinion has changed a bit but
  • matrix has vastly more heavy metadata handling through the server protocol compared to XMPP, which is a performance concern
  • as a protocol it's generally "heavier" than XMPP (didn't specify)
  • still better than Discord, and easier to onboard compared to XMPP
  • maybe XMPP is technically better but it lacks hype and devs
23:55
and the last sentiment they had was basically just
23:55
it exists, it's e2ee, and it's federated
23:55
so not much to complain about for now while it's the only reasonable one
23:57
i really like XMPP so im sad to see the last ambassador for it in my life kinda raise Matrix's hand in defeat
23:57
but hey that's life right
23:57
a new shiny protocol comes along and devs are like YOOOOO
Avatar
thanks for checking up on it again!
23:59
I can understand that you like XMPP and are maybe not that hyped about Matrix
Exported 856 message(s)