get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/87214/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 87214,
    "url": "http://patches.dpdk.org/api/patches/87214/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210125150539.27537-1-david.marchand@redhat.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210125150539.27537-1-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210125150539.27537-1-david.marchand@redhat.com",
    "date": "2021-01-25T15:05:39",
    "name": "[v2] ci: catch coredumps",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "4fbede17ce876f840d7289492c30d6ec30d74e01",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210125150539.27537-1-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 14930,
            "url": "http://patches.dpdk.org/api/series/14930/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14930",
            "date": "2021-01-25T15:05:39",
            "name": "[v2] ci: catch coredumps",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/14930/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/87214/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/87214/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id CF4C2A052A;\n\tMon, 25 Jan 2021 16:06:41 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A82DB140F5D;\n\tMon, 25 Jan 2021 16:06:41 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [63.128.21.124])\n by mails.dpdk.org (Postfix) with ESMTP id 24AC6140EFD\n for <dev@dpdk.org>; Mon, 25 Jan 2021 16:06:39 +0100 (CET)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-238-39ZqpD1eNAKOc0KCc6hicQ-1; Mon, 25 Jan 2021 10:06:36 -0500",
            "from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com\n [10.5.11.12])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD276100F354;\n Mon, 25 Jan 2021 15:05:58 +0000 (UTC)",
            "from dmarchan.remote.csb (unknown [10.40.192.190])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 2925660C0F;\n Mon, 25 Jan 2021 15:05:56 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1611587199;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=6G/yCgYAg9uk4Y8CMD9LGeT5EcQ+KcdixR4It/LvHL4=;\n b=KT/zXTD5KH3t4AL8LGQ+1PUw8GUC/+l6VQ5suS9EZk26VdngxYErdMwzOOaW/0HfoDWkke\n kIBPjBjSQezsq7eEEV+/wyXBR80Pcrv19oKlXelQ0mgQbmTt9qks19T3WgVXbd9TbABztw\n MLrNFnzeYMXzq4ROKPbeZ7ew+Tv0rcA=",
        "X-MC-Unique": "39ZqpD1eNAKOc0KCc6hicQ-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "Aaron Conole <aconole@redhat.com>,\n Michael Santana <maicolgabriel@hotmail.com>,\n Olivier Matz <olivier.matz@6wind.com>",
        "Date": "Mon, 25 Jan 2021 16:05:39 +0100",
        "Message-Id": "<20210125150539.27537-1-david.marchand@redhat.com>",
        "In-Reply-To": "<20210111100146.3485-1-david.marchand@redhat.com>",
        "References": "<20210111100146.3485-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"",
        "Subject": "[dpdk-dev] [PATCH v2] ci: catch coredumps",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Parts of the unit tests code rely on forked/secondary processes\n(expectedly) failing.\nA crash in those situations could be missed so add a check on coredumps\npresence after unit tests have run.\nWhen unit tests fail, it can also help checking for coredumps as it\ncould give more insights on what happened.\n\nIn some situations (like explicit call to rte_panic), coredump generation\nmust be disabled to avoid false positives.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\nChangelog since RFC v1\n- removed RFC,\n- pushed coredumps into gdb for in-situ analysis,\n- gdb presence is used to enable the check. Travis config is left\n  untouched for now,\n\n---\n .ci/linux-build.sh          | 37 ++++++++++++++++++++++++++++++++++---\n .github/workflows/build.yml |  4 ++++\n app/test/test_debug.c       | 11 +++++++++--\n app/test/test_mbuf.c        |  9 ++++++++-\n 4 files changed, 55 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh\nindex d2c821adf3..26c30a2301 100755\n--- a/.ci/linux-build.sh\n+++ b/.ci/linux-build.sh\n@@ -4,7 +4,10 @@ on_error() {\n     if [ $? = 0 ]; then\n         exit\n     fi\n-    FILES_TO_PRINT=\"build/meson-logs/testlog.txt build/.ninja_log build/meson-logs/meson-log.txt\"\n+    FILES_TO_PRINT=\"build/meson-logs/testlog.txt\"\n+    FILES_TO_PRINT=\"$FILES_TO_PRINT build/.ninja_log\"\n+    FILES_TO_PRINT=\"$FILES_TO_PRINT build/meson-logs/meson-log.txt\"\n+    FILES_TO_PRINT=\"$FILES_TO_PRINT build/gdb.log\"\n \n     for pr_file in $FILES_TO_PRINT; do\n         if [ -e \"$pr_file\" ]; then\n@@ -30,6 +33,26 @@ install_libabigail() {\n     rm ${version}.tar.gz\n }\n \n+configure_coredump() {\n+    # No point in configuring coredump without gdb\n+    which gdb >/dev/null || return 0\n+    ulimit -c unlimited\n+    sudo sysctl -w kernel.core_pattern=/tmp/dpdk-core.%e.%p\n+}\n+\n+catch_coredump() {\n+    ls /tmp/dpdk-core.*.* 2>/dev/null || return 0\n+    for core in /tmp/dpdk-core.*.*; do\n+        binary=$(sudo readelf -n $core |grep $(pwd)/build/ 2>/dev/null |head -n1)\n+        [ -x $binary ] || binary=\n+        sudo gdb $binary -c $core \\\n+            -ex 'info threads' \\\n+            -ex 'thread apply all bt full' \\\n+            -ex 'quit'\n+    done |tee -a build/gdb.log\n+    return 1\n+}\n+\n if [ \"$AARCH64\" = \"true\" ]; then\n     # convert the arch specifier\n     OPTS=\"$OPTS --cross-file config/arm/arm64_armv8_linux_gcc\"\n@@ -57,7 +80,11 @@ meson build --werror $OPTS\n ninja -C build\n \n if [ \"$AARCH64\" != \"true\" ]; then\n-    devtools/test-null.sh\n+    failed=\n+    configure_coredump\n+    devtools/test-null.sh || failed=\"true\"\n+    catch_coredump\n+    [ \"$failed\" != \"true\" ]\n fi\n \n if [ \"$ABI_CHECKS\" = \"true\" ]; then\n@@ -102,5 +129,9 @@ if [ \"$ABI_CHECKS\" = \"true\" ]; then\n fi\n \n if [ \"$RUN_TESTS\" = \"true\" ]; then\n-    sudo meson test -C build --suite fast-tests -t 3\n+    failed=\n+    configure_coredump\n+    sudo meson test -C build --suite fast-tests -t 3 || failed=\"true\"\n+    catch_coredump\n+    [ \"$failed\" != \"true\" ]\n fi\ndiff --git a/.github/workflows/build.yml b/.github/workflows/build.yml\nindex a5b579adda..786525e5a3 100644\n--- a/.github/workflows/build.yml\n+++ b/.github/workflows/build.yml\n@@ -104,6 +104,9 @@ jobs:\n       if: env.AARCH64 == 'true'\n       run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross\n         pkg-config-aarch64-linux-gnu\n+    - name: Install test tools packages\n+      if: env.AARCH64 != 'true' || env.RUN_TESTS == 'true'\n+      run: sudo apt install -y gdb\n     - name: Install doc generation packages\n       if: env.BUILD_DOCS == 'true'\n       run: sudo apt install -y doxygen graphviz python3-sphinx\n@@ -124,3 +127,4 @@ jobs:\n           build/meson-logs/testlog.txt\n           build/.ninja_log\n           build/meson-logs/meson-log.txt\n+          build/gdb.log\ndiff --git a/app/test/test_debug.c b/app/test/test_debug.c\nindex 834a7386f5..23b24db177 100644\n--- a/app/test/test_debug.c\n+++ b/app/test/test_debug.c\n@@ -4,6 +4,8 @@\n \n #include <stdio.h>\n #include <stdint.h>\n+#include <sys/resource.h>\n+#include <sys/time.h>\n #include <sys/wait.h>\n #include <unistd.h>\n \n@@ -28,9 +30,14 @@ test_panic(void)\n \n \tpid = fork();\n \n-\tif (pid == 0)\n+\tif (pid == 0) {\n+\t\tstruct rlimit rl;\n+\n+\t\t/* No need to generate a coredump when panicking. */\n+\t\trl.rlim_cur = rl.rlim_max = 0;\n+\t\tsetrlimit(RLIMIT_CORE, &rl);\n \t\trte_panic(\"Test Debug\\n\");\n-\telse if (pid < 0){\n+\t} else if (pid < 0) {\n \t\tprintf(\"Fork Failed\\n\");\n \t\treturn -1;\n \t}\ndiff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c\nindex a40f7d4883..47a7b197d7 100644\n--- a/app/test/test_mbuf.c\n+++ b/app/test/test_mbuf.c\n@@ -1174,6 +1174,8 @@ test_refcnt_mbuf(void)\n }\n \n #include <unistd.h>\n+#include <sys/resource.h>\n+#include <sys/time.h>\n #include <sys/wait.h>\n \n /* use fork() to test mbuf errors panic */\n@@ -1186,9 +1188,14 @@ verify_mbuf_check_panics(struct rte_mbuf *buf)\n \tpid = fork();\n \n \tif (pid == 0) {\n+\t\tstruct rlimit rl;\n+\n+\t\t/* No need to generate a coredump when panicking. */\n+\t\trl.rlim_cur = rl.rlim_max = 0;\n+\t\tsetrlimit(RLIMIT_CORE, &rl);\n \t\trte_mbuf_sanity_check(buf, 1); /* should panic */\n \t\texit(0);  /* return normally if it doesn't panic */\n-\t} else if (pid < 0){\n+\t} else if (pid < 0) {\n \t\tprintf(\"Fork Failed\\n\");\n \t\treturn -1;\n \t}\n",
    "prefixes": [
        "v2"
    ]
}