New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
valgrind errors in t/op/vec.t #13638
Comments
From @khwilliamsonA bisect yields this: 032061d is the first bad commit Fix for [perl #9423] vec assignments generate 2 warnings :100644 100644 1bd16b5e668fdbd0d0be725e26625fd93cbf4051 b2b6546d8cd32bfffa1c65112697a04de9560090 M doop.c |
From @tonycozOn Mon Mar 03 11:28:21 2014, khw wrote:
This is happening when using vec() to modify an undef sv, eg: $ valgrind -q ./perl -e 'vec($Foo, 0, 1) = 1' The error is on this line:
where we examine sv->sv_u.svu_pv when it hasn't been initialized yet. The following change prevents the error and passes all tests (DEBUGGING): Inline Patchdiff --git a/sv.c b/sv.c
index dcb1d5e..4742c7d 100644
--- a/sv.c
+++ b/sv.c
@@ -9502,7 +9502,8 @@ Perl_sv_pvn_force_flags(pTHX_ SV *const sv, STRLEN *const
if (lp)
*lp = len;
- if (s != SvPVX_const(sv)) { /* Almost, but not quite, sv_setpvn() */
+ if (SvTYPE(sv) < SVt_PV ||
+ s != SvPVX_const(sv)) { /* Almost, but not quite, sv_setpvn() */
if (SvROK(sv))
sv_unref(sv);
SvUPGRADE(sv, SVt_PV); /* Never FALSE */
Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @shlomifOn Sun Mar 23 21:15:44 2014, tonyc wrote:
I wanted to test your patch but could not because it didn't apply cleanly using "patch -p1 < …". The problem seems to be that it is all whitespace, while the sources use a mixture of tabs and spaces. I can apply it manually and provide a new patch, but shouldn't the patch be attached? Regards, -- Shlomi Fish |
From @shlomifOn Tue Mar 25 01:24:32 2014, shlomif wrote:
The reworked patch is attached to this comment. All tests are successful here (Mageia Linux x86-64 5/Cauldron). Regards, -- Shlomi Fish |
From @shlomifrt121366.diffdiff --git a/sv.c b/sv.c
index dcb1d5e..9afe983 100644
--- a/sv.c
+++ b/sv.c
@@ -9502,7 +9502,8 @@ Perl_sv_pvn_force_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags)
if (lp)
*lp = len;
- if (s != SvPVX_const(sv)) { /* Almost, but not quite, sv_setpvn() */
+ if (SvTYPE(sv) < SVt_PV ||
+ s != SvPVX_const(sv)) { /* Almost, but not quite, sv_setpvn() */
if (SvROK(sv))
sv_unref(sv);
SvUPGRADE(sv, SVt_PV); /* Never FALSE */
|
From @HugmeirOn Mon, Mar 24, 2014 at 5:15 AM, Tony Cook via RT
Thanks for picking up this, Tony! I haven't been able to get valgrind |
From @tonycozOn Sun Mar 23 21:15:44 2014, tonyc wrote:
Pushed the fix as e141190. Tony |
@tonycoz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#121366 (status was 'resolved')
Searchable as RT121366$
The text was updated successfully, but these errors were encountered: