Skip to content
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 Perl_hv_iternext_flags #13627

Closed
p5pRT opened this issue Feb 27, 2014 · 8 comments
Closed

valgrind errors in Perl_hv_iternext_flags #13627

p5pRT opened this issue Feb 27, 2014 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 27, 2014

Migrated from rt.perl.org#121336 (status was 'resolved')

Searchable as RT121336$

@p5pRT
Copy link
Author

p5pRT commented Feb 27, 2014

From @khwilliamson

dist/Thread-Queue/t/02_refs ...................................
==23653== Thread 2​:
==23653== Conditional jump or move depends on uninitialised value(s)
==23653== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)
==23653== by 0x6CADD2​: Perl_do_kv (doop.c​:1271)
==23653== by 0x5AE304​: Perl_pp_rv2av (pp_hot.c​:934)
==23653== by 0x552D01​: Perl_runops_debug (dump.c​:2372)
==23653== by 0x45D50A​: Perl_call_sv (perl.c​:2760)
==23653== by 0xC8CD02D​: S_ithread_run(void*) (threads.xs​:520)
==23653== by 0x568D850​: start_thread (in /lib64/libpthread-2.12.so)
==23653== by 0x5F1590C​: clone (in /lib64/libc-2.12.so)
==23653==
==23653== Conditional jump or move depends on uninitialised value(s)
==23653== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)
==23653== by 0x6CADD2​: Perl_do_kv (doop.c​:1271)
==23653== by 0x552D01​: Perl_runops_debug (dump.c​:2372)
==23653== by 0x45D50A​: Perl_call_sv (perl.c​:2760)
==23653== by 0xC8CD02D​: S_ithread_run(void*) (threads.xs​:520)
==23653== by 0x568D850​: start_thread (in /lib64/libpthread-2.12.so)
==23653== by 0x5F1590C​: clone (in /lib64/libc-2.12.so)
==23653==
==23653== Use of uninitialised value of size 8
==23653== at 0x59E93B​: Perl_hv_iternext_flags (hv.c​:2529)
==23653== by 0x6CADD2​: Perl_do_kv (doop.c​:1271)
==23653== by 0x552D01​: Perl_runops_debug (dump.c​:2372)
==23653== by 0x45D50A​: Perl_call_sv (perl.c​:2760)
==23653== by 0xC8CD02D​: S_ithread_run(void*) (threads.xs​:520)
==23653== by 0x568D850​: start_thread (in /lib64/libpthread-2.12.so)
==23653== by 0x5F1590C​: clone (in /lib64/libc-2.12.so)
==23653==

ok


dist/Thread-Queue/t/03_peek ...................................
==23656== Thread 3​:
==23656== Conditional jump or move depends on uninitialised value(s)
==23656== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)
==23656== by 0x6CADD2​: Perl_do_kv (doop.c​:1271)
==23656== by 0x5AE304​: Perl_pp_rv2av (pp_hot.c​:934)
==23656== by 0x552D01​: Perl_runops_debug (dump.c​:2372)
==23656== by 0x45D50A​: Perl_call_sv (perl.c​:2760)
==23656== by 0xC8CD02D​: S_ithread_run(void*) (threads.xs​:520)
==23656== by 0x568D850​: start_thread (in /lib64/libpthread-2.12.so)
==23656== by 0x5F1590C​: clone (in /lib64/libc-2.12.so)
==23656==

ok


