You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include any warning/errors/backtraces from the system logs
CC lib/libuutil/libuutil_la-uu_list.lo
In function 'list_walk_init',
inlined from 'uu_list_walk' at lib/libuutil/uu_list.c:511:3:
lib/libuutil/uu_list.c:419:32: error: storing the address of local variable 'my_walk' in '((uu_list_walk_t *)((char *)lp + 32))[1].ulw_prev' [-Werror=dangling-pointer=]
419 | next->ulw_prev = wp;
| ~~~~~~~~~~~~~~~^~~~
lib/libuutil/uu_list.c: In function 'uu_list_walk':
lib/libuutil/uu_list.c:508:32: note: 'my_walk' declared here
508 | uu_list_walk_t my_walk;
| ^~~~~~~
lib/libuutil/uu_list.c:493:25: note: 'lp' declared here
493 | uu_list_walk(uu_list_t *lp, uu_walk_fn_t *func, void *private, uint32_t flags)
| ~~~~~~~~~~~^~
cc1: all warnings being treated as errors
A naive glance makes me think the my_walk variable being dangled is only used on a debug codepath:
if (lp->ul_debug||robust) {
uu_list_walk_tmy_walk;
void*e;
list_walk_init(&my_walk, lp, flags);
while (status==UU_WALK_NEXT&&
(e=uu_list_walk_next(&my_walk)) !=NULL)
status= (*func)(e, private);
list_walk_fini(&my_walk);
} else {
- Workaround dangling pointer in uu_list.c (#16124)
- Fix calloc() transposed arguments in zpool_vdev_os.c
- Make some temp variables unsigned to prevent triggering a
'-Werror=alloc-size-larger-than' error.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes#16124Closes#16125
lundman
pushed a commit
to openzfsonwindows/openzfs
that referenced
this issue
Sep 4, 2024
- Workaround dangling pointer in uu_list.c (openzfs#16124)
- Fix calloc() transposed arguments in zpool_vdev_os.c
- Make some temp variables unsigned to prevent triggering a
'-Werror=alloc-size-larger-than' error.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closesopenzfs#16124Closesopenzfs#16125
System information
Describe the problem you're observing
GCC 14 on Fedora 40 gives dangling pointer error.
Describe how to reproduce the problem
make
on F40Include any warning/errors/backtraces from the system logs
A naive glance makes me think the
my_walk
variable being dangled is only used on a debug codepath:Workaround:
The text was updated successfully, but these errors were encountered: