From: Philippe Waroquiers Date: Thu, 16 Aug 2012 19:40:52 +0000 (+0000) Subject: Fix n-i-bz shmat of a segment > 4Gb does not work X-Git-Tag: svn/VALGRIND_3_9_0~766 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b5f81bfd3cf15e1cf80582e6c56dea080e7945f;p=thirdparty%2Fvalgrind.git Fix n-i-bz shmat of a segment > 4Gb does not work Problem was created by get_shm_size returning an UInt rather than a SizeT. see http://sourceforge.net/mailarchive/message.php?msg_id=29682827 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12874 --- diff --git a/NEWS b/NEWS index 0e84baf14d..850898dcf9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,26 @@ +Release 3.9.0 (?? ?????? 201?) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* ================== PLATFORM CHANGES ================= + +* ==================== TOOL CHANGES ==================== + +* ==================== OTHER CHANGES ==================== + +* ==================== FIXED BUGS ==================== + +The following bugs have been fixed or resolved. Note that "n-i-bz" +stands for "not in bugzilla" -- that is, a bug that was reported to us +but never got a bugzilla entry. We encourage you to file bugs in +bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather +than mailing the developers (or mailing lists) directly -- bugs that +are not entered into bugzilla tend to get forgotten about or ignored. + +To see details of a given bug, visit + https://bugs.kde.org/show_bug.cgi?id=XXXXXX +where XXXXXX is the bug number as listed below. + +n-i-bz shmat of a segment > 4Gb does not work Release 3.8.0 (10 August 2012) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 216c65e3b6..46d4531991 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -1700,7 +1700,7 @@ ML_(generic_POST_sys_semctl) ( ThreadId tid, /* ------ */ static -UInt get_shm_size ( Int shmid ) +SizeT get_shm_size ( Int shmid ) { #ifdef __NR_shmctl # ifdef VKI_IPC_64 @@ -1725,7 +1725,7 @@ UInt get_shm_size ( Int shmid ) if (sr_isError(__res)) return 0; - return buf.shm_segsz; + return (SizeT) buf.shm_segsz; } UWord @@ -1733,7 +1733,7 @@ ML_(generic_PRE_sys_shmat) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* void *shmat(int shmid, const void *shmaddr, int shmflg); */ - UInt segmentSize = get_shm_size ( arg0 ); + SizeT segmentSize = get_shm_size ( arg0 ); UWord tmp; Bool ok; if (arg1 == 0) { @@ -1768,7 +1768,7 @@ ML_(generic_POST_sys_shmat) ( ThreadId tid, UWord res, UWord arg0, UWord arg1, UWord arg2 ) { - UInt segmentSize = VG_PGROUNDUP(get_shm_size(arg0)); + SizeT segmentSize = VG_PGROUNDUP(get_shm_size(arg0)); if ( segmentSize > 0 ) { UInt prot = VKI_PROT_READ|VKI_PROT_WRITE; Bool d;