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

            Bug ID: 416682
           Summary: [MIPS-Linux] mmap failed under valgrind
           Product: valgrind
           Version: 3.11.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: muppakrish...@gmail.com
  Target Milestone: ---

Seen issue mmap failure issue when launching Embedded OS and error value 22
(EINVAL 22 Invalid argument)

The same application is working fine if not running under valgrind.

Based on analysis found the issue is with mmap and could see the following
error from valgrind.

Line 1446: ==828== Warning: set address range perms: large range [0x14b80000,
0x2b19e000) (defined)

Line 1452: ==828== Warning: set address range perms: large range [0x14b80000,
0x2b19e000) (noaccess)

Tried with both valgrind 3.11.0 and 3.15.0 but result is same.

And from understating,tried with below patch to ignore MAP_FIXED but it didn't
work.

--- valgrind-3.15.0/coregrind/m_syswrap/syswrap-generic.c.keep  2020-01-24
12:29:43.935747920 +0530
+++ valgrind-3.15.0/coregrind/m_syswrap/syswrap-generic.c       2020-01-24
12:30:56.403747920 +0530
@@ -2320,7 +2320,7 @@ ML_(generic_PRE_sys_mmap) ( ThreadId tid
    /* Otherwise we're OK (so far).  Install aspacem's choice of
       address, and let the mmap go through.  */
    sres = VG_(am_do_mmap_NO_NOTIFY)(advised, arg2, arg3,
-                                    arg4 | VKI_MAP_FIXED,
+                                    arg4,
                                     arg5, arg6);

 #  if defined(VKI_MAP_32BIT)
@@ -2346,7 +2346,7 @@ ML_(generic_PRE_sys_mmap) ( ThreadId tid
       }
       /* and try again with the kernel */
       sres = VG_(am_do_mmap_NO_NOTIFY)(advised, arg2, arg3,
-                                       arg4 | VKI_MAP_FIXED,
+                                       arg4,
                                        arg5, arg6);
    }

Please suggest me with possible solution to fix the issue.

Target Environment details:

OS: Embedded-Linux and MIPS Architecture 

Kernel: 3.3.8-3.9

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

Reply via email to