ext/Hash-Util-FieldHash/t/03_class ............................
==26076== Thread 2​:
==26076== Conditional jump or move depends on uninitialised value(s)
==26076== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)
==26076== by 0xCEE35B3​: HUF_fix_objects(interpreter*) (FieldHash.xs​:328)
==26076== by 0xCEE4A7D​: XS_Hash__Util__FieldHash_CLONE(interpreter*,
cv*) (FieldHash.xs​:445)
==26076== by 0x5BD7DD​: Perl_pp_entersub (pp_hot.c​:2768)
==26076== by 0x45D25B​: Perl_call_sv (perl.c​:2745)
==26076== by 0x620737​: perl_clone (sv.c​:13879)
==26076== by 0xD0F0DF7​: S_ithread_create(interpreter*, sv*, long,
int, int, int, int) (threads.xs​:785)
==26076== by 0xD0F52A3​: XS_threads_create(interpreter*, cv*)
(threads.xs​:1100)
==26076== by 0x5BD7DD​: Perl_pp_entersub (pp_hot.c​:2768)
==26076== by 0x552D01​: Perl_runops_debug (dump.c​:2372)
==26076== by 0x45D50A​: Perl_call_sv (perl.c​:2760)
==26076== by 0xD0EB02D​: S_ithread_run(void*) (threads.xs​:520)
==26076==
==26076== Use of uninitialised value of size 8
==26076== at 0x59E93B​: Perl_hv_iternext_flags (hv.c​:2529)
==26076== by 0xCEE35B3​: HUF_fix_objects(interpreter*) (FieldHash.xs​:328)
==26076== by 0xCEE4A7D​: XS_Hash__Util__FieldHash_CLONE(interpreter*,
cv*) (FieldHash.xs​:445)
==26076== by 0x5BD7DD​: Perl_pp_entersub (pp_hot.c​:2768)
==26076== by 0x45D25B​: Perl_call_sv (perl.c​:2745)
==26076== by 0x620737​: perl_clone (sv.c​:13879)
==26076== by 0xD0F0DF7​: S_ithread_create(interpreter*, sv*, long,
int, int, int, int) (threads.xs​:785)
==26076== by 0xD0F52A3​: XS_threads_create(interpreter*, cv*)
(threads.xs​:1100)
==26076== by 0x5BD7DD​: Perl_pp_entersub (pp_hot.c​:2768)
==26076== by 0x552D01​: Perl_runops_debug (dump.c​:2372)
==26076== by 0x45D50A​: Perl_call_sv (perl.c​:2760)
==26076== by 0xD0EB02D​: S_ithread_run(void*) (threads.xs​:520)
==26076==

ok


ext/Hash-Util-FieldHash/t/04_thread ...........................
==26083== Conditional jump or move depends on uninitialised value(s)
==26083== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)
==26083== by 0xCEE35B3​: HUF_fix_objects(interpreter*) (FieldHash.xs​:328)
==26083== by 0xCEE4A7D​: XS_Hash__Util__FieldHash_CLONE(interpreter*,
cv*) (FieldHash.xs​:445)
==26083== by 0x5BD7DD​: Perl_pp_entersub (pp_hot.c​:2768)
==26083== by 0x45D25B​: Perl_call_sv (perl.c​:2745)
==26083== by 0x620737​: perl_clone (sv.c​:13879)
==26083== by 0xD0F0DF7​: S_ithread_create(interpreter*, sv*, long,
int, int, int, int) (threads.xs​:785)
==26083== by 0xD0F52A3​: XS_threads_create(interpreter*, cv*)
(threads.xs​:1100)
==26083== by 0x5BD7DD​: Perl_pp_entersub (pp_hot.c​:2768)
==26083== by 0x552D01​: Perl_runops_debug (dump.c​:2372)
==26083== by 0x45BE7C​: S_run_body (perl.c​:2445)
==26083== by 0x45B29E​: perl_run (perl.c​:2361)
==26083==

ok

See http​://www.nntp.perl.org/group/perl.perl5.porters/2014/01/msg211520.html
--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Feb 28, 2014

From @iabyn

On Wed, Feb 26, 2014 at 08​:42​:35PM -0800, Karl Williamson wrote​:

dist/Thread-Queue/t/02_refs ...................................
==23653== Thread 2​:
==23653== Conditional jump or move depends on uninitialised value(s)
==23653== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)

These are all fixed by the following commit, which is a candidate for 5.18
too.

commit 1864609
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Fri Feb 28 14​:37​:13 2014 +0000
Commit​: David Mitchell <davem@​iabyn.com>
CommitDate​: Fri Feb 28 14​:37​:13 2014 +0000

  copy xhv_rand and xhv_last_rand in threads clone
 
  valgrind complains about these fields being uninitialised when cloned into a
  new thread, because they aren't copied. It's fairly harmless, since these
  fields are just used to perturb hash key iteration; but for completeness,
  clone these fields too.

--
This is a great day for France!
  -- Nixon at Charles De Gaulle's funeral

@p5pRT
Copy link
Author

p5pRT commented Feb 28, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Feb 28, 2014

From @demerphq

On 28 February 2014 15​:41, Dave Mitchell <davem@​iabyn.com> wrote​:

On Wed, Feb 26, 2014 at 08​:42​:35PM -0800, Karl Williamson wrote​:

dist/Thread-Queue/t/02_refs ...................................
==23653== Thread 2​:
==23653== Conditional jump or move depends on uninitialised value(s)
==23653== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)

