Julian Seward <[email protected]> writes:
>> or are there any issues I should look out for?
>
> None that come obviously to mind.
>
> Send us the patch when you are done.

I tried the attached patch against 3.6.0~svn20100724, but I seem to have
introduced a new problem:

SYSCALL[3677,1]( 85) sys_readlink ( 0x82e3ca0(/usr/bin/python-dbg), 0xbeb01cfa, 
4096 ) --> [pre-success] Success(0x0:0xd)
valgrind: m_syswrap/syswrap-main.c:1473 (vgPlain_client_syscall): Assertion '0 
== (sci->flags & ~(SfPollAfter | SfYieldAfter | SfNoWriteResult))' failed.
==3677==    at 0x380269BF: report_and_quit (m_libcassert.c:191)
==3677==    by 0x38026C74: vgPlain_assert_fail (m_libcassert.c:265)
==3677==    by 0x380676FB: vgPlain_client_syscall (syswrap-main.c:1473)
==3677==    by 0x38063927: handle_syscall (scheduler.c:885)
==3677==    by 0x38065402: vgPlain_scheduler (scheduler.c:1081)
==3677==    by 0x38096ACA: run_a_thread_NORETURN (syswrap-linux.c:94)

sched status:
  running_tid=1


Any idea what I did wrong?



   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C
