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

            Bug ID: 419054
           Summary: Unhandled syscall getcpu on arm32
           Product: valgrind
           Version: 3.15 SVN
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: minor
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: igor.snu...@gmail.com
  Target Milestone: ---

Created attachment 126911
  --> https://bugs.kde.org/attachment.cgi?id=126911&action=edit
Patch: enabling getcpu on arm32

SUMMARY


STEPS TO REPRODUCE
1. 

run the following code on an arm-32 platform (in my case, a raspberry pi).

#include ....

int main () {
  printf("getcpu = %d\n", sched_getcpu());
  return 0;
}

OBSERVED RESULT

==19515== Memcheck, a memory error detector
==19515== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19515== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==19515== Command: ./getcpu
==19515== 
--19515-- WARNING: unhandled arm-linux syscall: 345
--19515-- You may be able to write your own handler.
--19515-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--19515-- Nevertheless we consider this a bug.  Please report
--19515-- it at http://valgrind.org/support/bug_reports.html.
getcpu = -1
==19515== 
==19515== HEAP SUMMARY:
==19515==     in use at exit: 0 bytes in 0 blocks
==19515==   total heap usage: 1 allocs, 1 frees, 4,096 bytes allocated
==19515== 
==19515== All heap blocks were freed -- no leaks are possible
==19515== 
==19515== For lists of detected and suppressed errors, rerun with: -s
==19515== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


EXPECTED RESULT

==19525== Memcheck, a memory error detector
==19525== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19525== Using Valgrind-3.16.0.GIT and LibVEX; rerun with -h for copyright
info
==19525== Command: ./getcpu
==19525== 
getcpu = 0
==19525== 
==19525== HEAP SUMMARY:
==19525==     in use at exit: 0 bytes in 0 blocks
==19525==   total heap usage: 1 allocs, 1 frees, 4,096 bytes allocated
==19525== 
==19525== All heap blocks were freed -- no leaks are possible
==19525== 
==19525== For lists of detected and suppressed errors, rerun with: -s
==19525== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


ADDITIONAL INFORMATION


I reached this situation while debugging a dotnet application.

The patch is attached. By just simply uncommenting the syscall on
syswrap-arm-linux.c, it was possible to make it work and return the correct
output.

Regards.

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

Reply via email to