microsoft / microsoft/ProcMon-for-Linux

Build Error on Fedora 40: /src/configuration/../tracer/ebpf/syscall_schema.h:85:26: error: ‘strcpy’ is not a member of ‘std’; did you mean ‘strcpy’?

Open
#128 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
4.7k
Forks
295
Avg merge
2d 9h
Merged PRs (30d)
9

Description


name: CXX build error on Fedora 40 - ‘strcpy’ is not a member of ‘std’; did you mean ‘strcpy’?
about: This error occurs in at least 2 places when attempting to build using cmake/make as described.
title: ''
labels: ''
assignees: MarioHewardt


Describe the bug
When following the build steps, cmake runs fine, but when I run make I get the following error:

Syscalls have been parsed and written to ../src/tracer/ebpf/syscalls.h
[ 14%] Built target run_getsyscalls
[ 16%] Building EBPF object procmonEBPFkern5.6-_core.o
[ 18%] Packing procmonEBPFkern5.6-_core.o into procmonEBPFkern5.6-_core.o.o
[ 20%] Building EBPF object procmonEBPFkern4.17-5.1.o
[ 22%] Packing procmonEBPFkern4.17-5.1.o into procmonEBPFkern4.17-5.1.o.o
[ 24%] Building EBPF object procmonEBPFkern4.17-5.1_core.o
[ 26%] Packing procmonEBPFkern4.17-5.1_core.o into procmonEBPFkern4.17-5.1_core.o.o
[ 28%] Building EBPF object procmonEBPFkern5.2.o
[ 30%] Packing procmonEBPFkern5.2.o into procmonEBPFkern5.2.o.o
[ 32%] Building EBPF object procmonEBPFkern5.2_core.o
[ 34%] Packing procmonEBPFkern5.2_core.o into procmonEBPFkern5.2_core.o.o
[ 36%] Building EBPF object procmonEBPFkern5.3-5.5.o
[ 38%] Packing procmonEBPFkern5.3-5.5.o into procmonEBPFkern5.3-5.5.o.o
[ 40%] Building EBPF object procmonEBPFkern5.3-5.5_core.o
[ 42%] Packing procmonEBPFkern5.3-5.5_core.o into procmonEBPFkern5.3-5.5_core.o.o
[ 44%] Building EBPF object procmonEBPFkern5.6-.o
[ 46%] Packing procmonEBPFkern5.6-.o into procmonEBPFkern5.6-.o.o
[ 48%] Building CXX object CMakeFiles/procmon.dir/src/procmon.cpp.o
In file included from /home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/../tracer/ebpf/ebpf_tracer_engine.h:25,
                 from /home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/procmon_configuration.h:34,
                 from /home/itsallmathematics/repos/ProcMon-for-Linux/src/procmon.cpp:21:
/home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/../tracer/ebpf/syscall_schema.h: In static member function ‘static std::vector<SyscallSchema> Utils::CollectSyscallSchema()’:
/home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/../tracer/ebpf/syscall_schema.h:85:26: error: ‘strcpy’ is not a member of ‘std’; did you mean ‘strcpy’?
   85 |                     std::strcpy(schema.syscallName, syscall.name.c_str());
      |                          ^~~~~~
In file included from /home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/../storage/../common/telemetry.h:21,
                 from /home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/../storage/storage_engine.h:24,
                 from /home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/../storage/mock_storage_engine.h:25,
                 from /home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/procmon_configuration.h:29:
/usr/include/string.h:141:14: note: ‘strcpy’ declared here
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |              ^~~~~~
/home/itsallmathematics/repos/ProcMon-for-Linux/src/configuration/../tracer/ebpf/syscall_schema.h:109:34: error: ‘strcpy’ is not a member of ‘std’; did you mean ‘strcpy’?
  109 |                             std::strcpy(schema.argNames[argCount], argName.c_str());
      |                                  ^~~~~~
/usr/include/string.h:141:14: note: ‘strcpy’ declared here
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |              ^~~~~~
make[2]: *** [CMakeFiles/procmon.dir/build.make:156: CMakeFiles/procmon.dir/src/procmon.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:225: CMakeFiles/procmon.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

To Reproduce

  1. Follow the steps described in the BUILD.md file for Rocky Linux 9, but use DNF instead of yum as I'm on Fedora.
  2. mkdir build, cmake .., make

Sysmon version
Built from source

Distro/kernel version
Fedora 40, kernel 6.9.12-200.fc40.x86_64

Expected behavior
Successful build

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/tracer/ebpf/syscall_schema.h around lines 85 and 109, then inspect the headers used by this C++ build. Reproduce the Fedora 40 failure with the BUILD.md steps using cmake and make; done means the project builds successfully without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, linux
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.