#15414 closed defect (fixed)

Adapt valgrind to changes in glibc-2.34

Reported by: Douglas R. Reno Owned by: Douglas R. Reno
Priority: normal Milestone: 11.0
Component: BOOK Version: git
Severity: normal Keywords:
Cc:

Description

When running valgrind-3.17.0 under glibc-2.34, several modifications are required due to the libc/libpthread combination changes, as well as new system calls.

This can be seen when running the tests:

== 723 tests, 189 stderr failures, 0 stdout failures, 1 stderrB failure, 1 stdoutB failure, 1 post failure ==
gdbserver_tests/hginfo                   (stderr)
gdbserver_tests/hginfo                   (stderrB)
gdbserver_tests/mcinfcallWSRU            (stderr)
gdbserver_tests/nlcontrolc               (stderr)
gdbserver_tests/nlcontrolc               (stdoutB)
gdbserver_tests/nlpasssigalrm            (stderr)
gdbserver_tests/nlvgdbsigqueue           (stderr)
memcheck/tests/addressable               (stderr)
memcheck/tests/cdebug_zlib_gnu           (stderr)
memcheck/tests/descr_belowsp             (stderr)
memcheck/tests/err_disable3              (stderr)
memcheck/tests/err_disable4              (stderr)
memcheck/tests/leak_cpp_interior         (stderr)
memcheck/tests/overlap                   (stderr)
memcheck/tests/reach_thread_register     (stderr)
memcheck/tests/supp_unknown              (stderr)
memcheck/tests/thread_alloca             (stderr)
memcheck/tests/threadname                (stderr)
callgrind/tests/threads-use              (stderr)
callgrind/tests/threads                  (stderr)
helgrind/tests/annotate_hbefore          (stderr)
helgrind/tests/annotate_rwlock           (stderr)
helgrind/tests/annotate_smart_pointer    (stderr)
helgrind/tests/bar_bad                   (stderr)
helgrind/tests/bar_trivial               (stderr)
helgrind/tests/bug322621                 (stderr)
helgrind/tests/free_is_write             (stderr)
helgrind/tests/hg01_all_ok               (stderr)
helgrind/tests/hg02_deadlock             (stderr)
helgrind/tests/hg03_inherit              (stderr)
helgrind/tests/hg04_race                 (stderr)
helgrind/tests/hg05_race2                (stderr)
helgrind/tests/hg06_readshared           (stderr)
helgrind/tests/locked_vs_unlocked1_fwd   (stderr)
helgrind/tests/locked_vs_unlocked1_rev   (stderr)
helgrind/tests/locked_vs_unlocked2       (stderr)
helgrind/tests/locked_vs_unlocked3       (stderr)
helgrind/tests/pth_barrier1              (stderr)
helgrind/tests/pth_barrier2              (stderr)
helgrind/tests/pth_barrier3              (stderr)
helgrind/tests/pth_destroy_cond          (stderr)
helgrind/tests/rwlock_race               (stderr)
helgrind/tests/rwlock_test               (stderr)
helgrind/tests/stackteardown             (stderr)
helgrind/tests/tc01_simple_race          (stderr)
helgrind/tests/tc02_simple_tls           (stderr)
helgrind/tests/tc03_re_excl              (stderr)
helgrind/tests/tc05_simple_race          (stderr)
helgrind/tests/tc06_two_races            (stderr)
helgrind/tests/tc06_two_races_xml        (stderr)
helgrind/tests/tc07_hbl1                 (stderr)
helgrind/tests/tc08_hbl2                 (stderr)
helgrind/tests/tc09_bad_unlock           (stderr)
helgrind/tests/tc11_XCHG                 (stderr)
helgrind/tests/tc14_laog_dinphils        (stderr)
helgrind/tests/tc16_byterace             (stderr)
helgrind/tests/tc17_sembar               (stderr)
helgrind/tests/tc18_semabuse             (stderr)
helgrind/tests/tc19_shadowmem            (stderr)
helgrind/tests/tc20_verifywrap           (stderr)
helgrind/tests/tc21_pthonce              (stderr)
helgrind/tests/tc22_exit_w_lock          (stderr)
helgrind/tests/tc23_bogus_condwait       (stderr)
helgrind/tests/tc24_nonzero_sem          (stderr)
helgrind/tests/tls_threads               (stderr)
drd/tests/annotate_barrier               (stderr)
drd/tests/annotate_barrier_xml           (stderr)
drd/tests/annotate_hb_race               (stderr)
drd/tests/annotate_hbefore               (stderr)
drd/tests/annotate_ignore_read           (stderr)
drd/tests/annotate_ignore_rw             (stderr)
drd/tests/annotate_ignore_rw2            (stderr)
drd/tests/annotate_ignore_write          (stderr)
drd/tests/annotate_ignore_write2         (stderr)
drd/tests/annotate_order_1               (stderr)
drd/tests/annotate_order_2               (stderr)
drd/tests/annotate_order_3               (stderr)
drd/tests/annotate_rwlock                (stderr)
drd/tests/annotate_sem                   (stderr)
drd/tests/annotate_smart_pointer         (stderr)
drd/tests/annotate_smart_pointer2        (stderr)
drd/tests/annotate_spinlock              (stderr)
drd/tests/annotate_static                (stderr)
drd/tests/atomic_var                     (stderr)
drd/tests/bar_bad                        (stderr)
drd/tests/bar_bad_xml                    (stderr)
drd/tests/bar_trivial                    (stderr)
drd/tests/bug-235681                     (stderr)
drd/tests/bug322621                      (stderr)
drd/tests/circular_buffer                (stderr)
drd/tests/concurrent_close               (stderr)
drd/tests/dlopen                         (stderr)
drd/tests/fork-parallel                  (stderr)
drd/tests/fork-serial                    (stderr)
drd/tests/fp_race                        (stderr)
drd/tests/fp_race2                       (stderr)
drd/tests/fp_race_xml                    (stderr)
drd/tests/free_is_write                  (stderr)
drd/tests/free_is_write2                 (stderr)
drd/tests/hg01_all_ok                    (stderr)
drd/tests/hg02_deadlock                  (stderr)
drd/tests/hg03_inherit                   (stderr)
drd/tests/hg04_race                      (stderr)
drd/tests/hg05_race2                     (stderr)
drd/tests/hg06_readshared                (stderr)
drd/tests/linuxthreads_det               (stderr)
drd/tests/matinv                         (stderr)
drd/tests/monitor_example                (stderr)
drd/tests/pth_barrier                    (stderr)
drd/tests/pth_barrier2                   (stderr)
drd/tests/pth_barrier3                   (stderr)
drd/tests/pth_barrier_race               (stderr)
drd/tests/pth_barrier_thr_cr             (stderr)
drd/tests/pth_broadcast                  (stderr)
drd/tests/pth_cancel_locked              (stderr)
drd/tests/pth_cleanup_handler            (stderr)
drd/tests/pth_cond_race                  (stderr)
drd/tests/pth_cond_race2                 (stderr)
drd/tests/pth_cond_race3                 (stderr)
drd/tests/pth_create_chain               (stderr)
drd/tests/pth_detached                   (stderr)
drd/tests/pth_detached2                  (stderr)
drd/tests/pth_detached3                  (stderr)
drd/tests/pth_detached_sem               (stderr)
drd/tests/pth_inconsistent_cond_wait     (stderr)
drd/tests/pth_once                       (stderr)
drd/tests/pth_spinlock                   (stderr)
drd/tests/read_and_free_race             (stderr)
drd/tests/rwlock_race                    (stderr)
drd/tests/rwlock_test                    (stderr)
drd/tests/sem_as_mutex                   (stderr)
drd/tests/sem_as_mutex2                  (stderr)
drd/tests/sem_as_mutex3                  (stderr)
drd/tests/sem_open                       (stderr)
drd/tests/sem_open2                      (stderr)
drd/tests/sem_open3                      (stderr)
drd/tests/sem_open_traced                (stderr)
drd/tests/sigalrm                        (stderr)
drd/tests/std_atomic                     (stderr)
drd/tests/std_list                       (stderr)
drd/tests/std_mutex                      (stderr)
drd/tests/std_string                     (stderr)
drd/tests/std_thread                     (stderr)
drd/tests/std_thread2                    (stderr)
drd/tests/swapcontext                    (stderr)
drd/tests/tc01_simple_race               (stderr)
drd/tests/tc02_simple_tls                (stderr)
drd/tests/tc03_re_excl                   (stderr)
drd/tests/tc05_simple_race               (stderr)
drd/tests/tc06_two_races                 (stderr)
drd/tests/tc07_hbl1                      (stderr)
drd/tests/tc08_hbl2                      (stderr)
drd/tests/tc09_bad_unlock                (stderr)
drd/tests/tc11_XCHG                      (stderr)
drd/tests/tc16_byterace                  (stderr)
drd/tests/tc17_sembar                    (stderr)
drd/tests/tc18_semabuse                  (stderr)
drd/tests/tc19_shadowmem                 (stderr)
drd/tests/tc21_pthonce                   (stderr)
drd/tests/tc22_exit_w_lock               (stderr)
drd/tests/tc23_bogus_condwait            (stderr)
drd/tests/tc24_nonzero_sem               (stderr)
drd/tests/thread_name                    (stderr)
drd/tests/thread_name_xml                (stderr)
drd/tests/threaded-fork-vcs              (stderr)
drd/tests/threaded-fork                  (stderr)
drd/tests/tls_threads                    (stderr)
massif/tests/deep-D                      (post)
none/tests/coolo_sigaction               (stderr)
none/tests/linux/pthread-stack           (stderr)
none/tests/manythreads                   (stderr)
none/tests/ppoll_alarm                   (stderr)
none/tests/pselect_alarm                 (stderr)
none/tests/pth_2sig                      (stderr)
none/tests/pth_atfork1                   (stderr)
none/tests/pth_blockedsig                (stderr)
none/tests/pth_cancel1                   (stderr)
none/tests/pth_cancel2                   (stderr)
none/tests/pth_cvsimple                  (stderr)
none/tests/pth_exit                      (stderr)
none/tests/pth_once                      (stderr)
none/tests/pth_self_kill_15_other        (stderr)
none/tests/pth_self_kill_9               (stderr)
none/tests/pth_stackalign                (stderr)
none/tests/pth_term_signal               (stderr)
none/tests/res_search                    (stderr)
none/tests/sigsusp                       (stderr)
none/tests/system                        (stderr)
none/tests/thread-exits                  (stderr)
none/tests/threaded-fork                 (stderr)
none/tests/threadederrno                 (stderr)
none/tests/tls                           (stderr)

