From nobody Mon Nov 8 19:57:04 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CFF08183F86D for ; Mon, 8 Nov 2021 19:57:13 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hp22K0YYFz4fhN for ; Mon, 8 Nov 2021 19:57:13 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: by mail-lj1-x229.google.com with SMTP id i63so6410505lji.3 for ; Mon, 08 Nov 2021 11:57:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FSUwUCarY3K2p33WNMOb8YZIU4mucUXOuTkzINAc4QY=; b=WaaLFkwOri1i26wFUi3+3thM8wXU1P2wwe7ytfk26ap5r7hwP9jE7VOA2k0zcPTu5+ FpfC4Jl0qtBJCUcIQek9HOmFTuDA6fSQeAeYKRk9fQHa+rHqyB/Dla2Nzro1vAJ4m/QY Dsk5V08W80BuS/n34ZnVM5nIPNdgCoPC1gfymOMqc5kB/fejX/6wVMvHWWIUM4ccPTFv YRRmXbW1cd/7CkTkK4CNw2mE3HR5yd4kkPAseNDGX/fAgb7Q0j2NDs/QefkUyp8M8Gpc JvgBhY0gUzESlBMD0wFNqKTZdsuoXn4Ps1roB1IHBSI0fqfqiBJlwmv/Kdkfh0MVJmJd YUrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FSUwUCarY3K2p33WNMOb8YZIU4mucUXOuTkzINAc4QY=; b=PMehSTJkJZ2wMASgioiFsEle8jhsmNF6N/OSJhySZMXPDfIzVMBvH2GXR70tmKPv/G 5U4LX9DPGs7RcLTBffR5wrvCPnj3GOZhz1yDgVdoXhJ3Xpiz+uHj6VZ/WROKcckpWVfa 1GIFurAskbRACEYjsUixk1/qs570LInK2Mlns2OBciHbqR6dpSiK7KSBSps5mUiVS1Hp jdgP+/XvwhKuYR6lB2V3zPMg6f9NWquz7XHrViukB57qq/7la+KbTwwFL1t9EWnkDA3p YxqAOJc1K51GW3+ullADh6xtEnaj8tG56N+n7HlGfjhwODZ/sWIVIHaWwxpBW5hBN6a5 h+Ig== X-Gm-Message-State: AOAM530xUKfX7+8dYh5YcwxFi11z1qBrQj6L1GQIjnWdO4Uzro5e5SvV 6ApXdrxQTQitoeKHrTh4CXIOJNbyLyc= X-Google-Smtp-Source: ABdhPJwMaRgu0KISv2A379xHQyzFjct3RQz3ne1jSBjmAqghObs1Vpjxzmn7Rj1YFYsaWBRrPe/zEQ== X-Received: by 2002:a05:651c:160e:: with SMTP id f14mr1552599ljq.379.1636401426221; Mon, 08 Nov 2021 11:57:06 -0800 (PST) Received: from rimwks.local ([176.99.183.229]) by smtp.gmail.com with ESMTPSA id z23sm1916101lfu.119.2021.11.08.11.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 11:57:05 -0800 (PST) From: Rozhuk Ivan X-Google-Original-From: Rozhuk Ivan Date: Mon, 8 Nov 2021 22:57:04 +0300 To: Alexander Cc: "freebsd-current@freebsd.org" Subject: Re: Problems with getting a crash dump Message-ID: <20211108225704.243752a6@rimwks.local> In-Reply-To: References: X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Hp22K0YYFz4fhN X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=WaaLFkwO; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rozhukim@gmail.com designates 2a00:1450:4864:20::229 as permitted sender) smtp.mailfrom=rozhukim@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::229:from]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, 08 Nov 2021 19:08:31 +0000 Alexander wrote: > Hello, I am currently using FreeBSD 14.0-CURRENT and I found a bug > that triggers a kernel panic. I wanted to make a kernel crash dump to > further investigate the issue, but after a few tries I still did not > manage to do it. I started by following the instructions in the > FreeBSD Handbook. I checked that /dev/nvd0p2.eli is an active swap > device and I configured it to be used as a dump device like this: > > # dumpon -v /dev/nvd0p2.eli > # sysctl debug.kdb.panic=1 > > Then I booted into single user mode to extract the core dumb: > > # savecore -vC /dev/nvd0p2 > checking for kernel dump on device /dev/nvd0p2 > mediasize = 2147483648 bytes > sectorsize = 512 bytes > magic mismatch on last dump header on /dev/nvd0p2 > No dump exists > > A you can see the core dump was not written to the device. Later I > also tried using /dev/nvd0p2 (with out the "eli" part), because > /dev/nvd0p2.eli is only available after I enable it using swapon, but > the handbook states the I should first extract the dump, before I use > the device as swap again. But the result was the same. /dev/nvd0p2 is > only 2gb in size and it's an encrypted swap device, so I thought that: > 1) Maybe the size of the device is to small even for a minidump. > 2) Perhaps using encrypted swap as a dump device is not supported. > > Because of those complications I decided to use an external 8gb USB > drive as my dump device. > > # gpart create -s gpt /dev/da0 > # gpart add -t freebsd-swap /dev/da0 > # swapoff -a > # swapon /dev/da0p1 > # dumpon -v /dev/da0p1 > kernel dumps on priority: device > 0: da0p1 > > I have 8gb of RAM so a 8gb dump device should be big enough for a > minidump. I used `sysctl debug.kdb.panic=1` to crash the kernel and > rebooted the system. I also waited for 10 minutes to ensure the the > kernel finished writing the core dump to the device. > > # savecore -vC /dev/da0p1 > checking for kernel dump on device /dev/da0p1 > mediasize = 7744741376 bytes > sectorsize = 512 bytes > magic mismatch on last dump header on /dev/da0p1 > No dump exists > > As you can see I still did not manage to get a kernel crash dump. Any > ideas? > > Here is a picture of the output I get after running `sysctl > debug.kdb.panic=1`: > https://forums.freebsd.org/attachments/img_20211108_163313-jpeg.11936/ > > PS yes kern.coredump is set to 1. > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238301 http://netlab.dhis.org/wiki/ru:software:freebsd:kernel_debug It work for 12 and 13, may be 14 have bugs/changes.