diff -u valgrind-3.6.0.SVN/coregrind/m_syswrap//syswrap-generic.c bor/coregrind/m_syswrap//syswrap-generic.c
--- valgrind-3.6.0.SVN/coregrind/m_syswrap//syswrap-generic.c	2010-05-03 17:37:12.000000000 -0400
+++ bor/coregrind/m_syswrap//syswrap-generic.c	2011-01-17 14:05:24.000000000 -0500
@@ -2379,6 +2379,7 @@
 
 PRE(sys_fstatfs)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fstatfs ( %ld, %#lx )",ARG1,ARG2);
    PRE_REG_READ2(long, "fstatfs",
                  unsigned int, fd, struct statfs *, buf);
@@ -2392,6 +2393,7 @@
 
 PRE(sys_fstatfs64)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fstatfs64 ( %ld, %llu, %#lx )",ARG1,(ULong)ARG2,ARG3);
    PRE_REG_READ3(long, "fstatfs64",
                  unsigned int, fd, vki_size_t, size, struct statfs64 *, buf);
@@ -2438,6 +2440,7 @@
 
 PRE(sys_mknod)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_mknod ( %#lx(%s), 0x%lx, 0x%lx )", ARG1, (char*)ARG1, ARG2, ARG3 );
    PRE_REG_READ3(long, "mknod",
                  const char *, pathname, int, mode, unsigned, dev);
@@ -2728,6 +2731,7 @@
 
 PRE(sys_access)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_access ( %#lx(%s), %ld )", ARG1,(char*)ARG1,ARG2);
    PRE_REG_READ2(long, "access", const char *, pathname, int, mode);
    PRE_MEM_RASCIIZ( "access(pathname)", ARG1 );
@@ -2792,6 +2796,7 @@
 
 PRE(sys_chmod)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_chmod ( %#lx(%s), %ld )", ARG1,(char*)ARG1,ARG2);
    PRE_REG_READ2(long, "chmod", const char *, path, vki_mode_t, mode);
    PRE_MEM_RASCIIZ( "chmod(path)", ARG1 );
@@ -2799,6 +2804,7 @@
 
 PRE(sys_chown)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_chown ( %#lx(%s), 0x%lx, 0x%lx )", ARG1,(char*)ARG1,ARG2,ARG3);
    PRE_REG_READ3(long, "chown",
                  const char *, path, vki_uid_t, owner, vki_gid_t, group);
@@ -2807,6 +2813,7 @@
 
 PRE(sys_lchown)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_lchown ( %#lx(%s), 0x%lx, 0x%lx )", ARG1,(char*)ARG1,ARG2,ARG3);
    PRE_REG_READ3(long, "lchown",
                  const char *, path, vki_uid_t, owner, vki_gid_t, group);
@@ -2815,6 +2822,7 @@
 
 PRE(sys_close)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_close ( %ld )", ARG1);
    PRE_REG_READ1(long, "close", unsigned int, fd);
 
@@ -2872,6 +2880,7 @@
 
 PRE(sys_fchown)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fchown ( %ld, %ld, %ld )", ARG1,ARG2,ARG3);
    PRE_REG_READ3(long, "fchown",
                  unsigned int, fd, vki_uid_t, owner, vki_gid_t, group);
@@ -2879,6 +2888,7 @@
 
 PRE(sys_fchmod)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fchmod ( %ld, %ld )", ARG1,ARG2);
    PRE_REG_READ2(long, "fchmod", unsigned int, fildes, vki_mode_t, mode);
 }
@@ -3677,6 +3687,7 @@
 
 PRE(sys_readlink)
 {
+   *flags |= SfMayBlock;
    Word saved = SYSNO;
 
    PRINT("sys_readlink ( %#lx(%s), %#lx, %llu )", ARG1,(char*)ARG1,ARG2,(ULong)ARG3);
@@ -3758,6 +3769,7 @@
 
 PRE(sys_rename)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_rename ( %#lx(%s), %#lx(%s) )", ARG1,(char*)ARG1,ARG2,(char*)ARG2);
    PRE_REG_READ2(long, "rename", const char *, oldpath, const char *, newpath);
    PRE_MEM_RASCIIZ( "rename(oldpath)", ARG1 );
@@ -3899,6 +3911,7 @@
 
 PRE(sys_statfs)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_statfs ( %#lx(%s), %#lx )",ARG1,(char*)ARG1,ARG2);
    PRE_REG_READ2(long, "statfs", const char *, path, struct statfs *, buf);
    PRE_MEM_RASCIIZ( "statfs(path)", ARG1 );
@@ -3911,6 +3924,7 @@
 
 PRE(sys_statfs64)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_statfs64 ( %#lx(%s), %llu, %#lx )",ARG1,(char*)ARG1,(ULong)ARG2,ARG3);
    PRE_REG_READ3(long, "statfs64",
                  const char *, path, vki_size_t, size, struct statfs64 *, buf);
diff -u valgrind-3.6.0.SVN/coregrind/m_syswrap//syswrap-linux.c bor/coregrind/m_syswrap//syswrap-linux.c
--- valgrind-3.6.0.SVN/coregrind/m_syswrap//syswrap-linux.c	2010-06-29 02:16:52.000000000 -0400
+++ bor/coregrind/m_syswrap//syswrap-linux.c	2011-01-17 14:00:43.000000000 -0500
@@ -2121,6 +2121,7 @@
 
 PRE(sys_chown16)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_chown16 ( %#lx, 0x%lx, 0x%lx )", ARG1,ARG2,ARG3);
    PRE_REG_READ3(long, "chown16",
                  const char *, path,
@@ -2130,6 +2131,7 @@
 
 PRE(sys_fchown16)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fchown16 ( %ld, %ld, %ld )", ARG1,ARG2,ARG3);
    PRE_REG_READ3(long, "fchown16",
                  unsigned int, fd, vki_old_uid_t, owner, vki_old_gid_t, group);
@@ -2993,6 +2995,7 @@
 
 PRE(sys_openat)
 {
+   *flags |= SfMayBlock;
    HChar  name[30];
    SysRes sres;
 
@@ -3059,6 +3062,7 @@
 
 PRE(sys_mknodat)
 {
+   *flags |= SfMayBlock;
   PRINT("sys_mknodat ( %ld, %#lx(%s), 0x%lx, 0x%lx )", ARG1,ARG2,(char*)ARG2,ARG3,ARG4 );
    PRE_REG_READ4(long, "mknodat",
                  int, dfd, const char *, pathname, int, mode, unsigned, dev);
@@ -3067,6 +3071,7 @@
 
 PRE(sys_fchownat)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fchownat ( %ld, %#lx(%s), 0x%lx, 0x%lx )", ARG1,ARG2,(char*)ARG2,ARG3,ARG4);
    PRE_REG_READ4(long, "fchownat",
                  int, dfd, const char *, path,
@@ -3076,6 +3081,7 @@
 
 PRE(sys_futimesat)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_futimesat ( %ld, %#lx(%s), %#lx )", ARG1,ARG2,(char*)ARG2,ARG3);
    PRE_REG_READ3(long, "futimesat",
                  int, dfd, char *, filename, struct timeval *, tvp);
@@ -3087,6 +3093,7 @@
 
 PRE(sys_utimensat)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_utimensat ( %ld, %#lx(%s), %#lx, 0x%lx )", ARG1,ARG2,(char*)ARG2,ARG3,ARG4);
    PRE_REG_READ4(long, "utimensat",
                  int, dfd, char *, filename, struct timespec *, utimes, int, flags);
@@ -3120,6 +3129,7 @@
 
 PRE(sys_renameat)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_renameat ( %ld, %#lx(%s), %ld, %#lx(%s) )", ARG1,ARG2,(char*)ARG2,ARG3,ARG4,(char*)ARG4);
    PRE_REG_READ4(long, "renameat",
                  int, olddfd, const char *, oldpath,
@@ -3152,6 +3162,7 @@
 
 PRE(sys_readlinkat)
 {
+   *flags |= SfMayBlock;
    HChar name[25];
    Word  saved = SYSNO;
 
@@ -3183,6 +3194,7 @@
 
 PRE(sys_fchmodat)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fchmodat ( %ld, %#lx(%s), %ld )", ARG1,ARG2,(char*)ARG2,ARG3);
    PRE_REG_READ3(long, "fchmodat",
                  int, dfd, const char *, path, vki_mode_t, mode);
@@ -3191,6 +3203,7 @@
 
 PRE(sys_faccessat)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_faccessat ( %ld, %#lx(%s), %ld )", ARG1,ARG2,(char*)ARG2,ARG3);
    PRE_REG_READ3(long, "faccessat",
                  int, dfd, const char *, pathname, int, mode);
diff -u valgrind-3.6.0.SVN/coregrind/m_syswrap//syswrap-x86-linux.c bor/coregrind/m_syswrap//syswrap-x86-linux.c
--- valgrind-3.6.0.SVN/coregrind/m_syswrap//syswrap-x86-linux.c	2010-05-03 17:37:12.000000000 -0400
+++ bor/coregrind/m_syswrap//syswrap-x86-linux.c	2011-01-17 14:08:23.374930001 -0500
@@ -1388,6 +1389,7 @@
 // things, eventually, I think.  --njn
 PRE(sys_lstat64)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_lstat64 ( %#lx(%s), %#lx )",ARG1,(char*)ARG1,ARG2);
    PRE_REG_READ2(long, "lstat64", char *, file_name, struct stat64 *, buf);
    PRE_MEM_RASCIIZ( "lstat64(file_name)", ARG1 );
@@ -1404,6 +1406,7 @@
 
 PRE(sys_stat64)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_stat64 ( %#lx(%s), %#lx )",ARG1,(char*)ARG1,ARG2);
    PRE_REG_READ2(long, "stat64", char *, file_name, struct stat64 *, buf);
    PRE_MEM_RASCIIZ( "stat64(file_name)", ARG1 );
@@ -1417,6 +1420,7 @@
 
 PRE(sys_fstatat64)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fstatat64 ( %ld, %#lx(%s), %#lx )",ARG1,ARG2,(char*)ARG2,ARG3);
    PRE_REG_READ3(long, "fstatat64",
                  int, dfd, char *, file_name, struct stat64 *, buf);
@@ -1431,6 +1435,7 @@
 
 PRE(sys_fstat64)
 {
+   *flags |= SfMayBlock;
    PRINT("sys_fstat64 ( %ld, %#lx )",ARG1,ARG2);
    PRE_REG_READ2(long, "fstat64", unsigned long, fd, struct stat64 *, buf);
    PRE_MEM_WRITE( "fstat64(buf)", ARG2, sizeof(struct vki_stat64) );
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to