DPDK patches and discussions
 help / color / mirror / Atom feed
* Use of strtok() in dpdk code
@ 2024-10-21 18:30 Isaac Boukris
  2024-10-22  1:08 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Isaac Boukris @ 2024-10-21 18:30 UTC (permalink / raw)
  To: dev, Stephen Hemminger

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!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-22 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-21 18:30 Use of strtok() in dpdk code Isaac Boukris
2024-10-22  1:08 ` Stephen Hemminger
2024-10-22  6:51   ` fengchengwen
2024-10-22 12:27     ` Isaac Boukris
2024-10-22 15:25     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).