diff options
| author | Khem Raj <raj.khem@gmail.com> | 2020-12-20 22:18:01 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-12-21 22:29:57 +0000 |
| commit | a8af557839b5002536ab79ee45ab1b28cb3b27d8 (patch) | |
| tree | bd416af72cae09e9dd0031493ade05509c2415f5 | |
| parent | 8a67c61279b44c4ed75c34907bba46f8f826fa6d (diff) | |
| download | poky-a8af557839b5002536ab79ee45ab1b28cb3b27d8.tar.gz | |
ltp: Fix ltp-pan crash on 32bit arches using 64bit time_t
ltp-pan crashes on riscv32/musl due to shorter width assigned to time_t
in printf format
(From OE-Core rev: 7839481de7949d59e25113937c0b8901dc5b7425)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-extended/ltp/ltp/0001-ltp-pan-Use-long-long-int-to-print-time_t.patch | 33 | ||||
| -rw-r--r-- | meta/recipes-extended/ltp/ltp_20200930.bb | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-ltp-pan-Use-long-long-int-to-print-time_t.patch b/meta/recipes-extended/ltp/ltp/0001-ltp-pan-Use-long-long-int-to-print-time_t.patch new file mode 100644 index 0000000000..381ac417ca --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-ltp-pan-Use-long-long-int-to-print-time_t.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From 6c2085badea7b461245837c452a0d3d8a8c2afff Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sun, 20 Dec 2020 22:09:28 -0800 | ||
| 4 | Subject: [PATCH] ltp-pan: Use long long int to print time_t | ||
| 5 | |||
| 6 | Some newer 32bit architectures ( e.g. riscv32 ) uses 64bit time_t so | ||
| 7 | using %ld is not sufficient to print time_t, this also fixes a crash in | ||
| 8 | ltp-pan on riscv32 | ||
| 9 | |||
| 10 | Upstream-Status: Submitted [https://patchwork.ozlabs.org/project/ltp/patch/20201221061415.2540216-1-raj.khem@gmail.com/] | ||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | --- | ||
| 13 | pan/ltp-pan.c | 4 ++-- | ||
| 14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c | ||
| 17 | index 8b9fbe5594..54b7cb8f26 100644 | ||
| 18 | --- a/pan/ltp-pan.c | ||
| 19 | +++ b/pan/ltp-pan.c | ||
| 20 | @@ -1389,8 +1389,8 @@ static void write_test_start(struct tag_pgrp *running, int no_kmsg) | ||
| 21 | if (!strcmp(reporttype, "rts")) { | ||
| 22 | |||
| 23 | printf | ||
| 24 | - ("%s\ntag=%s stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\n%s\n", | ||
| 25 | - "<<<test_start>>>", running->cmd->name, running->mystime, | ||
| 26 | + ("%s\ntag=%s stime=%lld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\n%s\n", | ||
| 27 | + "<<<test_start>>>", running->cmd->name, (long long)running->mystime, | ||
| 28 | running->cmd->cmdline, "", "exit", "<<<test_output>>>"); | ||
| 29 | } | ||
| 30 | fflush(stdout); | ||
| 31 | -- | ||
| 32 | 2.29.2 | ||
| 33 | |||
diff --git a/meta/recipes-extended/ltp/ltp_20200930.bb b/meta/recipes-extended/ltp/ltp_20200930.bb index 7acf15b360..e3c49fbf53 100644 --- a/meta/recipes-extended/ltp/ltp_20200930.bb +++ b/meta/recipes-extended/ltp/ltp_20200930.bb | |||
| @@ -34,6 +34,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
| 34 | file://0007-Fix-test_proc_kill-hanging.patch \ | 34 | file://0007-Fix-test_proc_kill-hanging.patch \ |
| 35 | file://0001-Add-more-musl-exclusions.patch \ | 35 | file://0001-Add-more-musl-exclusions.patch \ |
| 36 | file://0001-Remove-OOM-tests-from-runtest-mm.patch \ | 36 | file://0001-Remove-OOM-tests-from-runtest-mm.patch \ |
| 37 | file://0001-ltp-pan-Use-long-long-int-to-print-time_t.patch \ | ||
| 37 | " | 38 | " |
| 38 | 39 | ||
| 39 | S = "${WORKDIR}/git" | 40 | S = "${WORKDIR}/git" |
