HNHacker News
TopNewBestAskShowJobs

danieljh

305 karma · joined September 24, 2013

Hej!
submissionscomments
danieljh··on The Following Code Causes Segfault in Clang
Yes, you're able to confirm this by setting:

    ulimit -s unlimited
danieljh··on The Following Code Causes Segfault in Clang
You are right in that the return is wrong and accidentally stayed in during example reduction down to a smaller version. Without it, the result is still the same.

The reason I was testing this was a discussion on IRC about functions decaying to pointer to functions, such that they are endlessly dereferenceable. The snippet above crashes GCC -- hard.

So, while the implementation is free not to handle 10^7 dereferencing operations, I'm not sure a hard crash is the right answer.

Here's a version without the return and using a lambda to shorten it further:

    python -S -c 'print("int main(){(" + "*"*10**7 + "+[]{})();}")' | g++ -std=c++11 -xc++ -
danieljh··on The Following Code Causes Segfault in Clang
While we're at segfaulting compiler's, here's what I found just a few days ago:

    python -S -c 'print("void f(){} int main(){return (" + "*"*10**7 + "f)();}")' | gcc -xc -
(This is legal C -- look it up. Don't argue with me over the practical relevance of this please)
danieljh··on Apple's SSL/TLS bug
Sure, the idea is not new. Using the compilers libraries and internal representation to re-format your code is new, though.

You want the compilers knowledge of the code for this, e.g. while formating C++ template mess.

There's a tight integration into the actual toolchains, which is a good thing.

danieljh··on Apple's SSL/TLS bug
Emerging tools such as gofmt and clang-format are able to automatically re-format your code based on the language rules rather than the human behind the monitor. Using those tools this specific category of issues should at least be visible in the formating diff.

Interesting. Never thought about it that way before.

danieljh··on CmdrTaco's Trove
Read the privacy policy first: http://info.trove.com/policies

One of the sad facts: "We do not honor Do Not Track requests."

← PreviousPage 2 of 2