...checking makefile consistency
...checking header files and include directives

There are several fixes upstream for glibc-2.34, so I'll create a patch and backport them.

Change History (3)

comment:1 by Douglas R. Reno, 14 months ago

Owner: changed from blfs-book to Douglas R. Reno
Status: newassigned

comment:2 by Douglas R. Reno, 14 months ago

https://sourceware.org/git?p=valgrind.git;a=commit;h=22bae4b1544fc5d82f131ef8fde4cea7666112c2

https://sourceware.org/git?p=valgrind.git;a=commit;h=61307ee83121aa5f0b57a12a80e90fc2f414380a

https://sourceware.org/git?p=valgrind.git;a=commit;h=6da22a4d246519cd1a638cfc7eff00cdd74413c4

https://sourceware.org/git?p=valgrind.git;a=commit;h=200b6a5a0ea3e1e154663b0fc575bfe2becf177d

https://sourceware.org/git?p=valgrind.git;a=commit;h=a1364805fc74b5690f763033c0c9b43f27613572

https://sourceware.org/git?p=valgrind.git;a=commit;h=74cc3babae971bf8c72269fa3513eba88f9cf6be

https://sourceware.org/git?p=valgrind.git;a=commit;h=52ed51fc35f8a6148c2940eb46932b02dd3b9b23

