From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 861AB45B95; Mon, 21 Oct 2024 20:30:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DAAF40263; Mon, 21 Oct 2024 20:30:17 +0200 (CEST) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by mails.dpdk.org (Postfix) with ESMTP id 68B964021F for ; Mon, 21 Oct 2024 20:30:15 +0200 (CEST) Received: by mail-yb1-f173.google.com with SMTP id 3f1490d57ef6-e290e857d56so4750893276.1 for ; Mon, 21 Oct 2024 11:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729535414; x=1730140214; darn=dpdk.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=P+1TQuDleDFmzPKsmkNST2tifuHWgatoi5MrauA1lAc=; b=QLK8f3y0DwYoc4fu3v1y8QjNIb3CIvvud7IQWlKxBxNGzD5kbRBeeOyqT2GvIUyT1b nqgnyrC1e4k3kN/QoSxo6nJRMx8TtCzKkA2EppdnYlJTctbGFKhK6hE3GpPWtUQbTMBF yofjg/s7qTntH3G+R6awXKQqksYL+aM6Svyrc+7jxcmKJhF3s2N+6gFYC1nwxzPwNbQa pPJ+sFrkAjBs2YHSCT9DsK5x4/4J7eq5g/AUMTpGknTrdDgfrXYuuoqj2QGzuvzQuhMp tJhPSm9LCM5FGXTLzP923H57TEgjyNQQdnY0Rz9zKhbSlv3NjwQ+YllQPs/poQBVpVZL 749Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729535414; x=1730140214; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=P+1TQuDleDFmzPKsmkNST2tifuHWgatoi5MrauA1lAc=; b=ddMtHENwtDg2gAA0hiD4wH+F7m2/X4LWZ9WIP8nYJZmsNnx+S6soGAGNrmw6MqM5wQ tRDF6Vsel/ga7sVsbYF0uXxvBJ7bNQvWNAle/KFgcgiIKk1nTcvW62LTO5EquxXhYY/A 3rvN6CESkJvhiqbBGKRLmnA2fzO3ObOBF8RjUZIY4YATTThu8Gn+P832+gTlLqNgkscs Lg5cPNeGnlRimou5wYN/hM11L4/4gReO5OJ1YzuE/dcNk7Jn8uTN3NQ3WRHeVysRkx0Z VwTd0SFAYuP130dSxJokbBHrfliNbyKfVQh+QS2lWCxYsKnnPfUuw3xk9tm6tiCmMdpE FWUA== X-Gm-Message-State: AOJu0Yzk0NYgfgnLmUUtO4QzYdqifBiHRdqLOuMfdFVMtEuWGG5E+yEk 2GE0RhW6RjxH98D3iCUtxFE9hntG46jrIIHUalisd8qcBN+e3EPEsgWaApoDWXvZYPajqe0Yo4/ 0KPN/yEw9X1ASepLRwEMHu0EQGgLEHbE4 X-Google-Smtp-Source: AGHT+IHuJP8ynqkM6zB3hKkuLrqGoaLo7jN57kAJSpBwpZYihvuedBZ2FbOpgS6GuakJS60aWUu5uv7I7xyV1F4Zu+c= X-Received: by 2002:a25:2605:0:b0:e2b:dafb:6f66 with SMTP id 3f1490d57ef6-e2bdafb70cdmr4458668276.2.1729535414096; Mon, 21 Oct 2024 11:30:14 -0700 (PDT) MIME-Version: 1.0 From: Isaac Boukris Date: Mon, 21 Oct 2024 21:30:02 +0300 Message-ID: Subject: Use of strtok() in dpdk code To: dev@dpdk.org, Stephen Hemminger Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hello, I was debugging a crash resulting from strtok() returning NULL unexpectedly (string still had tokens and delimiters), and the only explanation I could come up with was that strtok is thread-unsafe and another thread could have been calling it at the same time, and so I changed it to use strtok_r(). That said, the only other possible use of strtok() that I could find was in the dpdk code (telemetry), which brings me to my question, should we consider changing all occurrences to strtok_r() or am I missing something? there seem to be quite some in non-initialization code. Thanks!