Bug 12210 – dlang.org home page example - Run button does not work

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-19T21:36:00Z
Last change time
2016-01-10T20:26:19Z
Assigned to
nazriel
Creator
gassa
Depends on
15050, 15051

Comments

Comment #0 by gassa — 2014-02-19T21:36:08Z
The example on the main page (http://dlang.org) has several buttons below. When I hit "Run", it gives "Compilation result: 9 (killed)" after a few seconds. Editing shows that the compilation works only if there are no imports. Still, the given example, and virtually every other useful one, needs std.stdio to show something.
Comment #1 by gassa — 2014-02-20T01:15:22Z
A few hours from the report, and the example's working again. Still, was the root cause eliminated?
Comment #2 by gassa — 2014-02-20T01:28:46Z
Correction: it still does not work 100%. New hypothesis: the compilation often times out for harder cases. I've managed to run an empty program 10/10 times successfully: ----- void main () {} ----- But only 4/10 times for this example: ----- import std.algorithm, std.bigint, std.range, std.stdio; void main () {BigInt (123).repeat (321).reduce !((a, b) => a * b).writeln;} ----- Obviously, it depends on the server load (and thus time of day) as well. Still, having an unresponsive example snippet on the main page is, well, bad.
Comment #3 by andrej.mitrovich — 2014-04-22T21:11:15Z
*** Issue 11498 has been marked as a duplicate of this issue. ***
Comment #4 by schveiguy — 2015-09-11T18:07:59Z
*** Issue 15040 has been marked as a duplicate of this issue. ***
Comment #5 by jansen.gerald — 2015-09-11T18:50:13Z
Okay, so the sample programs often fail to run for timeout or lack of memory and this has been ongoing(?) since November 2013. How could a visitor take a language seriously if the demonstration utility offered front and centre on its home page fails to run even on small examples? Either the server should be upgraded to provide adequate resources or the "feature" should be removed.
Comment #6 by dlang-bugzilla — 2015-09-11T19:03:31Z
The problems you are seeing started recently, see here: http://forum.dlang.org/post/[email protected]
Comment #7 by jansen.gerald — 2015-09-11T19:32:03Z
Ah. Sorry for the noise then. Keep up the good work!
Comment #8 by schveiguy — 2015-09-11T19:34:14Z
(In reply to Vladimir Panteleev from comment #6) > The problems you are seeing started recently I don't think the compiler upgrade caused the issues, perhaps it fixes the ability to compile some of the code which required a newer compiler, but it appears that the out of memory errors are not new. I honestly don't know, as I have no idea how to test this.
Comment #9 by jansen.gerald — 2015-09-12T08:09:30Z
Perhaps this is a slightly different issue but it is related so I'll just mention it here. The example in the section "Convenience" under the paragraph starting with "Automatic memory management makes for safe, simple, and robust code.", crashes with message: Application output: (1 Hangup) Exiting main. std.exception.ErrnoException@std/stdio.d(385): Cannot open file `text.txt' in mode `rb' (No such file or directory) ---------------- ... and a bunch of incomprehensible junk (for a casual visitor) Having examples that don't run is probably worse than no examples. Perhaps the priority of this issue should be increased. Perhaps the more general issue is how to continuously test and ensure that all example code highlighted on dlang.org runs correctly.
Comment #10 by dlang-bugzilla — 2015-09-12T18:18:41Z
Some fixes: https://github.com/D-Programming-Language/dlang.org/pull/1098 Some issues are still blocked on some DPaste-specific problems. (In reply to Gerald Jansen from comment #9) > Perhaps this is a slightly different issue but it is related so I'll just > mention it here. The example in the section "Convenience" under the > paragraph starting with "Automatic memory management makes for safe, simple, > and robust code.", crashes with message: > > Application output: (1 Hangup) > Exiting main. > std.exception.ErrnoException@std/stdio.d(385): Cannot open file `text.txt' > in mode `rb' (No such file or directory) > ---------------- > ... and a bunch of incomprehensible junk (for a casual visitor) > > Having examples that don't run is probably worse than no examples. Perhaps > the priority of this issue should be increased. Perhaps the more general > issue is how to continuously test and ensure that all example code > highlighted on dlang.org runs correctly. The example is correct, and works as expected in the absence of a text.txt file. It is meant to illustrate RAII, there isn't much value in including it in Edit-and-Run, so I added support for excluding examples and excluded it.
Comment #11 by nazriel — 2015-09-30T00:24:33Z
Fix is in progress. See http://forum.dlang.org/post/[email protected] for details.
Comment #12 by jansen.gerald — 2015-11-10T14:55:50Z
The "Round floating point numbers" example is too fragile. It vomits incomprehensible messages (not a pretty sight for casual visitors!) for almost any input except for one or more floating point numbers separated by a single space. The default input line "2.4 plus 2.4 ..." causes the crash, for example. So does any extra leading, trailing or embedded white-space. (Interestingly, input "2.4 2.4e9" doesn't crash, but only rounds the first number.)
Comment #13 by dlang-bugzilla — 2015-11-10T15:02:08Z
(In reply to Gerald Jansen from comment #12) > The "Round floating point numbers" example is too fragile. See issue 15050
Comment #14 by jansen.gerald — 2015-11-10T15:11:22Z
(In reply to Vladimir Panteleev from comment #13) > (In reply to Gerald Jansen from comment #12) > > The "Round floating point numbers" example is too fragile. > > See issue 15050 I think this is a different issue as it also happens with filled Input but empty Args. Probably the regular expression is not adequate.
Comment #15 by jansen.gerald — 2016-01-10T20:26:19Z
All the examples on the Home page with a Run button now seem to be compiling and running correctly.