Menu

#1788 .RexxInfo~executable not working for NetBSD and OpenBSD

5.0.0
closed
Erich
None
none
1
2023-01-01
2021-11-18
No

rexx -e 'say .RexxInfo~executable' -> The NIL object

I have traced this back to SysProcess.cpp, line 105 ff

const char* SysProcess::getExecutableFullPath()

Related

Bugs: #1788

Discussion

  • Erich

    Erich - 2021-11-18
    • status: open --> accepted
    • assigned_to: Erich
    • Pending work items: none --> tests
     
    • Per Olov Jonsson

      Thanks for the swift response, I have been weeding out things on the failing *nixes, they all now seems to build reliably (but still tests failing).

      Hälsningar/Regards/Grüsse,
      P.O. Jonsson
      oorexx@jonases.se

      Am 18.11.2021 um 20:42 schrieb Erich erich_st@users.sourceforge.net:

      • status: open --> accepted
      • assigned_to: Erich
      • Pending work items: none --> tests
      • Comment:

      It seems the BSD-specific sysctl KERN_PROC_PATHNAME may succeed without returning a valid path.
      We now check check procfs in all cases where OS-specific functions won't return a valid path.
      committed fixed with revision [r12310]


      ** [bugs:#1788] .RexxInfo~executable not working for NetBSD and OpenBSD**

      Status: accepted
      Group: 5.0.0
      Created: Thu Nov 18, 2021 05:34 PM UTC by Per Olov Jonsson
      Last Updated: Thu Nov 18, 2021 05:34 PM UTC
      Owner: Erich

      rexx -e 'say .RexxInfo~executable' -> The NIL object

      I have traced this back to SysProcess.cpp, line 105 ff

      const char* SysProcess::getExecutableFullPath()


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oorexx/bugs/1788/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1788
      Commit: [r12310]

    • Per Olov Jonsson

      It seems the last modification made many (most) *nixes get the same error too.

      I have just committed a change to NetBSD settings that should fix the ncurses problem, please wait until that build&test has finished on Jenkins to see if the change you committed actually fixed the problem for NetBSD and OpenBSD, ok?

      Hälsningar/Regards/Grüsse,
      P.O. Jonsson
      oorexx@jonases.se

      Am 18.11.2021 um 20:42 schrieb Erich erich_st@users.sourceforge.net:

      • status: open --> accepted
      • assigned_to: Erich
      • Pending work items: none --> tests
      • Comment:

      It seems the BSD-specific sysctl KERN_PROC_PATHNAME may succeed without returning a valid path.
      We now check check procfs in all cases where OS-specific functions won't return a valid path.
      committed fixed with revision [r12310]


      ** [bugs:#1788] .RexxInfo~executable not working for NetBSD and OpenBSD**

      Status: accepted
      Group: 5.0.0
      Created: Thu Nov 18, 2021 05:34 PM UTC by Per Olov Jonsson
      Last Updated: Thu Nov 18, 2021 05:34 PM UTC
      Owner: Erich

      rexx -e 'say .RexxInfo~executable' -> The NIL object

      I have traced this back to SysProcess.cpp, line 105 ff

      const char* SysProcess::getExecutableFullPath()


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oorexx/bugs/1788/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1788
      Commit: [r12310]

  • Erich

    Erich - 2021-11-18

    It seems the BSD-specific sysctl KERN_PROC_PATHNAME may succeed without returning a valid path.
    We now check check procfs in all cases where OS-specific functions won't return a valid path.
    committed fixed with revision [r12310]

     

    Related

    Commit: [r12310]

  • Erich

    Erich - 2021-11-19

    fixed code with [r12312]

    While other BSDs should work, OpenBSD will still return .nil
    It neither supports KERN_PROC_PATHNAME nor procfs
    I see no way to fix this

    dladdr(main) would work (like below), but as it requires main it could only be added to rexx.cpp itself
    I don't think we should do that

    Dl_info dlInfo;
    dladdr((void *)main, &dlInfo);
    
     

    Related

    Commit: [r12312]

  • Gil Barmwater

    Gil Barmwater - 2021-11-19

    I think it would be acceptable to make a note in the documentation on the executable method that it will return .nil on OpenBSD.

     
  • Per Olov Jonsson

    Gil: I beg to disagree. This method is used throughout the test suite, resulting in 43 Errors, making the testing more or less pointless. OpenBSD and FreeBSD share this problem and FreeBSD only have one failing test beside this errors so it would be really important to get it fixed. Maybe we can reach out to people using these #nixes and learn how they solve the problem. The need to identify a running process must be present in all OSes. NetBSD does not show this error btw.

     
  • Gil Barmwater

    Gil Barmwater - 2021-11-19

    My concern is that Erich indicates he sees no way to fix it. Now hopefully the BSD gurus will come back with a way but what if they don't? Then we can only document that this functionality is not available on those platforms and skip the testcases that fail when run on them.

     
  • Erich

    Erich - 2021-11-19

    OpenBSD and FreeBSD share this problem

    In contrast to OpenBSD, FreeBSD supports KERN_PROC_PATHNAME - see
    https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&n=1

    I don't know why our FreeBSD VM shows "Looking for KERN_PROC_PATHNAME - not found"

     
    • Per Olov Jonsson

      Am 19.11.2021 um 23:35 schrieb Erich erich_st@users.sourceforge.net:

      I don't know why our FreeBSD VM shows "Looking for KERN_PROC_PATHNAME - not found"

      Possibly another missing definition for CMakeLists.txt?

       
      • Niclas Rosenvik

        Niclas Rosenvik - 2021-11-20

        The reason for "Looking for KERN_PROC_PATHNAME - not found" on FreeBSD is because sys/sysctl.h is not self contained, it needs sys/types.h as is seen in the man page.
        To work it should be check_symbol_exists(KERN_PROC_PATHNAME "sys/types.h;sys/sysctl.h" HAVE_KERN_PROC_PATHNAME) . Just tested it and this line reports found on FreeBSD. Observe that "" is needed around the list of header files to include.
        Included is a subversion diff file that fixes this and makes the sysctl work on NetBSD, NetBSD has different arguments for this than FreeBSD.
        Concerning OpenBSD, getexecname for OpenBSD might be worth a look.

         
        • Per Olov Jonsson

          👍🙏

          Von meinem iPhone gesendet

          Am 20.11.2021 um 14:22 schrieb Niclas Rosenvik nros@users.sourceforge.net:

          The reason for "Looking for KERN_PROC_PATHNAME - not found" on FreeBSD is because sys/sysctl.h is not self contained, it needs sys/types.h as is seen in the man page.
          To work it should be check_symbol_exists(KERN_PROC_PATHNAME "sys/types.h;sys/sysctl.h" HAVE_KERN_PROC_PATHNAME) . Just tested it and this line reports found on FreeBSD. Observe that "" is needed around the list of header files to include.
          Included is a subversion diff file that fixes this and makes the sysctl work on NetBSD, NetBSD has different arguments for this than FreeBSD.
          Concerning OpenBSD, getexecname for OpenBSD might be worth a look.

          Attachments:


          ** [bugs:#1788] .RexxInfo~executable not working for NetBSD and OpenBSD**

          Status: accepted
          Group: 5.0.0
          Created: Thu Nov 18, 2021 05:34 PM UTC by Per Olov Jonsson
          Last Updated: Fri Nov 19, 2021 10:35 PM UTC
          Owner: Erich

          rexx -e 'say .RexxInfo~executable' -> The NIL object

          I have traced this back to SysProcess.cpp, line 105 ff

          const char* SysProcess::getExecutableFullPath()


          Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oorexx/bugs/1788/

          To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

           

          Related

          Bugs: #1788

  • Erich

    Erich - 2021-11-29

    Committed more fixes with revision [r12327].
    On OpenBSD we have no other means as to resort to argv[0], but this will only be acceptable if it's an absolute path.

     

    Related

    Commit: [r12327]

  • Per Olov Jonsson

    I think this bug report can be closed now?

     
  • Erich

    Erich - 2022-06-24
    • status: accepted --> pending
    • Pending work items: tests --> none
     
  • Rony G. Flatscher

    • Status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





Monday.com Logo