Visual Studio WTF



  • @cvi said in Visual Studio WTF:

    @Benjamin-Hall said in Visual Studio WTF:

    and yes, I know I'm being hypocritical here in the extreme. But I'm trying to do better.

    It's easier when you're an observer. We've all been stuck in one of those retarded discussions, only that when you're in the middle of them, your POV doesn't seem that retarded.

    To be fair, the discussion by itself is a lot less retarded (if not very informative still) when you've read C++ committee people have similar discussions regarding UB and the topics surrounding it. You can always find people from the same groups: the purists, which operate on the premise that your compiler will screw you over given the slightest chance; the pragmatists, where if the program right now does what it's supposed to, everything is good, standard be damned. Truth is somewhere in-between, probably. Where exactly? 🤷

    Case in point: how illegal is it actually to dereference the nullptr? Well. Standard is pretty clear: no can do. Is address zero, which is the typical representation of a nullptr, special? Somewhat, but not too much. You can map memory at address zero "just fine":

    read.cpp:

    #include <cstdint>
    
    std::uint64_t read_( std::uint64_t* aAddr )
    {
    	return *aAddr;
    }
    

    test.cpp:

    #include <cstdint>
    
    std::uint64_t read_( std::uint64_t* );
    
    #include <cstdio>
    #include <cstring>
    
    #include <sys/mman.h>
    
    int main()
    {
    	std::uint64_t x = 123;
    	std::printf( "x = %lu\n", read_( &x ) );
    
    	auto ptr = ::mmap( 
    		0, 16*1024,
    		PROT_READ|PROT_WRITE, 
    		MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,
    		-1, 0
    	);
    
    	std::printf( "address = %p\n", ptr );
    
    	std::uint64_t y = 456;
    	std::memcpy( ptr, &y, sizeof(std::uint64_t) );
    
    	std::printf( "nullptr = %lu\n", read_( nullptr ) );
    
    	::munmap( ptr, 16*1024 );
    
    	return 0;
    }
    

    $ ./a.out
    x = 123
    address = 0xffffffffffffffff
    Segmentation fault
    $ sudo ./a.out
    Password: hunter2
    x = 123
    address = (nil)
    *nullptr = 456

     
    Program does what you expect it to do, which includes reading from nullptr.

    I mean, I don't really care. Except that the back and forth of "you're dumb. No you're dumb. You can't read. No, you can't read (ad nauseum)" is really getting old. And it's usually those same two people. Neither of whom is dumb and both of whom can, in fact, read. And have proven themselves as such in the past. Just not where the other is concerned.



  • @Benjamin-Hall Eh, yeah, that part is getting pretty old. I ignore it mostly.


  • I survived the hour long Uno hand

    @Benjamin-Hall said in Visual Studio WTF:

    @cvi said in Visual Studio WTF:

    @Benjamin-Hall said in Visual Studio WTF:

    and yes, I know I'm being hypocritical here in the extreme. But I'm trying to do better.

    It's easier when you're an observer. We've all been stuck in one of those retarded discussions, only that when you're in the middle of them, your POV doesn't seem that retarded.

    To be fair, the discussion by itself is a lot less retarded (if not very informative still) when you've read C++ committee people have similar discussions regarding UB and the topics surrounding it. You can always find people from the same groups: the purists, which operate on the premise that your compiler will screw you over given the slightest chance; the pragmatists, where if the program right now does what it's supposed to, everything is good, standard be damned. Truth is somewhere in-between, probably. Where exactly? 🤷

    Case in point: how illegal is it actually to dereference the nullptr? Well. Standard is pretty clear: no can do. Is address zero, which is the typical representation of a nullptr, special? Somewhat, but not too much. You can map memory at address zero "just fine":

    read.cpp:

    #include <cstdint>
    
    std::uint64_t read_( std::uint64_t* aAddr )
    {
    	return *aAddr;
    }
    

    test.cpp:

    #include <cstdint>
    
    std::uint64_t read_( std::uint64_t* );
    
    #include <cstdio>
    #include <cstring>
    
    #include <sys/mman.h>
    
    int main()
    {
    	std::uint64_t x = 123;
    	std::printf( "x = %lu\n", read_( &x ) );
    
    	auto ptr = ::mmap( 
    		0, 16*1024,
    		PROT_READ|PROT_WRITE, 
    		MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,
    		-1, 0
    	);
    
    	std::printf( "address = %p\n", ptr );
    
    	std::uint64_t y = 456;
    	std::memcpy( ptr, &y, sizeof(std::uint64_t) );
    
    	std::printf( "nullptr = %lu\n", read_( nullptr ) );
    
    	::munmap( ptr, 16*1024 );
    
    	return 0;
    }
    

    $ ./a.out
    x = 123
    address = 0xffffffffffffffff
    Segmentation fault
    $ sudo ./a.out
    Password: hunter2
    x = 123
    address = (nil)
    *nullptr = 456

     
    Program does what you expect it to do, which includes reading from nullptr.

    I mean, I don't really care. Except that the back and forth of "you're dumb. No you're dumb. You can't read. No, you can't read (ad nauseum)" is really getting old. And it's usually those same two people. Neither of whom is dumb and both of whom can, in fact, read. And have proven themselves as such in the past. Just not where the other is concerned.

    RFP: A site plugin that allows Our God Emporer or his designees to add pairs of people to the "Auto Rosie List", at which point all post chains involving more than 2 replies exclusively between them are automatically replaced with Rosie images.


  • BINNED

    @izzion said in Visual Studio WTF:

    @Benjamin-Hall said in Visual Studio WTF:

    @cvi said in Visual Studio WTF:

    @Benjamin-Hall said in Visual Studio WTF:

    and yes, I know I'm being hypocritical here in the extreme. But I'm trying to do better.

    It's easier when you're an observer. We've all been stuck in one of those retarded discussions, only that when you're in the middle of them, your POV doesn't seem that retarded.

    To be fair, the discussion by itself is a lot less retarded (if not very informative still) when you've read C++ committee people have similar discussions regarding UB and the topics surrounding it. You can always find people from the same groups: the purists, which operate on the premise that your compiler will screw you over given the slightest chance; the pragmatists, where if the program right now does what it's supposed to, everything is good, standard be damned. Truth is somewhere in-between, probably. Where exactly? 🤷

    Case in point: how illegal is it actually to dereference the nullptr? Well. Standard is pretty clear: no can do. Is address zero, which is the typical representation of a nullptr, special? Somewhat, but not too much. You can map memory at address zero "just fine":

    read.cpp:

    #include <cstdint>
    
    std::uint64_t read_( std::uint64_t* aAddr )
    {
    	return *aAddr;
    }
    

    test.cpp:

    #include <cstdint>
    
    std::uint64_t read_( std::uint64_t* );
    
    #include <cstdio>
    #include <cstring>
    
    #include <sys/mman.h>
    
    int main()
    {
    	std::uint64_t x = 123;
    	std::printf( "x = %lu\n", read_( &x ) );
    
    	auto ptr = ::mmap( 
    		0, 16*1024,
    		PROT_READ|PROT_WRITE, 
    		MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,
    		-1, 0
    	);
    
    	std::printf( "address = %p\n", ptr );
    
    	std::uint64_t y = 456;
    	std::memcpy( ptr, &y, sizeof(std::uint64_t) );
    
    	std::printf( "nullptr = %lu\n", read_( nullptr ) );
    
    	::munmap( ptr, 16*1024 );
    
    	return 0;
    }
    

    $ ./a.out
    x = 123
    address = 0xffffffffffffffff
    Segmentation fault
    $ sudo ./a.out
    Password: hunter2
    x = 123
    address = (nil)
    *nullptr = 456

     
    Program does what you expect it to do, which includes reading from nullptr.

    I mean, I don't really care. Except that the back and forth of "you're dumb. No you're dumb. You can't read. No, you can't read (ad nauseum)" is really getting old. And it's usually those same two people. Neither of whom is dumb and both of whom can, in fact, read. And have proven themselves as such in the past. Just not where the other is concerned.

    RFP: A site plugin that allows Our God Emporer or his designees to add pairs of people to the "Auto Rosie List", at which point all post chains involving more than 2 replies exclusively between them are automatically replaced with Rosie images.

    I think the last time Blakey suggested something like that and I liked the idea, he rage-quit because I previously called him an idiot and you can't agree/disagree only with some ideas.

    Not sure what's the point here, other than maybe be careful or I'll agree with you? :thonking: :thonking:


  • I survived the hour long Uno hand

    @topspin said in Visual Studio WTF:

    @izzion said in Visual Studio WTF:

    @Benjamin-Hall said in Visual Studio WTF:

    @cvi said in Visual Studio WTF:

    @Benjamin-Hall said in Visual Studio WTF:

    and yes, I know I'm being hypocritical here in the extreme. But I'm trying to do better.

    It's easier when you're an observer. We've all been stuck in one of those retarded discussions, only that when you're in the middle of them, your POV doesn't seem that retarded.

    To be fair, the discussion by itself is a lot less retarded (if not very informative still) when you've read C++ committee people have similar discussions regarding UB and the topics surrounding it. You can always find people from the same groups: the purists, which operate on the premise that your compiler will screw you over given the slightest chance; the pragmatists, where if the program right now does what it's supposed to, everything is good, standard be damned. Truth is somewhere in-between, probably. Where exactly? 🤷

    Case in point: how illegal is it actually to dereference the nullptr? Well. Standard is pretty clear: no can do. Is address zero, which is the typical representation of a nullptr, special? Somewhat, but not too much. You can map memory at address zero "just fine":

    read.cpp:

    #include <cstdint>
    
    std::uint64_t read_( std::uint64_t* aAddr )
    {
    	return *aAddr;
    }
    

    test.cpp:

    #include <cstdint>
    
    std::uint64_t read_( std::uint64_t* );
    
    #include <cstdio>
    #include <cstring>
    
    #include <sys/mman.h>
    
    int main()
    {
    	std::uint64_t x = 123;
    	std::printf( "x = %lu\n", read_( &x ) );
    
    	auto ptr = ::mmap( 
    		0, 16*1024,
    		PROT_READ|PROT_WRITE, 
    		MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,
    		-1, 0
    	);
    
    	std::printf( "address = %p\n", ptr );
    
    	std::uint64_t y = 456;
    	std::memcpy( ptr, &y, sizeof(std::uint64_t) );
    
    	std::printf( "nullptr = %lu\n", read_( nullptr ) );
    
    	::munmap( ptr, 16*1024 );
    
    	return 0;
    }
    

    $ ./a.out
    x = 123
    address = 0xffffffffffffffff
    Segmentation fault
    $ sudo ./a.out
    Password: hunter2
    x = 123
    address = (nil)
    *nullptr = 456

     
    Program does what you expect it to do, which includes reading from nullptr.

    I mean, I don't really care. Except that the back and forth of "you're dumb. No you're dumb. You can't read. No, you can't read (ad nauseum)" is really getting old. And it's usually those same two people. Neither of whom is dumb and both of whom can, in fact, read. And have proven themselves as such in the past. Just not where the other is concerned.

    RFP: A site plugin that allows Our God Emporer or his designees to add pairs of people to the "Auto Rosie List", at which point all post chains involving more than 2 replies exclusively between them are automatically replaced with Rosie images.

    I think the last time Blakey suggested something like that and I liked the idea, he rage-quit because I previously called him an idiot and you can't agree/disagree only with some ideas.

    Not sure what's the point here, other than maybe be careful or I'll agree with you? :thonking: :thonking:

    Oh noes, I must now commit sudoko, as I have suggested a topspin approved idea!!!


  • Banned

    @cvi said in Visual Studio WTF:

    Edit - the following went missing: However, is the program fine? No, if you're not careful, the optimizer will screw you over. GCC in fact does this on purpose, if it ever realizes what you're up to. If you let GCC do that, it will insert a ud2 instruction = undefined instructions / invalid opcode, which will bring your program down by default.

    There was an actual security vulnerability in Linux kernel that allowed any user to get root privileges, that was caused by GCC optimizing out one null check deep inside the kernel where address 0 is a regular address that can be read from and written to without issue. IIRC it was an intentional backdoor.


  • Notification Spam Recipient

    Status: So, anyways, I wanted to report on a Visual Studio WTF when....

    I'm building a special DataGridView column type which draws a pretty bar instead of text. Everything was going fine, until Visual Studio decided...

    64283eb5-2da6-4fee-adf0-e64158564dba-image.png

    Uh, yeah, it can't be found because you haven't build it. Also, I can't save files anymore because saving files triggers this dialog which for some reason cancels the save.

    I guess the next thing I'm going to try is extracting this class to a separate DLL file or something...

    Edit: Oh, and the error that preceded the total fuckery:

    8514561f-5cc7-4906-b421-7690970213c1-image.png

    Apparently your whole class must be serializable? Maybe? Idk, something fucked up somewhere and I don't know where...

    For reference, this is the class it's complaining about:
    bbb7802b-07d3-483d-95d6-b18cd5762bd8-image.png

    Might make a Help topic if I can't figure it out...



  • @cvi said in Visual Studio WTF:

    Is address zero, which is the typical representation of a nullptr, special? Somewhat, but not too much. You can map memory at address zero "just fine":

    In many architectures, address 0 is part of a table of interrupt vectors (i.e., when an interrupt happens, the hardware looks there to find the code it's supposed to jump to). Some system code, 99% probably written in C, has to be able to write to address 0 to initialize that table. It may only need to write there during boot, but it's got to be able to rely on the compiler not barfing on a write to address 0.


  • ♿ (Parody)

    @cvi said in Visual Studio WTF:

    To be fair, the discussion by itself is a lot less retarded (if not very informative still) when you've read C++ committee people have similar discussions regarding UB and the topics surrounding it. You can always find people from the same groups: the purists, which operate on the premise that your compiler will screw you over given the slightest chance; the pragmatists, where if the program right now does what it's supposed to, everything is good, standard be damned. Truth is somewhere in-between, probably. Where exactly?

    A related topic is using undocumented functions. My personal story involves Oracle's WM_CONCAT. It was pretty much the only way to concatenate items from a group at the time, but it was undocumented and dangerous. In the same release where LISTAGG appeared, WM_CONCAT changed from returning a VARCHAR2 to returning a CLOB. Oops!

    Also, while WM_CONCAT supported using DISTINCT, LISTAGG does not, so we had to convert a bunch of code to add subqueries to get the distinctness sorted out. Ugh. But it worked really great until it didn't.



  • @GÄ…ska said in Visual Studio WTF:

    There was an actual security vulnerability in Linux kernel that allowed any user to get root privileges, that was caused by GCC optimizing out one null check deep inside the kernel where address 0 is a regular address that can be read from and written to without issue.

    Thinking by any chance of the following: https://lwn.net/Articles/342330/? Sounds very similar.



  • @boomzilla said in Visual Studio WTF:

    My personal story involves Oracle

    09cb0a5e-daf5-4d9e-b97d-2986cd883c50-image.png


  • Notification Spam Recipient

    @HardwareGeek said in Visual Studio WTF:

    @boomzilla said in Visual Studio WTF:

    My personal story involves Oracle

    09cb0a5e-daf5-4d9e-b97d-2986cd883c50-image.png

    Man, I love fucking headcrabs.....



  • @Tsaukpaetra I'm worried this statement might be intended literally.


  • Notification Spam Recipient

    @HardwareGeek said in Visual Studio WTF:

    @Tsaukpaetra I'm worried this statement might be intended literally.

    Depends on the breed.


  • Java Dev

    @boomzilla said in Visual Studio WTF:

    @cvi said in Visual Studio WTF:

    To be fair, the discussion by itself is a lot less retarded (if not very informative still) when you've read C++ committee people have similar discussions regarding UB and the topics surrounding it. You can always find people from the same groups: the purists, which operate on the premise that your compiler will screw you over given the slightest chance; the pragmatists, where if the program right now does what it's supposed to, everything is good, standard be damned. Truth is somewhere in-between, probably. Where exactly?

    A related topic is using undocumented functions. My personal story involves Oracle's WM_CONCAT. It was pretty much the only way to concatenate items from a group at the time, but it was undocumented and dangerous. In the same release where LISTAGG appeared, WM_CONCAT changed from returning a VARCHAR2 to returning a CLOB. Oops!

    Also, while WM_CONCAT supported using DISTINCT, LISTAGG does not, so we had to convert a bunch of code to add subqueries to get the distinctness sorted out. Ugh. But it worked really great until it didn't.

    Yup, we used that one too. And we've had at least 2 replacements since, currently because we need overflow behaviour which the standard one doesn't support. From db19 it does have distinct though.



  • @HardwareGeek said in Visual Studio WTF:

    In many architectures, address 0 is part of a table of interrupt vectors (i.e., when an interrupt happens, the hardware looks there to find the code it's supposed to jump to). Some system code, 99% probably written in C, has to be able to write to address 0 to initialize that table. It may only need to write there during boot, but it's got to be able to rely on the compiler not barfing on a write to address 0.

    I've only worked with a fairly limited number of different chips, and those always had their interrupt vectors in random places (one exception that placed it such that the last element was at 0xFFFF). I've always wondered why people wouldn't just place then at 0. But apparently people do.

    There's the other ... interesting feature. In C/C++ the null pointer doesn't have to correspond to memory address 0. It could just as well be ~0 or anything else. I think I've even seen that behaviour with NULL pointers to special scratch/shared memory regions (but those pointers were kinda special, i.e., they didn't live in the same space as ordinary pointers).


  • Considered Harmful

    @Benjamin-Hall said in Visual Studio WTF:

    Neither of whom is dumb and both of whom can, in fact, read.

    I contest this specific but agree with the general thrust of your argument.


  • Banned

    @cvi said in Visual Studio WTF:

    There's the other ... interesting feature. In C/C++ the null pointer doesn't have to correspond to memory address 0. It could just as well be ~0 or anything else.

    While technically true, the standard also requires the integer constant 0 to convert to a null pointer, whatever address it may be.


  • Java Dev

    @GÄ…ska said in Visual Studio WTF:

    @cvi said in Visual Studio WTF:

    There's the other ... interesting feature. In C/C++ the null pointer doesn't have to correspond to memory address 0. It could just as well be ~0 or anything else.

    While technically true, the standard also requires the integer 0 to convert to a null pointer, whatever address it may be.

    Isn't that the only integer literal which is required to convert to a pointer?


  • Banned

    @PleegWat C17 standard section 6.3.2.3 paragraphs 5 and 6 allow conversions between pointers and integers, but the result is implementation-defined. Section 7.20.1.4 defines types intptr_t and uintptr_t, which are optional for an implementation, but if they're available, the round-trip conversion is guaranteed to be equal to the original pointer.

    Didn't check C++ spec, but I'm pretty sure it's the same, and the intptr_t and uintptr_t types are defined there too.

    Also, a small correction to previous post: the integer constant 0 converts to a null pointer, not any integer 0.

    Edit: checked C++ spec. The C++20 standard section 7.6.1.9 allows pointer conversions in basically the same way as above, although the wording is somewhat different (it's not just uintptr_t, it's every "integer type of sufficient size").


  • kills Dumbledore

    @GÄ…ska said in Visual Studio WTF:

    I hate talking to you

    Could have fooled me


  • Notification Spam Recipient

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...


  • Considered Harmful

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.


  • Notification Spam Recipient

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...


  • Considered Harmful

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate


  • Notification Spam Recipient

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....


  • Considered Harmful

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked


  • Notification Spam Recipient

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked

    Now if only it felt good...


  • Considered Harmful

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked

    Now if only it felt good...

    Try a more modern language. With sweet enough syntactic sugar and/or appropriate IDE support it can feel pretty good.


  • Considered Harmful

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked

    Now if only it felt good...

    Try a more modern language. With sweet enough syntactic sugar and/or appropriate IDE support it can feel pretty good.

    Another thing that can screw this up (assuming this is actually a serialization vs a type erasure-then-conversion issue) is if the serialization framework/... likes to insert wrapper objects then forget it did so - is there actually serialization happening?

    Then maybe there's really fun stuff, like, CustomTextTranslation comes from more than one package, or from the same package but more than one classloader.

    Is CustomTextTranslation a concrete type? An interface? Does it relate to a TextTranslation and StandardTextTranslation? etc etc.


  • Notification Spam Recipient

    @Gribnit said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked

    Now if only it felt good...

    Try a more modern language. With sweet enough syntactic sugar and/or appropriate IDE support it can feel pretty good.

    Another thing that can screw this up (assuming this is actually a serialization vs a type erasure-then-conversion issue) is if the serialization framework/... likes to insert wrapper objects then forget it did so - is there actually serialization happening?

    It's being done automagically in the Designer. Behind the scenes, it's adding a resource in Form1.resx and deserializing it whenever I come back to the designer (and presumably when the app runs).


  • Considered Harmful

    @Gribnit said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked

    Now if only it felt good...

    Try a more modern language. With sweet enough syntactic sugar and/or appropriate IDE support it can feel pretty good.

    Another thing that can screw this up (assuming this is actually a serialization vs a type erasure-then-conversion issue) is if the serialization framework/... likes to insert wrapper objects then forget it did so - is there actually serialization happening?

    Then maybe there's really fun stuff, like, CustomTextTranslation comes from more than one package, or from the same package but more than one classloader.

    Is CustomTextTranslation a concrete type? An interface? Does it relate to a TextTranslation and StandardTextTranslation? etc etc.

    OOOOOHH. Is CustomTextTranslation an inner class of yon ProgressColumn? B/c if it is, it can't be instantiated without a reference to an enclosing instance which it has just about no way to get, during deserialization. If that's happening. If it's (the equivalent of) a static class this doesn't apply


  • Notification Spam Recipient

    @Gribnit said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked

    Now if only it felt good...

    Try a more modern language. With sweet enough syntactic sugar and/or appropriate IDE support it can feel pretty good.

    Another thing that can screw this up (assuming this is actually a serialization vs a type erasure-then-conversion issue) is if the serialization framework/... likes to insert wrapper objects then forget it did so - is there actually serialization happening?

    Then maybe there's really fun stuff, like, CustomTextTranslation comes from more than one package, or from the same package but more than one classloader.

    Is CustomTextTranslation a concrete type? An interface? Does it relate to a TextTranslation and StandardTextTranslation? etc etc.

    OOOOOHH. Is CustomTextTranslation an inner class of yon ProgressColumn? B/c if it is, it can't be instantiated without a reference to an enclosing instance which it has just about no way to get, during deserialization. If that's happening.

    No, it's a top-level class in the library's namespace.

    @Tsaukpaetra said in Visual Studio WTF:

    For reference, this is the class it's complaining about:
    bbb7802b-07d3-483d-95d6-b18cd5762bd8-image.png


  • Considered Harmful

    @Gribnit said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked

    Now if only it felt good...

    Try a more modern language. With sweet enough syntactic sugar and/or appropriate IDE support it can feel pretty good.

    Another thing that can screw this up (assuming this is actually a serialization vs a type erasure-then-conversion issue) is if the serialization framework/... likes to insert wrapper objects then forget it did so - is there actually serialization happening?

    Then maybe there's really fun stuff, like, CustomTextTranslation comes from more than one package, or from the same package but more than one classloader.

    Is CustomTextTranslation a concrete type? An interface? Does it relate to a TextTranslation and StandardTextTranslation? etc etc.

    OOOOOHH. Is CustomTextTranslation an inner class of yon ProgressColumn? B/c if it is, it can't be instantiated without a reference to an enclosing instance which it has just about no way to get, during deserialization. If that's happening. If it's (the equivalent of) a static class this doesn't apply

    Does w/e language this is have some dumbass bullshit like a serializationVersionUid?


  • Considered Harmful

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    Are those the erased types or the full generic specializations? Don't remember anything about the reification story in C#.

    No fucking clue what you're asking. The wanted type is a List<CustomTextTranslation>() which I suppose serializes to a normal array. But why it can't re-serialize itself is beyond me...

    Probly because it has no idea what concrete CustomTextTranslation type to instantiate

    There's only one....

    You're fucked

    Now if only it felt good...

    Try a more modern language. With sweet enough syntactic sugar and/or appropriate IDE support it can feel pretty good.

    Another thing that can screw this up (assuming this is actually a serialization vs a type erasure-then-conversion issue) is if the serialization framework/... likes to insert wrapper objects then forget it did so - is there actually serialization happening?

    Then maybe there's really fun stuff, like, CustomTextTranslation comes from more than one package, or from the same package but more than one classloader.

    Is CustomTextTranslation a concrete type? An interface? Does it relate to a TextTranslation and StandardTextTranslation? etc etc.

    OOOOOHH. Is CustomTextTranslation an inner class of yon ProgressColumn? B/c if it is, it can't be instantiated without a reference to an enclosing instance which it has just about no way to get, during deserialization. If that's happening.

    No, it's a top-level class in the library's namespace.

    @Tsaukpaetra said in Visual Studio WTF:

    For reference, this is the class it's complaining about:
    bbb7802b-07d3-483d-95d6-b18cd5762bd8-image.png

    What's a namespace? Does that have state, is there some instance that "is" a namespace? Probably not I hope not.


  • Notification Spam Recipient

    @Gribnit said in Visual Studio WTF:

    What's a namespace?

    A good question. Does a namespace bleed the first time it's penetrated?


  • Considered Harmful

    @Tsaukpaetra said in Visual Studio WTF:

    @Gribnit said in Visual Studio WTF:

    What's a namespace?

    A good question. Does a namespace bleed the first time it's penetrated?

    I do not assume so and regret that I cannot confirm that there is a pun here that depends on knowledge of a language I do not know.


  • Notification Spam Recipient

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    And deserialization obviously is working because the actual program when running does it just fine...

    8f04f2d7-0594-4ccb-9d20-ffca9b2510d2-image.png

    What the fuck...


  • Considered Harmful

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    And deserialization obviously is working because the actual program when running does it just fine...

    8f04f2d7-0594-4ccb-9d20-ffca9b2510d2-image.png

    What the fuck...

    so... I've seen dissimilar but comparable fuckery when dealing with JPA in a debugger
    could be, an implied operation ends up seeing some raw/proxied shit vs what it expected
    this only happens in a what context? build? debug?

    I will have to stop helping if this goes to help because I am not capable of not swearing if helping or of using a thread for any intended purpose.



  • @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    And deserialization obviously is working because the actual program when running does it just fine...

    8f04f2d7-0594-4ccb-9d20-ffca9b2510d2-image.png

    What the fuck...

    Mostly unrelated, but I had an issue with XCode. Turns out that its designer uses an entirely separate set of constructors for views from the actual runtime. So if you want to have your custom views show up in the designer right, you have to override both sets of constructors. Except that fact is buried in Stack Overflow questions, not anywhere in the documentation.

    Oh, and it hates deserializing JSON null. It's fine with missing keys, happily converting them to Optional<> elements. But if you have

    {
    "foo": null
    ...
    }
    

    It completely barfs, even if your corresponding data structure has that marked as optional. You have to write custom deserialization logic to attempt to get the key and if it doesn't deserialize, stuff nil into the variable.

    Moral: serialization sucks. Visual designers suck. Apple sucks.


  • Considered Harmful

    @Benjamin-Hall said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    And deserialization obviously is working because the actual program when running does it just fine...

    8f04f2d7-0594-4ccb-9d20-ffca9b2510d2-image.png

    What the fuck...

    Mostly unrelated, but I had an issue with XCode. Turns out that its designer uses an entirely separate set of constructors for views from the actual runtime. So if you want to have your custom views show up in the designer right, you have to override both sets of constructors. Except that fact is buried in Stack Overflow questions, not anywhere in the documentation.

    Oh, and it hates deserializing JSON null. It's fine with missing keys, happily converting them to Optional<> elements. But if you have

    {
    "foo": null
    ...
    }
    

    It completely barfs, even if your corresponding data structure has that marked as optional. You have to write custom deserialization logic to attempt to get the key and if it doesn't deserialize, stuff nil into the variable.

    Moral: serialization sucks. Visual designers suck. Apple sucks.

    yeah honestly if I'd known at the start you were using a form designer I'd never have tried to help, as when those trip on their dicks you are truly among the damned, and then there's the being among the damned to begin with if they derped it so hard on the UI library that humans can't use it from code sanely.


  • Considered Harmful

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    And deserialization obviously is working because the actual program when running does it just fine...

    8f04f2d7-0594-4ccb-9d20-ffca9b2510d2-image.png

    What the fuck...

    Either you won or it killed you, at this point. Did you win?

    Does that Ignore and continue? prompt indicate a debug context? If(f) you have break-on-all enabled in a debugger and the library is fucktarded enough to be using exceptions in normal operation (UI libraries love this!) this might just be debug noise. Usually you can set filters for break-on-exception to only apply your own scopes?

    Is that even your type? Are you rolling your own i18n or something? Thought that like C# had stole message bundles on the way out at least.


  • Notification Spam Recipient

    @Gribnit said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    @Tsaukpaetra said in Visual Studio WTF:

    Might make a Help topic if I can't figure it out...

    Frustration levels increasing, almost at the trigger level...

    11bfb91e-d4d5-433b-9218-8735e11af51a-image.png

    Yeah, object of the type it wants can't be converted into type it wants. :wtf-whistling:

    Nothing to see here...

    And deserialization obviously is working because the actual program when running does it just fine...

    8f04f2d7-0594-4ccb-9d20-ffca9b2510d2-image.png

    What the fuck...

    Either you won or it killed you, at this point. Did you win?

    I won enough. Apparently there's a property decorator that tells it to serialize the contents of the property as opposed to the property itself (:wtf_owl: ). I'm not sure if that's the proper solution, but it seems to work so I'm running with it until the next fuckery happens. :mlp_shrug:

    Edit: The decoration is [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]

    Does that Ignore and continue? prompt indicate a debug context? If(f) you have break-on-all enabled in a debugger and the library is fucktarded enough to be using exceptions in normal operation (UI libraries love this!) this might just be debug noise. Usually you can set filters for break-on-exception to only apply your own scopes?

    No, there is no debugger breakpoints for the designer, because it can't debug itself. I suppose I could set up another instance of Visual Studio and attach it to Visual Studio to see if that works, but :kneeling_warthog:

    In this case, "Ignore and Continue" just means "Fuck up everything, and pray you don't save because it will save an empty form haha hope you didn't need anything in it"

    Is that even your type? Are you rolling your own i18n or something? Thought that like C# had stole message bundles on the way out at least.

    Yes it's my type, as indicated by my prior messages. Not doing anything fancy, I just want to be able to show some predefined messages in my progress bar thing. No internationalization needed, because this little tool is not going to be used by anything else.



  • Not really a WTF, but close enough...

    Installing the update and just happened to look at this moment:

    1,022KB of ...
    1,023KB of ...
    1.00GB of ...
    1.01GB of ...


  • Discourse touched me in a no-no place

    @dcon said in Visual Studio WTF:

    Not really a WTF, but close enough...

    Installing the update and just happened to look at this moment:

    1,022KB of ...
    1,023KB of ...
    1.00GB of ...
    1.01GB of ...

    🤩 They're using the units correctly!



  • @dkf Give or take 3 orders of magnitude.


  • Notification Spam Recipient

    Status: TIL that "installing" really means "uninstalling"...

    26ad2398-9e23-4b1c-95bc-459d520b8374-image.png


  • Considered Harmful

    @Tsaukpaetra Meanwhile, every InstallShield uninstaller ever: "Copying new files..."



  • (yes, 👃 👶, I want to fbmac this thread, there's no way I'm gonna pay the new-thread tax)

    So I have a problem, I want to change where some special string is used, so I search for all occurrences. And because it's complicated I use a regexp search. So of course now I have (at least) two problems. Ah ah ah I'm so funny.

    Anyway. After some fumbling around, I end up with my regexp, "([^"]*_|)E(_[^"]*|)". A string ("...") that contains a E that is either at the start/end of the string, or separated by _. I want to match e.g. "foo_E" or "foo_E_bar" but not "foo_Ebar", because I want places where E is used as a special bit of the string rather than as part of a word (such as Equation, for example).

    OK, that works, "Find All", let's go through all the occurrences and change them.

    That's not absolutely perfect, there are still a couple of false positives. For example, "foo" + string_var_with_E_in_name + "bar" matches because there are " on both sides of the _E_ but the _E_ is not actually within a string (which is what I'm looking for), yeah, OK, no big deal, it's just editing code, I can just ignore those.

    But there are a few other false positives:

    QList<SomeType> var_name = foo->getSomeTypeList("attribute_units");

    Uh... I know regexps are confusing so maybe there's a weird way it's matching (and before you ask, I checked and I did make sure that my regexp was case-sensitive, so e shouldn't match), but... :sideways_owl:

    But wait, there is more!

    ")";

    Yup. This is a very long string (a mathematical equation) split over several lines, one of those lines is this. No, the previous lines do not end with \ (which could confuse the search as to what a "line" is). Though there are some \ in the previous lines, but those are to protect some chars inside the strings (typically " itself... yeah it's ugly). But still.

    :wtf_owl:

    WTF VS, are you drunk?

    Oh and of course (???), changing E by another lettre (e.g. "([^"]*_|)R(_[^"]*|)", or B, or whatever) in the regexp no longer matches that line, nor does it produce any of the other weird matches. But of course again, VS doc doesn't say that E is a special character in regexps (and I've never been that it is, in any regexp flavour?).

    Best of all, while "Find All" lists those lines, when I open them they are not highlighted, i.e. they do not match the regexp. But they're found by "Find All". Go figure...

    :wtf: :wtf:


  • Considered Harmful

    @remi

    regexp

    mathematical equation

    ZALGO ACCEPTS YOUR SOUL


Log in to reply