
50 Bytes of Code That Took 4 GB to Compile (2013) - dotnetnews
https://randomascii.wordpress.com/2013/08/14/50-bytes-of-code-that-took-4-gb-to-compile/
======
bluetomcat
I have accidentally discovered a bug in Clang that causes the compiler
generate millions of consecutive "addq $2147483647, %rsp" instructions and it
wouldn't terminate maybe in hours (it could probably be an infinite loop, I
haven't seen it terminate):

    
    
        $ clang --version
        Apple LLVM version 8.0.0 (clang-800.0.38)
        Target: x86_64-apple-darwin16.4.0
        ...
        $ cat test.c
        #include <stdint.h>
    
        int main(void) {
            int x[SIZE_MAX / 31];
            return 0;
        }
        $ clang test.c
        test.c:5:11: error: array is too large (595056260442243600 elements)
        int x[SIZE_MAX / 31];
        $ cat test-2.c
        #include <stdint.h>
    
        int main(void) {
            int x[SIZE_MAX / 32];
            return 0;
        }
        $ clang test-2.c
        ... Keep waiting :-) ...

~~~
sdardis
[http://bugs.llvm.org/show_bug.cgi?id=31962](http://bugs.llvm.org/show_bug.cgi?id=31962)

------
Stratoscope
...that took 4GB to compile _in VS2010._

~~~
blackflame7000
VS2010 is slightly more impactful than other versions because that is the
latest version of the IDE before the transition to C++11 standard. The
conversion from a 2010 to a 2013 solution is much more complicated than say a
2013 to a 2015 conversion for example.

~~~
Stratoscope
No disagreement on any of that. I was mostly wondering who uses VS2010
anymore, and curious to know if the bug still exists in newer versions of
Visual Studio (but not curious enough to bother testing it).

~~~
blackflame7000
Yea at my work we have some legacy solutions that depend on libraries that
were built with the 2010 compiler but the source is not available and the
library shares stl containers on the boundaries. Therefore we're forced to
create wrapper libraries that encapsulate the 2010lib and use things like
char* ptrs instead of strings on the library API. Those wrapper libraries need
to use the 2010 compiler and then we can add those libraries to our modern
solutions without having mismatched definitions of stl containers.

------
pjc50
See also previous work in this area:
[https://news.ycombinator.com/item?id=7127821](https://news.ycombinator.com/item?id=7127821)
"Results of the Grand C++ Error Explosion Competition"

------
pryelluw
@mods

An account with the same username as OP was allegedly spamming r/programming.

[https://www.reddit.com/r/programming/comments/5t7akn/50_byte...](https://www.reddit.com/r/programming/comments/5t7akn/50_bytes_of_code_that_took_4_gb_to_compile/ddknrfu/?utm_content=permalink&utm_medium=front&utm_source=reddit&utm_name=programming)

~~~
eganist
Not even alleged anymore. The account's been shadowbanned
([https://www.reddit.com/user/dotnetnews](https://www.reddit.com/user/dotnetnews)),
a confirmation from Reddit admins that they've validated it as a spam/bot
account.

And yet this post is back up, which means someone vouched for it.

Flagged it.

~~~
KirinDave
I vouched it, and I am sure I am among others.

1\. Reddit's moderators can make their own decisions, but that should not
change things here. It's an untrustworthy site with a culture and moderation
system that rewards untrustworthy users. If it went out of business tomorrow
the world would be a better place.

2\. The article is genuinely interesting.

3\. If all he bot does is link us to genuinely interesting back catalog .net
writing, that's probably a service (at least for now) as this venue has long
ignored a lot of interesting content from that ecosystem.

People can break the rules here and then we'll ban them here.

~~~
Jillboy
I agree with all your points, except for one thing that made me curious:

Why would say Reddit is an untrustworthy site, with a system that rewards
untrustworthy users? I'm not a particularly active Reddit user, in fact it's
been a while since I've even visited the site so I'm not taking this
personally at all, but I'm genuinely interested as to why anyone would
consider it an untrustworthy site that encourages untrustworthy users.

~~~
mi100hael
There have been a lot of shenanigans from the admins/mods over the past year
or so, mostly related to the popularity of the pro-Trump subreddit and their
resulting chagrin. There have been several thinly-veiled rule changes and
algorithm changes aimed at reducing the number of pro-Trump postings that
appear on the main homepage and generally lowering the visibility of that
subreddit. At one point, the CEO manually edited some comments in the database
that were critical of him. It all comes across as somewhat shady and
untrustworthy. They could just come out and ban or quarantine the subreddit,
but instead they've chose to subversively go Digg-mode and essentially start
curating what users see rather than allowing it to rise/fall organically.

~~~
kbenson
> There have been several thinly-veiled rule changes and algorithm changes
> aimed at reducing the number of pro-Trump postings that appear on the main
> homepage and generally lowering the visibility of that subreddit.

It's worth noting that there's nothing _inherently_ bad about this. Possible
valid reasons why this step might be taken include gaming of the algorithm by
specific groups, or to even out the distribution of front page items is one of
the goals for the algorithm is to have a heterogeneous set of items for the
front page. Not that I have any specific information in this case to point one
way or the other. I just think it's important to not immediately jump to
negative conclusions about that, even if a group that experiences some loss of
exposure feels negatively affected.

> At one point, the CEO manually edited some comments in the database that
> were critical of him.

 _That_ part is pretty egregious, and while I understand the impulse to do
what he did if we take his explanation at face value (I don'[t see a
particular reason why not to, it's not flattering), one would hope someone as
high up in the organization would understand that playing with the trust of
your userbase that way ( _especially_ with the group in question) is not
likely to end well.

> They could just come out and ban or quarantine the subreddit, but instead
> they've chose to subversively go Digg-mode and essentially start curating
> what users see rather than allowing it to rise/fall organically.

I'm not specifically aware of what steps they are taking now. Do you have
references to point me towards so I can catch up?

~~~
KirinDave
Many pro-Trump comments get swept out in botnet purges, because the pro-Trump
segment has some actors who are very busy amplifying their voice via
sockpuppet accounts to quiet any dissent or discussion on that subreddit.

Try this: post a positive comment about a policy change there. They also talk
openly about using multiple identities to control what is allowed to the top.
If you watch the "new" section you can see negative or even just not-content-
free stories get added often.

There are folks on various forums and IRC channels who will sell you good
placement of a story on reddit for a reasonable sum of bitcoin now. It'd be
interesting to enlist them to start getting policy questions onto the top of
that subreddit.

