https://bugs.kde.org/show_bug.cgi?id=376611

            Bug ID: 376611
           Summary: ppc64 and arm64 don't know about prlimit64 syscall
           Product: valgrind
           Version: 3.12 SVN
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: m...@redhat.com
  Target Milestone: ---

Running prlimit on either arm64 or ppc64[le] gets this WARNING:

==19848== Command: prlimit
==19848== 
--19848-- WARNING: unhandled arm64-linux syscall: 261
--19848-- You may be able to write your own handler.
--19848-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--19848-- Nevertheless we consider this a bug.  Please report
--19848-- it at http://valgrind.org/support/bug_reports.html.
prlimit: failed to get the AS resource limit: Function not implemented

==14990== Command: prlimit
==14990== 
--14990-- WARNING: unhandled ppc64le-linux syscall: 325
--14990-- You may be able to write your own handler.
--14990-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--14990-- Nevertheless we consider this a bug.  Please report
--14990-- it at http://valgrind.org/support/bug_reports.html.
prlimit: failed to get the AS resource limit: Function not implemented


The fix is simply to hook both syscalls to the already existing wrapper:

diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c
b/coregrind/m_syswrap/syswrap-arm64-linux.c
index 1be6629..f8b5b7c 100644
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
@@ -868,6 +868,7 @@ static SyscallTableEntry syscall_main_table[] = {
    LINXY(__NR_recvmmsg,          sys_recvmmsg),          // 243

    GENXY(__NR_wait4,             sys_wait4),             // 260
+   LINXY(__NR_prlimit64,         sys_prlimit64),         // 261

    LINXY(__NR_name_to_handle_at, sys_name_to_handle_at), // 264
    LINXY(__NR_open_by_handle_at, sys_open_by_handle_at), // 265
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c
b/coregrind/m_syswrap/syswrap-ppc64-linux.c
index f90140d..ce5cbbb 100644
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
@@ -905,6 +905,7 @@ static SyscallTableEntry syscall_table[] = {
    LINX_(__NR_pwritev,           sys_pwritev),          // 321
    LINXY(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo),// 322

+   LINXY(__NR_prlimit64,         sys_prlimit64),        // 325
    LINXY(__NR_socket,            sys_socket),           // 326
    LINX_(__NR_bind,              sys_bind),             // 327
    LINX_(__NR_connect,           sys_connect),          // 328

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to