https://sourceware.org/git?p=valgrind.git;a=commit;h=44da99781e5bb954a0cd3c897b859012a125fec6

A good chunk of these seem to be related to system call changes and changes in libpthread/libc.

Generate a ENOSYS (sys_ni_syscall) for clone3 on all linux arches

glibc 2.34 will try to use clone3 first before falling back to
the clone syscall. So implement clone3 as sys_ni_syscall which
simply return ENOSYS without producing a warning.
gdbserver_tests: update filters for newer glibc/gdb

With newer glibc/gdb we might see a __select call without anything
following on the line. Also when gdb cannot find a file it might
now print "Inappropriate ioctl for device" instead of the message
"No such file or directory"
Update helgrind and drd suppression libc and libpthread paths in glibc 2.34

glibc 2.34 moved all pthread functions into the main libc library.
And it changed the (in memory) path of the main libc library to
libc.so.6 (before it was libc-2.xx.so).

This breaks various standard suppressions for helgrind and drd.
Fix this by doing a configure check for whether we are using glibc
2.34 by checking whether pthread_create is in libc instead of in
libpthread. If we are using glibc then define GLIBC_LIBC_PATH and
GLIBC_LIBPTHREAD_PATH variables that point to the (regexp) path
of the library that contains all libc functions and pthread functions
(which will be the same path for glibc 2.34+).

Rename glibc-2.34567-NPTL-helgrind.supp to glibc-2.X-helgrind.supp.in
and glibc-2.X-drd.supp to glibc-2.X-drd.supp.in and replace the
GLIBC_LIBC_PATH and GLIBC_LIBPTHREAD_PATH at configure time.

The same could be done for the glibc-2.X.supp.in file, but hasn't
yet because it looks like most suppressions in that file are obsolete.

It looks like we'll need to run autoreconf on the sources as well after this.

comment:3 by Douglas R. Reno, 14 months ago

Resolution: fixed
Status: assignedclosed

That was a large patch that took me a couple hours to get right and working properly, but it's now fixed.

Fixed at 2c76fcd64167d985aa2ca57c4d1e317595f1acec

Note: See TracTickets for help on using tickets.