All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Sarvela <tomi.p.sarvela@intel.com>
To: Martin Peres <martin.peres@linux.intel.com>,
	Petri Latvala <petri.latvala@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] (no subject)
Date: Thu, 27 Sep 2018 08:57:02 +0300	[thread overview]
Message-ID: <249a481a-b1b3-9c57-0890-d66e8831f92a@intel.com> (raw)
In-Reply-To: <90b90682-13fd-b962-cdfa-a93d8b95f6f9@linux.intel.com>

On 9/26/18 5:58 PM, Martin Peres wrote:
> On 26/09/2018 15:24, Petri Latvala wrote:
>> CI pipeline (namely, cibuglog) doesn't cope well with strings that
>> have \0 in them. If null characters appear in output files, pretend
>> the output stops at the first such character. Well behaving tests
>> should not print them anyway.
>>
>> The case in CI happened due to some hang/crash/explosion/solar flare
>> that corrupted the output of a test.
>>
>> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
>> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
>> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
>> Cc: Martin Peres <martin.peres@linux.intel.com>
> 
> Acked-by: Martin Peres <martin.peres@linux.intel.com>

The original reason was very probably a hang/panic/reboot before flushed 
fd was written to the disk. Result was about one lines worth of NULLs 
(which, in itself, shows that the logwriter is significantly more 
careful than piglits one).

If the expectation is that the out/err files are text, I think runner 
can safely discard the rest from any indication of data corruption.

Acked-by: Tomi Sarvela <tomi.p.sarvela@intel.com>

> 
>> ---
>>   runner/resultgen.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/runner/resultgen.c b/runner/resultgen.c
>> index d34b52db..e8a60083 100644
>> --- a/runner/resultgen.c
>> +++ b/runner/resultgen.c
>> @@ -313,7 +313,7 @@ static bool fill_from_output(int fd, const char *binary, const char *key,
>>   			     struct subtests *subtests,
>>   			     struct json_object *tests)
>>   {
>> -	char *buf, *bufend;
>> +	char *buf, *bufend, *nullchr;
>>   	struct stat statbuf;
>>   	char piglit_name[256];
>>   	char *igt_version = NULL;
>> @@ -332,6 +332,14 @@ static bool fill_from_output(int fd, const char *binary, const char *key,
>>   		buf = NULL;
>>   	}
>>   
>> +	/*
>> +	 * Avoid null characters: Just pretend the output stops at the
>> +	 * first such character, if any.
>> +	 */
>> +	if ((nullchr = memchr(buf, '\0', statbuf.st_size)) != NULL) {
>> +		statbuf.st_size = nullchr - buf;
>> +	}
>> +
>>   	bufend = buf + statbuf.st_size;
>>   
>>   	igt_version = find_line_starting_with(buf, IGT_VERSIONSTRING, bufend);
>>
> 


Tomi
-- 
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-09-27  6:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 13:24 [igt-dev] [PATCH i-g-t 1/1] runner: Avoid null characters in results.json Petri Latvala
2018-09-26 14:58 ` Martin Peres
2018-09-27  5:57   ` Tomi Sarvela [this message]
2018-09-26 16:30 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/1] " Patchwork
2018-09-26 22:19 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=249a481a-b1b3-9c57-0890-d66e8831f92a@intel.com \
    --to=tomi.p.sarvela@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=martin.peres@linux.intel.com \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.