Created attachment 104019 [details] patch: add syscall wrapper for meminfo() + unit test Platform: SunOS dell747srv 5.11 11.3 i86pc i386 i86pc Solaris syscall meminfo() : https://docs.oracle.com/cd/E23824_01/html/821-1463/meminfo-2.html#scrolltoc ==36267== Memcheck, a memory error detector ==36267== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==36267== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==36267== Command: test.elf ==36267== --36267-- WARNING: unhandled x86-solaris syscall: 180 --36267-- You may be able to write your own handler. --36267-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --36267-- Nevertheless we consider this a bug. Please report --36267-- it at http://valgrind.org/support/bug_reports.html. I tried to do a patch but I still get anoying errors. I would need some advices so that I can finalize it. Please find attached the patch and the unit test.
Thank you for the patch. This syscall number (180) is used for a family of lgrpsys commands, of which LGRP_SYS_MEMINFO is subcode 0. It will take a while to implement support for all subcodes. To expedite the patch, you help if you run 'truss' on your native binary and grep for all lgrpsys invocations. This will reveal lgrpsys subcodes used by your application.
Fixed for LGRP_SYS_MEMINFO subcode in SVN r16224.
Please find below the "truss" of the native binary. /1: lgrp_version(2) = 2 /1: _lgrpsys(1, 0) = 93 /1: _lgrpsys(3, 0x00000000, 0x00000000) = 19140 /1: brk(0x237FF5C0) = 0x00000000 /1: brk(0x238035C0) = 0x00000000 /1: _lgrpsys(3, 0x00004AC4, 0x237FCBB0) = 19140 /1: _lgrpsys(1, 0) = 93
Alright, so it means also subcodes LGRP_SYS_GENERATION(1) and LGRP_SYS_SNAPSHOT(3) need to be supported...
Additional subcodes for lgrpsys(180) syscall were added under SVN r16225.
Follow up SVN commit r16226.
I couldn't compile your code because of this include : sys/lgrp_user_impl.h not found Commenting it made the code compile and it seems to work fine in our use case now. However we crash on another unimplemented syscall : --00:00:06:20.881 8667-- WARNING: unhandled amd64-solaris syscall: fast:6 --00:00:06:20.881 8667-- You may be able to write your own handler. --00:00:06:20.881 8667-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --00:00:06:20.881 8667-- Nevertheless we consider this a bug. Please report --00:00:06:20.881 8667-- it at http://valgrind.org/support/bug_reports.html. I am going to open another ticket for that.
Please do 'svn update' so your source tree gets also revision r16226. Then do './autogen.sh && ./configure && make --quiet check' again.
Fixes tested and validated on our side. Thanks a lot.