Example #1
0
static void
report_bug(const char *file, int line, const char *fmt, va_list args)
{
    /* SIGSEGV handler might have a very small stack. Thus we need to use it carefully. */
    char buf[256];
    FILE *out = stderr;
    int len = err_position_0(buf, 256, file, line);

    if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len ||
	(ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {

	fputs("[BUG] ", out);
	vsnprintf(buf, 256, fmt, args);
	fputs(buf, out);
	snprintf(buf, 256, "\n%s\n\n", ruby_description);
	fputs(buf, out);

	rb_vm_bugreport();

	/* call additional bug reporters */
	{
	    int i;
	    for (i=0; i<bug_reporters_size; i++) {
		struct bug_reporters *reporter = &bug_reporters[i];
		(*reporter->func)(out, reporter->data);
	    }
	}
	fprintf(out, REPORTBUG_MSG);
    }
}
Example #2
0
static void
report_bug(const char *file, int line, const char *fmt, va_list args)
{
    char buf[BUFSIZ];
    FILE *out = stderr;
    int len = err_position_0(buf, BUFSIZ, file, line);

    if (fwrite(buf, 1, len, out) == len ||
	fwrite(buf, 1, len, (out = stdout)) == len) {
	fputs("[BUG] ", out);
	vfprintf(out, fmt, args);
	fprintf(out, "\n%s\n\n", ruby_description);
	rb_vm_bugreport();
    }
}
static void
report_bug(const char *file, int line, const char *fmt, va_list args)
{
    /* SIGSEGV handler might have a very small stack. Thus we need to use it carefully. */
    char buf[256];
    FILE *out = stderr;
    int len = err_position_0(buf, 256, file, line);

    if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len ||
	(ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {

	fputs("[BUG] ", out);
	vfprintf(out, fmt, args);
	fprintf(out, "\n%s\n\n", ruby_description);

	rb_vm_bugreport();

	fprintf(out, REPORTBUG_MSG);
    }
}
Example #4
0
static void
report_bug(const char *file, int line, const char *fmt, va_list args)
{
    char buf[BUFSIZ];
    FILE *out = stderr;
    int len = err_position_0(buf, BUFSIZ, file, line);

    if (fwrite(buf, 1, len, out) == len ||
	fwrite(buf, 1, len, (out = stdout)) == len) {

	fputs("[BUG] ", out);
	vfprintf(out, fmt, args);
	fprintf(out, "\n%s\n\n", ruby_description);

	rb_vm_bugreport();

	fprintf(out,
		"[NOTE]\n"
		"You may encounter a bug of Ruby interpreter. Bug reports are welcome.\n"
		"For details: http://www.ruby-lang.org/bugreport.html\n\n");
    }
}