[LTP] [PATCH] [PATCH v4] Migrating the libhugetlbfs/testcases/truncate_sigbus_versus_oom.c test

Andrea Cervesato andrea.cervesato@suse.com
Tue Feb 17 15:23:23 CET 2026


Hi!

On Sun Sep 28, 2025 at 5:46 AM CEST, Samir Mulani wrote:
> In this test case, we are verifying the bug fix commit that is attached as
> a part of the test case structure,
>
> Some kernel have a bug in the positioning of the test against
         ^
	 typo: kernels

> +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap37.c
> @@ -0,0 +1,94 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2005-2006 David Gibson & Adam Litke, IBM Corporation.
> + */
> +
> +/*\
> + * [Description]

Description is not needed anymore.

> + *
> + * Some kernel have a bug in the positioning of the test against
            ^
	    typo: kernels

> + * i_size.  This bug means that attempting to instantiate a page
> + * beyond the end of a hugepage file can result in an OOM and SIGKILL
> + * instead of the correct SIGBUS.
> + */
> +
> +#include "hugetlb.h"
> +#include <setjmp.h>
> +#include <signal.h>
> +
> +#define MNTPOINT "hugetlbfs/"
> +static int fd = -1, fdx = -1;
> +
> +static unsigned long long hpage_size;
> +static unsigned long totpages;
> +struct sigaction sa;

Should be used inside the setup().

> +static sigjmp_buf sig_escape;
> +static volatile int test_pass;
> +static int sigbus_count;

Never used.


-- 
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com



More information about the ltp mailing list