RejectedSoftware Forums

Sign up

Pages: 1 2

Re: Understanding crashes

On Sun, 11 May 2014 17:06:59 GMT, Luís Marques wrote:

(PS: does anyone remember how to change the core dump file name template, so that the core dump is not overwritten for every crash?)

It is controlled by /proc/sys/kernel/core_pattern

Re: Understanding crashes

On Mon, 12 May 2014 02:49:39 GMT, Etienne Cimon wrote:

Try using auto sourceList = cmd.executeQuery!(string, "sha1", string, "title"); according to this example:

https://github.com/pszturmaj/ddb/blob/master/source/ddb/postgres.d#L1747

Thanks, that's nicer. The practical result is the same (modulo performance, perhaps?). And I would imagine that's unrelated to the crash, although it's hard to tell with a heisenbug like this, which has a long mean time between occurrences.

Re: Understanding crashes

On Sun, 11 May 2014 17:15:14 GMT, Luís Marques wrote:

On Sun, 11 May 2014 17:06:59 GMT, Luís Marques wrote:

    at darch.dt:15

Assuming the lines of diet templates are correctly preserved in the backtrace, we have:

13: - foreach(source; sourceList)
14:    li
15:        - auto url = "archeology/" ~ source.sha1;

The handler for that URL, which uses darch.dt is:

void darchHome(HTTPServerRequest req, HTTPServerResponse res)
{
	auto cmd = new PGCommand(pgdb, "SELECT sha1, title from darch_tests");
	auto sourceList = cmd.executeQuery!(Tuple!(string, "sha1", string, "title"))();
    scope(exit) sourceList.close();
    res.render!("darch.dt", sourceList);
}

I don't see anything obviously wrong there. Would it help if I put some kind of assert regarding the sourceList fields?

This may actually also be unrelated to the Postgre code. The stack trace in #470 is almost the same.

Re: Understanding crashes

On Mon, 12 May 2014 02:53:16 GMT, Etienne Cimon wrote:

On Mon, 12 May 2014 02:49:39 GMT, Etienne Cimon wrote:

Btw, I don't get errors when attempting to post without a full name nor account :/ - and posting anonymously failed without errors too?

Also over the newsgroup I get:

"A News (NNTP) error occurred: Not allowed to post with a foreign email address, please use simendsjo@gmail.com" (added underscores for bots..)

The errors display again now (there was an exception while the page was rendering).

That e-mail address isn't yours, right? Or rather, you are not authenticated using that address, right? Does that error occur consistently? It's definitely strange.

Re: Understanding crashes

I suggest you enable memory error handler:

import etc.linux.memoryerror;
registerMemoryErrorHandler();

Re: Understanding crashes

On Thu, 15 May 2014 05:53:55 GMT, Nikolay Tolstokulakov wrote:

I suggest you enable memory error handler:

import etc.linux.memoryerror;
registerMemoryErrorHandler();

Is that documented? (why not?)

Re: Understanding crashes

Am 19.05.2014 13:32, schrieb Luís Marques:

On Thu, 15 May 2014 05:53:55 GMT, Nikolay Tolstokulakov wrote:

I suggest you enable memory error handler:

import etc.linux.memoryerror;
registerMemoryErrorHandler();

Is that documented? (why not?)

Would also be nice to have that enabled by default.

Re: Understanding crashes

On Mon, 19 May 2014 15:52:20 +0200, Sönke Ludwig wrote:

Am 19.05.2014 13:32, schrieb Luís Marques:

On Thu, 15 May 2014 05:53:55 GMT, Nikolay Tolstokulakov wrote:

I suggest you enable memory error handler:

import etc.linux.memoryerror;
registerMemoryErrorHandler();

Is that documented? (why not?)

Would also be nice to have that enabled by default.

It can't be. It is not POSIX-compliant, not portable and can potentially corrupt your application on some systems. This is why it was rejected as an official part of standard library and is being kept as extra hidden module.

Re: Understanding crashes

It can't be. It is not POSIX-compliant, not portable and can potentially corrupt your application on some systems. This is why it was rejected as an official part of standard library and is being kept as extra hidden module.

But null pointer exception is very common mistake even for Dlang, and current reaction (silent core dump) is so bad for real life :(

I think, Vibe.d should handle it in some way before getting production ready status.

Re: Understanding crashes

Am 20.05.2014 00:52, schrieb Dicebot:

On Mon, 19 May 2014 15:52:20 +0200, Sönke Ludwig wrote:

Am 19.05.2014 13:32, schrieb Luís Marques:

On Thu, 15 May 2014 05:53:55 GMT, Nikolay Tolstokulakov wrote:

I suggest you enable memory error handler:

import etc.linux.memoryerror;
registerMemoryErrorHandler();

Is that documented? (why not?)

Would also be nice to have that enabled by default.

It can't be. It is not POSIX-compliant, not portable and can potentially corrupt your application on some systems. This is why it was rejected as an official part of standard library and is being kept as extra hidden module.

Good to know, thanks for the info. The question would be how portable it
is, though. The special Windows access violation handler definitely
isn't either. But if for example this would work stable on all X86-Linux
systems, then it could be an option to enable it only there (until
someone implements it for other systems).

Of course, if the register hacking is highly fragile and could break
with the next (or previous) libc or kernel version then that's not
possible. But in that case it should be documented how dangerous it is.
The thing is that it would be really handy to have by default for server
apps. Anyway, I'll just mention it in the vibe.d documentation for now.

Pages: 1 2