Skip to content

PROCFS_MEM_NAME undefined on FreeBSD #6352

Closed

Description

@sec

FreeBSD 10.3, coreclr throws during compile:
/home/dotnet/coreclr2/src/pal/src/debug/debug.cpp:1399:66: error: use of undeclared identifier 'PROCFS_MEM_NAME' snprintf(memPath, sizeof(memPath), "/proc/%u/%s", processId, PROCFS_MEM_NAME); ^ /home/dotnet/coreclr2/src/pal/src/debug/debug.cpp:1674:66: error: use of undeclared identifier 'PROCFS_MEM_NAME' snprintf(memPath, sizeof(memPath), "/proc/%u/%s", processId, PROCFS_MEM_NAME);

procfs is mounted.
I think it was working about month ago.
Problem is that HAVE_PROCFS_CTL is set to 1, but the test should fail:
Performing C++ SOURCE FILE Test HAVE_PROCFS_CTL succeeded with the following output:
Change Dir: /home/dotnet/coreclr2/bin/obj/FreeBSD.x64.Debug/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/gmake" "cmTC_d35a1/fast"
/usr/local/bin/gmake -f CMakeFiles/cmTC_d35a1.dir/build.make CMakeFiles/cmTC_d35a1.dir/build
gmake[1]: Entering directory '/usr/home/dotnet/coreclr2/bin/obj/FreeBSD.x64.Debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_d35a1.dir/src.cxx.o
/usr/local/bin/clang++37 -D_FILE_OFFSET_BITS=64 -I/usr/local/include -Wall -Wno-null-conversion -std=c++11 -DHAVE_PROCFS_CTL -o CMakeFiles/cmTC_d35a1.dir/
src.cxx.o -c /home/dotnet/coreclr2/bin/obj/FreeBSD.x64.Debug/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTC_d35a1
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d35a1.dir/link.txt --verbose=1
/usr/local/bin/clang++37 -Wall -Wno-null-conversion -std=c++11 -DHAVE_PROCFS_CTL CMakeFiles/cmTC_d35a1.dir/src.cxx.o -o cmTC_d35a1
gmake[1]: Leaving directory '/usr/home/dotnet/coreclr2/bin/obj/FreeBSD.x64.Debug/CMakeFiles/CMakeTmp'

Return value: 1
Source file was:

# include <fcntl.h>
# include <stdlib.h>
# include <stdio.h>
# include <unistd.h>

int main(void) {
  int fd;
# ifdef PATH_MAX

  char path[PATH_MAX];
# elif defined(MAXPATHLEN)

  char path[MAXPATHLEN];
# else

  char path[1024];
# endif

  sprintf(path, "/proc/%u/ctl", getpid());
  fd = open(path, O_WRONLY);
  if (fd == -1) {
    exit(1);
  }
  exit(0);
}

Return value 1 means it an error, right?

Activity

  1. Tomcu commented on Sep 28, 2016

    @Tomcu

    The following diff will alleviate the issue.

    diff --git a/src/pal/src/config.h.in b/src/pal/src/config.h.in
    index 7a53c8c..c88e38b 100644
    --- a/src/pal/src/config.h.in
    +++ b/src/pal/src/config.h.in
    @@ -139,6 +139,7 @@
     #cmakedefine01 HAVE_SCHED_OTHER_ASSIGNABLE
    
     #define CHECK_TRACE_SPECIFIERS 0
    +#define PROCFS_MEM_NAME ""
     #define HAVE_GETHRTIME 0
     #define HAVE_LOWERCASE_ISO_NAME 0
     #define HAVE_READ_REAL_TIME 0
    
  2. gkhanna79 commented on Mar 6, 2017

    @gkhanna79
    Member
  3. janvorli commented on Mar 6, 2017

    @janvorli
    Member

    The "Return value" cmake logged is misleading. It doesn't represent the exit code of the testing app when there was a success, but rather the value that the HAVE_XXXX variable is set to.
    Anyways, this issue is obsolete, we don't use PROCFS_MEM_NAME in CoreCLR anymore.
    So I am closing the issue.

  4. transferred this issue fromdotnet/coreclron Jan 31, 2020
  5. added this to the Future milestone on Jan 31, 2020
  6. ghost locked as resolved and limited conversation to collaborators on Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions