Bug 321969 - ppc32 and ppc64 don't support [lf]setxattr
Summary: ppc32 and ppc64 don't support [lf]setxattr
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0.SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-04 21:21 UTC by Mark Wielaard
Modified: 2013-07-05 09:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2013-07-04 21:21:11 UTC
Try a program that uses [lf]setxattr like:

    char *foo = "bar";
    if (setxattr(argv[1], "user.x", foo, strlen(foo), 0) == -1)
        abort();

    if (lsetxattr(argv[1], "user.y", foo, strlen(foo), 0) == -1)
        abort();

    int fd = open (argv[1], O_RDWR);
    if (fsetxattr(fd, "user.y", foo, strlen(foo), 0) == -1)
        abort();

--937-- WARNING: unhandled syscall: 209
--937-- You may be able to write your own handler.
--937-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--937-- Nevertheless we consider this a bug.  Please report
--937-- it at http://valgrind.org/support/bug_reports.html.

Reproducible: Always




Seems easy enough to fix by reusing the generic linux definitions:

Index: coregrind/m_syswrap/syswrap-ppc64-linux.c
===================================================================
--- coregrind/m_syswrap/syswrap-ppc64-linux.c	(revision 13447)
+++ coregrind/m_syswrap/syswrap-ppc64-linux.c	(working copy)
@@ -927,10 +927,10 @@
 // _____(__NR_mincore,           sys_mincore),            // 206
    LINX_(__NR_gettid,            sys_gettid),             // 207
 // _____(__NR_tkill,             sys_tkill),              // 208
-// _____(__NR_setxattr,          sys_setxattr),           // 209
+   LINX_(__NR_setxattr,          sys_setxattr),           // 209
 
-// _____(__NR_lsetxattr,         sys_lsetxattr),          // 210
-// _____(__NR_fsetxattr,         sys_fsetxattr),          // 211
+   LINX_(__NR_lsetxattr,         sys_lsetxattr),          // 210
+   LINX_(__NR_fsetxattr,         sys_fsetxattr),          // 211
    LINXY(__NR_getxattr,          sys_getxattr),           // 212
    LINXY(__NR_lgetxattr,         sys_lgetxattr),          // 213
    LINXY(__NR_fgetxattr,         sys_fgetxattr),          // 214
Index: coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- coregrind/m_syswrap/syswrap-ppc32-linux.c	(revision 13447)
+++ coregrind/m_syswrap/syswrap-ppc32-linux.c	(working copy)
@@ -1130,9 +1130,9 @@
    GENXY(__NR_mincore,           sys_mincore),           // 206
    LINX_(__NR_gettid,            sys_gettid),            // 207
 //..    LINX_(__NR_tkill,             sys_tkill),             // 208 */Linux
-//..    LINX_(__NR_setxattr,          sys_setxattr),          // 209
-//..    LINX_(__NR_lsetxattr,         sys_lsetxattr),         // 210
-//..    LINX_(__NR_fsetxattr,         sys_fsetxattr),         // 211
+   LINX_(__NR_setxattr,          sys_setxattr),          // 209
+   LINX_(__NR_lsetxattr,         sys_lsetxattr),         // 210
+   LINX_(__NR_fsetxattr,         sys_fsetxattr),         // 211
    LINXY(__NR_getxattr,          sys_getxattr),          // 212
    LINXY(__NR_lgetxattr,         sys_lgetxattr),         // 213
    LINXY(__NR_fgetxattr,         sys_fgetxattr),         // 214
Comment 1 Mark Wielaard 2013-07-05 09:51:17 UTC
Committed as r13449.