|
From: <sv...@va...> - 2011-07-13 09:07:05
|
Author: tom
Date: 2011-07-13 10:02:14 +0100 (Wed, 13 Jul 2011)
New Revision: 11893
Log:
Allow core dumps on 32 bit architectures to go over 2Gb in size. BZ#277610.
Modified:
trunk/coregrind/m_coredump/coredump-elf.c
trunk/coregrind/m_libcfile.c
trunk/include/pub_tool_libcfile.h
Modified: trunk/coregrind/m_coredump/coredump-elf.c
===================================================================
--- trunk/coregrind/m_coredump/coredump-elf.c 2011-07-12 19:07:05 UTC (rev 11892)
+++ trunk/coregrind/m_coredump/coredump-elf.c 2011-07-13 09:02:14 UTC (rev 11893)
@@ -520,6 +520,7 @@
vg_assert(buf);
for(;;) {
+ Int oflags = VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC;
SysRes sres;
if (seq == 0)
@@ -530,9 +531,11 @@
basename, coreext, VG_(getpid)(), seq);
seq++;
- sres = VG_(open)(buf,
- VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC,
- VKI_S_IRUSR|VKI_S_IWUSR);
+# if defined(VKI_O_LARGEFILE)
+ oflags |= VKI_O_LARGEFILE;
+# endif
+
+ sres = VG_(open)(buf, oflags, VKI_S_IRUSR|VKI_S_IWUSR);
if (!sr_isError(sres)) {
core_fd = sr_Res(sres);
break;
Modified: trunk/coregrind/m_libcfile.c
===================================================================
--- trunk/coregrind/m_libcfile.c 2011-07-12 19:07:05 UTC (rev 11892)
+++ trunk/coregrind/m_libcfile.c 2011-07-13 09:02:14 UTC (rev 11893)
@@ -210,18 +210,27 @@
# endif
}
-OffT VG_(lseek) ( Int fd, OffT offset, Int whence )
+Off64T VG_(lseek) ( Int fd, Off64T offset, Int whence )
{
# if defined(VGO_linux) || defined(VGP_amd64_darwin)
+# if defined(__NR__llseek)
+ Off64T result;
+ SysRes res = VG_(do_syscall5)(__NR__llseek, fd,
+ offset >> 32, offset & 0xffffffff,
+ &result, whence);
+ return sr_isError(res) ? (-1) : result;
+# else
SysRes res = VG_(do_syscall3)(__NR_lseek, fd, offset, whence);
- vg_assert(sizeof(OffT) == sizeof(Word));
+ vg_assert(sizeof(Off64T) == sizeof(Word));
+ return sr_isError(res) ? (-1) : sr_Res(res);
+# endif
# elif defined(VGP_x86_darwin)
SysRes res = VG_(do_syscall4)(__NR_lseek, fd,
offset & 0xffffffff, offset >> 32, whence);
+ return sr_isError(res) ? (-1) : sr_Res(res);
# else
# error "Unknown plat"
# endif
- return sr_isError(res) ? (-1) : sr_Res(res);
/* if you change the error-reporting conventions of this, also
change VG_(pread) and all other usage points. */
}
Modified: trunk/include/pub_tool_libcfile.h
===================================================================
--- trunk/include/pub_tool_libcfile.h 2011-07-12 19:07:05 UTC (rev 11892)
+++ trunk/include/pub_tool_libcfile.h 2011-07-13 09:02:14 UTC (rev 11893)
@@ -77,7 +77,7 @@
extern Int VG_(read) ( Int fd, void* buf, Int count);
extern Int VG_(write) ( Int fd, const void* buf, Int count);
extern Int VG_(pipe) ( Int fd[2] );
-extern OffT VG_(lseek) ( Int fd, OffT offset, Int whence );
+extern Off64T VG_(lseek) ( Int fd, Off64T offset, Int whence );
extern SysRes VG_(stat) ( const Char* file_name, struct vg_stat* buf );
extern Int VG_(fstat) ( Int fd, struct vg_stat* buf );
|
|
From: Julian S. <js...@ac...> - 2011-07-13 10:05:54
|
Hi ..
I'm seeing this on biarch amd64 builds (not sure if its from
the 32- or 64-bit compiles)
m_libcfile.c: In function ‘vgPlain_lseek’:
m_libcfile.c:218: warning: passing argument 5 of ‘vgPlain_do_syscall’ makes
integer from pointer without a cast
pub_core_syscall.h:47: note: expected ‘UWord’ but argument is of type ‘Off64T
*’
and this on biarch ppc64 builds
m_libcfile.c: In function ‘vgPlain_lseek’:
m_libcfile.c:218: warning: passing argument 5 of ‘vgPlain_do_syscall’ makes
integer from pointer without a cast
m_libcfile.c: In function ‘vgPlain_lseek’:
m_libcfile.c:218: warning: passing argument 5 of ‘vgPlain_do_syscall’ makes
integer from pointer without a cast
which sounds like they're related to this change.
J
On Wednesday, July 13, 2011, sv...@va... wrote:
> Author: tom
> Date: 2011-07-13 10:02:14 +0100 (Wed, 13 Jul 2011)
> New Revision: 11893
>
> Log:
> Allow core dumps on 32 bit architectures to go over 2Gb in size. BZ#277610.
>
>
> Modified:
> trunk/coregrind/m_coredump/coredump-elf.c
> trunk/coregrind/m_libcfile.c
> trunk/include/pub_tool_libcfile.h
>
>
> Modified: trunk/coregrind/m_coredump/coredump-elf.c
> ===================================================================
> --- trunk/coregrind/m_coredump/coredump-elf.c 2011-07-12 19:07:05 UTC (rev
> 11892) +++ trunk/coregrind/m_coredump/coredump-elf.c 2011-07-13 09:02:14
> UTC (rev 11893) @@ -520,6 +520,7 @@
> vg_assert(buf);
>
> for(;;) {
> + Int oflags = VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC;
> SysRes sres;
>
> if (seq == 0)
> @@ -530,9 +531,11 @@
> basename, coreext, VG_(getpid)(), seq);
> seq++;
>
> - sres = VG_(open)(buf,
> - VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC,
> - VKI_S_IRUSR|VKI_S_IWUSR);
> +# if defined(VKI_O_LARGEFILE)
> + oflags |= VKI_O_LARGEFILE;
> +# endif
> +
> + sres = VG_(open)(buf, oflags, VKI_S_IRUSR|VKI_S_IWUSR);
> if (!sr_isError(sres)) {
> core_fd = sr_Res(sres);
> break;
>
> Modified: trunk/coregrind/m_libcfile.c
> ===================================================================
> --- trunk/coregrind/m_libcfile.c 2011-07-12 19:07:05 UTC (rev 11892)
> +++ trunk/coregrind/m_libcfile.c 2011-07-13 09:02:14 UTC (rev 11893)
> @@ -210,18 +210,27 @@
> # endif
> }
>
> -OffT VG_(lseek) ( Int fd, OffT offset, Int whence )
> +Off64T VG_(lseek) ( Int fd, Off64T offset, Int whence )
> {
> # if defined(VGO_linux) || defined(VGP_amd64_darwin)
> +# if defined(__NR__llseek)
> + Off64T result;
> + SysRes res = VG_(do_syscall5)(__NR__llseek, fd,
> + offset >> 32, offset & 0xffffffff,
> + &result, whence);
> + return sr_isError(res) ? (-1) : result;
> +# else
> SysRes res = VG_(do_syscall3)(__NR_lseek, fd, offset, whence);
> - vg_assert(sizeof(OffT) == sizeof(Word));
> + vg_assert(sizeof(Off64T) == sizeof(Word));
> + return sr_isError(res) ? (-1) : sr_Res(res);
> +# endif
> # elif defined(VGP_x86_darwin)
> SysRes res = VG_(do_syscall4)(__NR_lseek, fd,
> offset & 0xffffffff, offset >> 32,
> whence); + return sr_isError(res) ? (-1) : sr_Res(res);
> # else
> # error "Unknown plat"
> # endif
> - return sr_isError(res) ? (-1) : sr_Res(res);
> /* if you change the error-reporting conventions of this, also
> change VG_(pread) and all other usage points. */
> }
>
> Modified: trunk/include/pub_tool_libcfile.h
> ===================================================================
> --- trunk/include/pub_tool_libcfile.h 2011-07-12 19:07:05 UTC (rev 11892)
> +++ trunk/include/pub_tool_libcfile.h 2011-07-13 09:02:14 UTC (rev 11893)
> @@ -77,7 +77,7 @@
> extern Int VG_(read) ( Int fd, void* buf, Int count);
> extern Int VG_(write) ( Int fd, const void* buf, Int count);
> extern Int VG_(pipe) ( Int fd[2] );
> -extern OffT VG_(lseek) ( Int fd, OffT offset, Int whence );
> +extern Off64T VG_(lseek) ( Int fd, Off64T offset, Int whence );
>
> extern SysRes VG_(stat) ( const Char* file_name, struct vg_stat* buf );
> extern Int VG_(fstat) ( Int fd, struct vg_stat* buf );
>
>
> ---------------------------------------------------------------------------
> --- AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets
> Revealed." This video shows you how to validate your ideas, optimize your
> ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|
|
From: Tom H. <to...@co...> - 2011-07-13 10:24:14
|
On 13/07/11 11:05, Julian Seward wrote: > I'm seeing this on biarch amd64 builds (not sure if its from > the 32- or 64-bit compiles) > > m_libcfile.c: In function ‘vgPlain_lseek’: > m_libcfile.c:218: warning: passing argument 5 of ‘vgPlain_do_syscall’ makes > integer from pointer without a cast > pub_core_syscall.h:47: note: expected ‘UWord’ but argument is of type ‘Off64T > *’ Fixed. I don't know about anybody else, but I often miss warnings when building valgrind unless I look very hard because there is so much noise in the form of compile and link commands that fill about ten lines or something... I wonder if we should think about using the "silent rule" support in automake 1.11 to get something more like the linux kernel build output which reduces all the noise to let you see the warnings. It's not perfect because of our use of recursive make but I think we can certainly make things a lot better. I'm happy to have a play with it if people think it would be a good idea. Tom -- Tom Hughes (to...@co...) http://compton.nu/ |
|
From: Bart V. A. <bva...@ac...> - 2011-07-13 10:34:09
|
On Wed, Jul 13, 2011 at 12:23 PM, Tom Hughes <to...@co...> wrote: > On 13/07/11 11:05, Julian Seward wrote: > > > I'm seeing this on biarch amd64 builds (not sure if its from > > the 32- or 64-bit compiles) > > > > m_libcfile.c: In function ‘vgPlain_lseek’: > > m_libcfile.c:218: warning: passing argument 5 of ‘vgPlain_do_syscall’ > makes > > integer from pointer without a cast > > pub_core_syscall.h:47: note: expected ‘UWord’ but argument is of type > ‘Off64T > > *’ > > Fixed. > > I don't know about anybody else, but I often miss warnings when building > valgrind unless I look very hard because there is so much noise in the > form of compile and link commands that fill about ten lines or something... > > I wonder if we should think about using the "silent rule" support in > automake 1.11 to get something more like the linux kernel build output > which reduces all the noise to let you see the warnings. > > It's not perfect because of our use of recursive make but I think we can > certainly make things a lot better. > > I'm happy to have a play with it if people think it would be a good idea. > What I do is running "make -s" instead of "make". Another alternative is to pass CFLAGS=-Werror to the configure script. Bart. |
|
From: Julian S. <js...@ac...> - 2011-07-13 10:35:42
|
> I don't know about anybody else, but I often miss warnings when building > valgrind unless I look very hard because there is so much noise in the > form of compile and link commands that fill about ten lines or something... Yeah, it's completely impossible to spot them. I never even try, though: I have "mq" aliased to "make --quiet", and that makes it trivial, as per the below. I also use the following shell script to do from-scratch builds, which has this all wired in: $ cat ~/Bin/rebuild_inst #!/bin/sh make -j4 --quiet -k distclean rm -rf Inst ./autogen.sh ./configure --prefix=`pwd`/Inst make -j 4 --quiet all make -j 4 --quiet install > I wonder if we should think about using the "silent rule" support in > automake 1.11 to get something more like the linux kernel build output > which reduces all the noise to let you see the warnings. > > It's not perfect because of our use of recursive make but I think we can > certainly make things a lot better. Well, I think the above is a zero-effort solution; certainly I've been using it for years. (The credit for the "mq" thing goes to Nick.) J example mq output, following "mq clean": sewardj@g5:~/VgTRUNK/trunk$ mq -j2 Making all in include Making all in VEX Making all in coregrind vgdb.c:322: warning: ‘ptrace_write_memory’ defined but not used Making all in . Making all in memcheck Making all in . Making all in tests Making all in . Making all in ppc32 Making all in ppc64 Making all in linux Making all in perf Making all in cachegrind Making all in . Making all in tests Making all in . Making all in callgrind Making all in . Making all in tests Making all in . Making all in massif Making all in . Making all in tests Making all in perf Making all in lackey Making all in . Making all in tests Making all in none Making all in . Making all in tests Making all in . Making all in ppc32 Making all in ppc64 Making all in linux Making all in helgrind Making all in . Making all in tests Making all in drd Making all in . Making all in tests Making all in exp-sgcheck Making all in . Making all in tests Making all in exp-bbv Making all in . Making all in tests Making all in . Making all in ppc32-linux Making all in exp-dhat Making all in . Making all in tests Making all in tests Making all in perf Making all in gdbserver_tests Making all in auxprogs Making all in mpi Making all in docs sewardj@g5:~/VgTRUNK/trunk$ |
|
From: Stefan K. <en...@ho...> - 2011-07-20 23:45:52
|
On 07/13/11 12:23, Tom Hughes wrote: > On 13/07/11 11:05, Julian Seward wrote: > >> I'm seeing this on biarch amd64 builds (not sure if its from >> the 32- or 64-bit compiles) >> >> m_libcfile.c: In function ‘vgPlain_lseek’: >> m_libcfile.c:218: warning: passing argument 5 of ‘vgPlain_do_syscall’ makes >> integer from pointer without a cast >> pub_core_syscall.h:47: note: expected ‘UWord’ but argument is of type ‘Off64T >> *’ > Fixed. > > I don't know about anybody else, but I often miss warnings when building > valgrind unless I look very hard because there is so much noise in the > form of compile and link commands that fill about ten lines or something... > > I wonder if we should think about using the "silent rule" support in > automake 1.11 to get something more like the linux kernel build output > which reduces all the noise to let you see the warnings. I think its a good idea, especially as you can do it without a hard dependency like this in configure.ac # Support silent build rules, requires at least automake-1.11. Disable # by either passing --disable-silent-rules to configure or passing V=1 # to make m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Stefan > It's not perfect because of our use of recursive make but I think we can > certainly make things a lot better. > > I'm happy to have a play with it if people think it would be a good idea. > > Tom > |