charlie@stat.umn.edu
2005-Aug-01 21:25 UTC
[Rd] valgrind complains about regex.c (PR#8043)
I think I am using objects according to the man page. This seems to be a valid regular expression. But whether I know what I'm doing or no, it still shouldn't be doing what valgrind seems to be saying it's doing. (IMHO) ---------- start of script ---------- Script started on Mon 01 Aug 2005 02:09:00 PM PDT linux$ printenv VALGRIND_OPTS --tool=3Dmemcheck linux$ cat bar.R foo <- 1 bar <- 2:3 baz <- 4:6 qux <- matrix(7:10, 2) ls() rm(list =3D objects(pattern =3D "^[a-pr-z]")) ls() linux$ R --version R 2.1.1 (2005-06-20). Copyright (C) 2005 R Development Core Team R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under the terms of the GNU General Public License. For more information about these matters, see http://www.gnu.org/copyleft/gpl.html. linux$ gcc --version =1B[0mgcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux) =1B[0mCopyright (C) 2003 Free Software Foundation, Inc. =1B[0mThis is free software; see the source for copying conditions. There is NO =1B[0mwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =1B[0m linux$ cat /etc/SuSE-release=20 SuSE Linux 9.3 (i586) VERSION =3D 9.3 linux$ R --vanilla --debugger=3Dvalgrind < bar.R >| bar.Rout =3D=3D22324=3D=3D Memcheck, a memory error detector for x86-linux. =3D=3D22324=3D=3D Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al. =3D=3D22324=3D=3D Using valgrind-2.2.0, a program supervision framework for x86-linux. =3D=3D22324=3D=3D Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al. =3D=3D22324=3D=3D For more details, rerun with: -v =3D=3D22324=3D=3D=20 =3D=3D22324=3D=3D Invalid read of size 4 =3D=3D22324=3D=3D at 0x81255AD: parse_expression (regex.c:5045) =3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) =3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) =3D=3D22324=3D=3D by 0x81261B3: Rf_regcomp (regex.c:4384) =3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 alloc'd =3D=3D22324=3D=3D at 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_memcheck.so) =3D=3D22324=3D=3D by 0x81247B5: parse_expression (regex.c:5406) =3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) =3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) =3D=3D22324=3D=3D=20 =3D=3D22324=3D=3D Invalid write of size 4 =3D=3D22324=3D=3D at 0x81255B2: parse_expression (regex.c:5045) =3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) =3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) =3D=3D22324=3D=3D by 0x81261B3: Rf_regcomp (regex.c:4384) =3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 alloc'd =3D=3D22324=3D=3D at 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_memcheck.so) =3D=3D22324=3D=3D by 0x81247B5: parse_expression (regex.c:5406) =3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) =3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) =3D=3D22324=3D=3D=20 =3D=3D22324=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 39 from 2) =3D=3D22324=3D=3D malloc/free: in use at exit: 12691882 bytes in 6426 blocks. =3D=3D22324=3D=3D malloc/free: 32534 allocs, 26108 frees, 33105500 bytes allocated. =3D=3D22324=3D=3D For a detailed leak analysis, rerun with: --leak-check=3Dyes =3D=3D22324=3D=3D For counts of detected errors, rerun with: -v linux$ exit Script done on Mon 01 Aug 2005 02:10:42 PM PDT ---------- end of script ---------- --=20 Charles Geyer Professor, School of Statistics University of Minnesota charlie at stat.umn.edu
Did you compile R without optimization? Such reads are often the result of read-aheads produced by the optimizer in an attempt to keep pipelines full (and are harmless). On an un-optimized build of R I am unable to reproduce this. (I also was unable to reproduce it on my optimized build of 2.1.1 using gcc 3.4.4, although I did get a report on other read-aheads.) On Mon, 1 Aug 2005 charlie at stat.umn.edu wrote:> I think I am using objects according to the man page. > This seems to be a valid regular expression. But whether > I know what I'm doing or no, it still shouldn't be doing > what valgrind seems to be saying it's doing. (IMHO)I think you need to take that up with compiler designers: it is common practice.> ---------- start of script ---------- > Script started on Mon 01 Aug 2005 02:09:00 PM PDT > linux$ printenv VALGRIND_OPTS > --tool=3Dmemcheck > linux$ cat bar.R > > foo <- 1 > bar <- 2:3 > baz <- 4:6 > qux <- matrix(7:10, 2) > > ls() > rm(list =3D objects(pattern =3D "^[a-pr-z]")) > ls() > > linux$ R --version > R 2.1.1 (2005-06-20). > Copyright (C) 2005 R Development Core Team > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under the terms of the GNU > General Public License. For more information about these matters, > see http://www.gnu.org/copyleft/gpl.html. > linux$ gcc --version > =1B[0mgcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux) > =1B[0mCopyright (C) 2003 Free Software Foundation, Inc. > =1B[0mThis is free software; see the source for copying conditions. There > is NO > =1B[0mwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PU> RPOSE. > =1B[0m > linux$ cat /etc/SuSE-release=20 > SuSE Linux 9.3 (i586) > VERSION =3D 9.3 > linux$ R --vanilla --debugger=3Dvalgrind < bar.R >| bar.Rout > =3D=3D22324=3D=3D Memcheck, a memory error detector for x86-linux. > =3D=3D22324=3D=3D Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward > et al. > =3D=3D22324=3D=3D Using valgrind-2.2.0, a program supervision framework for> x86-linux. > =3D=3D22324=3D=3D Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward > et al. > =3D=3D22324=3D=3D For more details, rerun with: -v > =3D=3D22324=3D=3D=20 > =3D=3D22324=3D=3D Invalid read of size 4 > =3D=3D22324=3D=3D at 0x81255AD: parse_expression (regex.c:5045) > =3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) > =3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) > =3D=3D22324=3D=3D by 0x81261B3: Rf_regcomp (regex.c:4384) > =3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 a> lloc'd > =3D=3D22324=3D=3D at 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_> memcheck.so) > =3D=3D22324=3D=3D by 0x81247B5: parse_expression (regex.c:5406) > =3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) > =3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) > =3D=3D22324=3D=3D=20 > =3D=3D22324=3D=3D Invalid write of size 4 > =3D=3D22324=3D=3D at 0x81255B2: parse_expression (regex.c:5045) > =3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) > =3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) > =3D=3D22324=3D=3D by 0x81261B3: Rf_regcomp (regex.c:4384) > =3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 a> lloc'd > =3D=3D22324=3D=3D at 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_> memcheck.so) > =3D=3D22324=3D=3D by 0x81247B5: parse_expression (regex.c:5406) > =3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) > =3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) > =3D=3D22324=3D=3D=20 > =3D=3D22324=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 39 f> rom 2) > =3D=3D22324=3D=3D malloc/free: in use at exit: 12691882 bytes in 6426 block> s. > =3D=3D22324=3D=3D malloc/free: 32534 allocs, 26108 frees, 33105500 bytes al> located. > =3D=3D22324=3D=3D For a detailed leak analysis, rerun with: --leak-check> =3Dyes > =3D=3D22324=3D=3D For counts of detected errors, rerun with: -v > linux$ exit > > Script done on Mon 01 Aug 2005 02:10:42 PM PDT > ---------- end of script ---------- > --=20 > Charles Geyer > Professor, School of Statistics > University of Minnesota > charlie at stat.umn.edu > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
murdoch@stats.uwo.ca
2005-Aug-02 11:50 UTC
[Rd] valgrind complains about regex.c (PR#8043)
Prof Brian Ripley wrote:> Did you compile R without optimization? Such reads are often the result > of read-aheads produced by the optimizer in an attempt to keep > pipelines full (and are harmless).There were both a read and a write. I can see the read being harmless, but is the write harmless? I suspect this may be the bug I fixed on July 16, since it had to do with character classes including ranges (like Charlie's "[a-pr-z]"). Charlie, have you tried a recent version of R-patched? Duncan Murdoch> > On an un-optimized build of R I am unable to reproduce this. (I also was > unable to reproduce it on my optimized build of 2.1.1 using gcc 3.4.4, > although I did get a report on other read-aheads.) > > On Mon, 1 Aug 2005 charlie at stat.umn.edu wrote: > > >>I think I am using objects according to the man page. >>This seems to be a valid regular expression. But whether >>I know what I'm doing or no, it still shouldn't be doing >>what valgrind seems to be saying it's doing. (IMHO) > > > I think you need to take that up with compiler designers: it is common > practice. > > >>---------- start of script ---------- >>Script started on Mon 01 Aug 2005 02:09:00 PM PDT >>linux$ printenv VALGRIND_OPTS >>--tool=3Dmemcheck >>linux$ cat bar.R >> >>foo <- 1 >>bar <- 2:3 >>baz <- 4:6 >>qux <- matrix(7:10, 2) >> >>ls() >>rm(list =3D objects(pattern =3D "^[a-pr-z]")) >>ls() >> >>linux$ R --version >>R 2.1.1 (2005-06-20). >>Copyright (C) 2005 R Development Core Team >> >>R is free software and comes with ABSOLUTELY NO WARRANTY. >>You are welcome to redistribute it under the terms of the GNU >>General Public License. For more information about these matters, >>see http://www.gnu.org/copyleft/gpl.html. >>linux$ gcc --version >>=1B[0mgcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux) >>=1B[0mCopyright (C) 2003 Free Software Foundation, Inc. >>=1B[0mThis is free software; see the source for copying conditions. There >>is NO >>=1B[0mwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PU>>RPOSE. >>=1B[0m >>linux$ cat /etc/SuSE-release=20 >>SuSE Linux 9.3 (i586) >>VERSION =3D 9.3 >>linux$ R --vanilla --debugger=3Dvalgrind < bar.R >| bar.Rout >>=3D=3D22324=3D=3D Memcheck, a memory error detector for x86-linux. >>=3D=3D22324=3D=3D Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward >>et al. >>=3D=3D22324=3D=3D Using valgrind-2.2.0, a program supervision framework for>>x86-linux. >>=3D=3D22324=3D=3D Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward >>et al. >>=3D=3D22324=3D=3D For more details, rerun with: -v >>=3D=3D22324=3D=3D=20 >>=3D=3D22324=3D=3D Invalid read of size 4 >>=3D=3D22324=3D=3D at 0x81255AD: parse_expression (regex.c:5045) >>=3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) >>=3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) >>=3D=3D22324=3D=3D by 0x81261B3: Rf_regcomp (regex.c:4384) >>=3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 a>>lloc'd >>=3D=3D22324=3D=3D at 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_>>memcheck.so) >>=3D=3D22324=3D=3D by 0x81247B5: parse_expression (regex.c:5406) >>=3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) >>=3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) >>=3D=3D22324=3D=3D=20 >>=3D=3D22324=3D=3D Invalid write of size 4 >>=3D=3D22324=3D=3D at 0x81255B2: parse_expression (regex.c:5045) >>=3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) >>=3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) >>=3D=3D22324=3D=3D by 0x81261B3: Rf_regcomp (regex.c:4384) >>=3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 a>>lloc'd >>=3D=3D22324=3D=3D at 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_>>memcheck.so) >>=3D=3D22324=3D=3D by 0x81247B5: parse_expression (regex.c:5406) >>=3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) >>=3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) >>=3D=3D22324=3D=3D=20 >>=3D=3D22324=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 39 f>>rom 2) >>=3D=3D22324=3D=3D malloc/free: in use at exit: 12691882 bytes in 6426 block>>s. >>=3D=3D22324=3D=3D malloc/free: 32534 allocs, 26108 frees, 33105500 bytes al>>located. >>=3D=3D22324=3D=3D For a detailed leak analysis, rerun with: --leak-check>>=3Dyes >>=3D=3D22324=3D=3D For counts of detected errors, rerun with: -v >>linux$ exit >> >>Script done on Mon 01 Aug 2005 02:10:42 PM PDT >>---------- end of script ---------- >>--=20 >>Charles Geyer >>Professor, School of Statistics >>University of Minnesota >>charlie at stat.umn.edu >> >>______________________________________________ >>R-devel at r-project.org mailing list >>https://stat.ethz.ch/mailman/listinfo/r-devel >> >> > >
charlie@stat.umn.edu
2005-Aug-02 23:34 UTC
[Rd] valgrind complains about regex.c (PR#8043)
On Tue, Aug 02, 2005 at 07:50:54AM -0400, Duncan Murdoch wrote:> Prof Brian Ripley wrote: > >Did you compile R without optimization? Such reads are often the result > >of read-aheads produced by the optimizer in an attempt to keep > >pipelines full (and are harmless). > > There were both a read and a write. I can see the read being harmless, > but is the write harmless? I suspect this may be the bug I fixed on > July 16, since it had to do with character classes including ranges > (like Charlie's "[a-pr-z]"). > > Charlie, have you tried a recent version of R-patched?No. And I can't do it right away. I'm packing up to move back to Minneapolis after my sabbatical year in Seattle. Maybe in a few days. Sorry to not be more helpful. Maybe I'll try it on the plane if I can.> Duncan Murdoch > > > > >On an un-optimized build of R I am unable to reproduce this. (I also was > >unable to reproduce it on my optimized build of 2.1.1 using gcc 3.4.4, > >although I did get a report on other read-aheads.) > > > >On Mon, 1 Aug 2005 charlie at stat.umn.edu wrote: > > > > > >>I think I am using objects according to the man page. > >>This seems to be a valid regular expression. But whether > >>I know what I'm doing or no, it still shouldn't be doing > >>what valgrind seems to be saying it's doing. (IMHO) > > > > > >I think you need to take that up with compiler designers: it is common > >practice. > > > > > >>---------- start of script ---------- > >>Script started on Mon 01 Aug 2005 02:09:00 PM PDT > >>linux$ printenv VALGRIND_OPTS > >>--tool=3Dmemcheck > >>linux$ cat bar.R > >> > >>foo <- 1 > >>bar <- 2:3 > >>baz <- 4:6 > >>qux <- matrix(7:10, 2) > >> > >>ls() > >>rm(list =3D objects(pattern =3D "^[a-pr-z]")) > >>ls() > >> > >>linux$ R --version > >>R 2.1.1 (2005-06-20). > >>Copyright (C) 2005 R Development Core Team > >> > >>R is free software and comes with ABSOLUTELY NO WARRANTY. > >>You are welcome to redistribute it under the terms of the GNU > >>General Public License. For more information about these matters, > >>see http://www.gnu.org/copyleft/gpl.html. > >>linux$ gcc --version > >>=1B[0mgcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux) > >>=1B[0mCopyright (C) 2003 Free Software Foundation, Inc. > >>=1B[0mThis is free software; see the source for copying conditions. > >>There > >>is NO > >>=1B[0mwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR > >>PU> >>RPOSE. > >>=1B[0m > >>linux$ cat /etc/SuSE-release=20 > >>SuSE Linux 9.3 (i586) > >>VERSION =3D 9.3 > >>linux$ R --vanilla --debugger=3Dvalgrind < bar.R >| bar.Rout > >>=3D=3D22324=3D=3D Memcheck, a memory error detector for x86-linux. > >>=3D=3D22324=3D=3D Copyright (C) 2002-2004, and GNU GPL'd, by Julian > >>Seward > >>et al. > >>=3D=3D22324=3D=3D Using valgrind-2.2.0, a program supervision framework > >>for> >>x86-linux. > >>=3D=3D22324=3D=3D Copyright (C) 2000-2004, and GNU GPL'd, by Julian > >>Seward > >>et al. > >>=3D=3D22324=3D=3D For more details, rerun with: -v > >>=3D=3D22324=3D=3D=20 > >>=3D=3D22324=3D=3D Invalid read of size 4 > >>=3D=3D22324=3D=3D at 0x81255AD: parse_expression (regex.c:5045) > >>=3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) > >>=3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) > >>=3D=3D22324=3D=3D by 0x81261B3: Rf_regcomp (regex.c:4384) > >>=3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 > >>a> >>lloc'd > >>=3D=3D22324=3D=3D at 0x1B90650D: calloc (in > >>/usr/lib/valgrind/vgpreload_> >>memcheck.so) > >>=3D=3D22324=3D=3D by 0x81247B5: parse_expression (regex.c:5406) > >>=3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) > >>=3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) > >>=3D=3D22324=3D=3D=20 > >>=3D=3D22324=3D=3D Invalid write of size 4 > >>=3D=3D22324=3D=3D at 0x81255B2: parse_expression (regex.c:5045) > >>=3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) > >>=3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) > >>=3D=3D22324=3D=3D by 0x81261B3: Rf_regcomp (regex.c:4384) > >>=3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 > >>a> >>lloc'd > >>=3D=3D22324=3D=3D at 0x1B90650D: calloc (in > >>/usr/lib/valgrind/vgpreload_> >>memcheck.so) > >>=3D=3D22324=3D=3D by 0x81247B5: parse_expression (regex.c:5406) > >>=3D=3D22324=3D=3D by 0x8125868: parse_branch (regex.c:4475) > >>=3D=3D22324=3D=3D by 0x8125913: parse_reg_exp (regex.c:4420) > >>=3D=3D22324=3D=3D=20 > >>=3D=3D22324=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 39 > >>f> >>rom 2) > >>=3D=3D22324=3D=3D malloc/free: in use at exit: 12691882 bytes in 6426 > >>block> >>s. > >>=3D=3D22324=3D=3D malloc/free: 32534 allocs, 26108 frees, 33105500 bytes > >>al> >>located. > >>=3D=3D22324=3D=3D For a detailed leak analysis, rerun with: --leak-check> >>=3Dyes > >>=3D=3D22324=3D=3D For counts of detected errors, rerun with: -v > >>linux$ exit > >> > >>Script done on Mon 01 Aug 2005 02:10:42 PM PDT > >>---------- end of script ---------- > >>--=20 > >>Charles Geyer > >>Professor, School of Statistics > >>University of Minnesota > >>charlie at stat.umn.edu > >> > >>______________________________________________ > >>R-devel at r-project.org mailing list > >>https://stat.ethz.ch/mailman/listinfo/r-devel > >> > >> > > > >-- Charles Geyer Professor, School of Statistics University of Minnesota charlie at stat.umn.edu
charlie@stat.umn.edu
2005-Aug-03 20:08 UTC
[Rd] valgrind complains about regex.c (PR#8043)
On Tue, Aug 02, 2005 at 07:50:54AM -0400, Duncan Murdoch wrote:> Prof Brian Ripley wrote: > >Did you compile R without optimization? Such reads are often the result > >of read-aheads produced by the optimizer in an attempt to keep > >pipelines full (and are harmless). > > There were both a read and a write. I can see the read being harmless, > but is the write harmless? I suspect this may be the bug I fixed on > July 16, since it had to do with character classes including ranges > (like Charlie's "[a-pr-z]"). > > Charlie, have you tried a recent version of R-patched?Now I have. The computer is my laptop and not connected to the net so I can't upload details, but R-1.2.1-patched as of yesterday does NOT exhibit the same bug. So I guess you are right. Sorry for wasting your time. I'm still a newbie at this R stuff. Next time I'll check against R-*-patched before submitting a bug report. -- Charles Geyer Professor, School of Statistics University of Minnesota charlie at stat.umn.edu