Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 074ACC433F5 for ; Wed, 20 Oct 2021 04:08:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA3226115A for ; Wed, 20 Oct 2021 04:08:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229492AbhJTELA (ORCPT ); Wed, 20 Oct 2021 00:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbhJTELA (ORCPT ); Wed, 20 Oct 2021 00:11:00 -0400 Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78E12C06161C for ; Tue, 19 Oct 2021 21:08:46 -0700 (PDT) Received: by mail-ua1-x932.google.com with SMTP id h19so4152505uax.5 for ; Tue, 19 Oct 2021 21:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=O9IEph8UJCfubD1vt3XWlpt41N8wDI1vphxp8fccM/o=; b=oPwS4e2NiDK9ckL/JzgzDifXiCwk7oAQIZ4eNaCxUqRtJ/tdJd8PXxWsN0ExAYJZ+g r0YmvDeWawHAr6lvlsuRt3NV6oq3f1S08gRfeTjPwAE8KhXGo2EqsYjzzC99RUXNeFDh QJ6j7WSp7PxuV3P2rO17RYW27eEgCOJAx8xsu3FtW+dobOu6vdiPdWuA4sBWGPfmD0JC wbnDcWoNXCG4RG1MkkPr0tq1TWkADVXJhotWJ7iW4bVrU5c1sjo8bFh55/zkesKkUovd k9R+84/KRx8YZ/fbxNbBhNCn1p9ESapvbwDP7aDEuoXhCTaHZvNCt97gDJSrwZc02yOi gEeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=O9IEph8UJCfubD1vt3XWlpt41N8wDI1vphxp8fccM/o=; b=M7aUHL+eSTkM+ZsJvvqo+m/TfAlin/gQmxrtNgis5HsAbj8d1Rx/dBq5h/Z6ltlvEF yrmjYLiKIMhatb6UA0Xbpb8S7FINnvqlgWt9ZEbwF2cjrTWxvE34xhDvwHNpgHysw+K1 VOB/Zhl7ylHX2flbp1VFVuN4Ex4DcwINrKHaFVkwsE5BDiNc8ZCsOAGopIvibwZcHQMq dxZ9dwDr+E/SS9f9XJ55+moAyX0AdRGH0aK8YapLwKhpitHsGdA8RmkTX1vGKJAyQRTU QoxUkAW9qksZPtYinKRqz7cA2eUT7g6CQ/o6DtYMhpDoQfEjzzQwZfoT6nMMth/zSTr3 VMaw== X-Gm-Message-State: AOAM532puzrLw5snFaY5ZEmEORRWuZZVK3ZIIZNRoLlFf+EQVx7oj13X bIFvyy8IVoPAFD+ijY1EfVEr72rs5A+N0pQI X-Google-Smtp-Source: ABdhPJz3zjmrTCg1WJrk+L4UhIk9csKKjPpW/qju/qF3SaMS/aKPl5QErAH+kxOWN/6X/JigErez/A== X-Received: by 2002:a05:6102:3712:: with SMTP id s18mr39902411vst.43.1634702925458; Tue, 19 Oct 2021 21:08:45 -0700 (PDT) Received: from [10.0.0.100] ([179.223.196.182]) by smtp.gmail.com with ESMTPSA id p191sm670118vkp.31.2021.10.19.21.08.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Oct 2021 21:08:45 -0700 (PDT) To: shuah@kernel.org, linux-kselftest@vger.kernel.org From: Pedro Demarchi Gomes Subject: BUG: Segmentation fault in mremap_test Message-ID: Date: Wed, 20 Oct 2021 01:08:42 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Running the executable mremap_test generated by compiling mremap_test.c, located at tools/testing/selftests/vm, using the makefile provided in tools/testing/selftests/vm gives an error of segmentation fault. The error happens during the execution of the following test case (line 298): test_cases[4] = MAKE_TEST(_1MB, PTE, _2MB, NON_OVERLAPPING, EXPECT_SUCCESS, "2MB mremap - Source 1MB-aligned, Destination PTE-aligned"); The seg fault happens on line 145: dest_addr = mremap(src_addr, c.region_size, c.region_size, MREMAP_MAYMOVE|MREMAP_FIXED, (char *) addr); The makefile compiles mremap_test.c using the command: gcc -Wall -I ../../../../usr/include -no-pie mremap_test.c -lrt -lpthread -o /home/guest/shared/linux-kernel/tools/testing/selftests/vm/mremap_test I was able to run mremap_test without errors when compiling it without the -no-pie flag.