These are all fixed by the following commit, which is a candidate for 5.18
too.

commit 1864609
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Fri Feb 28 14​:37​:13 2014 +0000
Commit​: David Mitchell <davem@​iabyn.com>
CommitDate​: Fri Feb 28 14​:37​:13 2014 +0000

copy xhv\_rand and xhv\_last\_rand in threads clone

valgrind complains about these fields being uninitialised when cloned into a
new thread\, because they aren't copied\. It's fairly harmless\, since these
fields are just used to perturb hash key iteration; but for completeness\,
clone these fields too\.

Oh shoot. My bad, sorry. Thanks for fixing that.

Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"

@p5pRT
Copy link
Author

p5pRT commented Apr 16, 2014

From @tonycoz

On Fri Feb 28 06​:43​:30 2014, davem wrote​:

On Wed, Feb 26, 2014 at 08​:42​:35PM -0800, Karl Williamson wrote​:

dist/Thread-Queue/t/02_refs ...................................
==23653== Thread 2​:
==23653== Conditional jump or move depends on uninitialised value(s)
==23653== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)

These are all fixed by the following commit, which is a candidate for
5.18
too.

commit 1864609
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Fri Feb 28 14​:37​:13 2014 +0000
Commit​: David Mitchell <davem@​iabyn.com>
CommitDate​: Fri Feb 28 14​:37​:13 2014 +0000

copy xhv_rand and xhv_last_rand in threads clone

valgrind complains about these fields being uninitialised when cloned
into a
new thread, because they aren't copied. It's fairly harmless, since
these
fields are just used to perturb hash key iteration; but for
completeness,
clone these fields too.

+1 from me for backport to maint-5.18.

Tony

@p5pRT
Copy link
Author

p5pRT commented Apr 16, 2014

From @khwilliamson

On 04/15/2014 07​:02 PM, Tony Cook via RT wrote​:

On Fri Feb 28 06​:43​:30 2014, davem wrote​:

On Wed, Feb 26, 2014 at 08​:42​:35PM -0800, Karl Williamson wrote​:

dist/Thread-Queue/t/02_refs ...................................
==23653== Thread 2​:
==23653== Conditional jump or move depends on uninitialised value(s)
==23653== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)

These are all fixed by the following commit, which is a candidate for
5.18
too.

commit 1864609
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Fri Feb 28 14​:37​:13 2014 +0000
Commit​: David Mitchell <davem@​iabyn.com>
CommitDate​: Fri Feb 28 14​:37​:13 2014 +0000

copy xhv_rand and xhv_last_rand in threads clone

valgrind complains about these fields being uninitialised when cloned
into a
new thread, because they aren't copied. It's fairly harmless, since
these
fields are just used to perturb hash key iteration; but for
completeness,
clone these fields too.

+1 from me for backport to maint-5.18.

Tony

+1

@p5pRT
Copy link
Author

p5pRT commented Apr 16, 2014

From @tonycoz

On Tue Apr 15 18​:09​:34 2014, public@​khwilliamson.com wrote​:

On 04/15/2014 07​:02 PM, Tony Cook via RT wrote​:

On Fri Feb 28 06​:43​:30 2014, davem wrote​:

On Wed, Feb 26, 2014 at 08​:42​:35PM -0800, Karl Williamson wrote​:

dist/Thread-Queue/t/02_refs ...................................
==23653== Thread 2​:
==23653== Conditional jump or move depends on uninitialised value(s)
==23653== at 0x59E78C​: Perl_hv_iternext_flags (hv.c​:2503)

These are all fixed by the following commit, which is a candidate for
5.18
too.

commit 1864609
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Fri Feb 28 14​:37​:13 2014 +0000
Commit​: David Mitchell <davem@​iabyn.com>
CommitDate​: Fri Feb 28 14​:37​:13 2014 +0000

copy xhv_rand and xhv_last_rand in threads clone

valgrind complains about these fields being uninitialised when cloned
into a
new thread, because they aren't copied. It's fairly harmless, since
these
fields are just used to perturb hash key iteration; but for
completeness,
clone these fields too.

+1 from me for backport to maint-5.18.

Tony

+1

Which is a third vote, taking "which is a candidate for 5.18" from Dave as a vote.

cherry-picked as 2396ba2.

Tony

@p5pRT
Copy link
Author

p5pRT commented Apr 16, 2014

@tonycoz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant