Mailing List Archive

[Bug 68763] ring warnings with CFLAGS=-fsanitize=undefined
https://bz.apache.org/bugzilla/show_bug.cgi?id=68763

--- Comment #1 from Yann Ylavic <ylavic.dev@gmail.com> ---
I cannot reproduce this with clang (tried v14 and v16) with httpd/apr both
trunk. Does it happen with apr-1.7.4 only?

Not sure what it's complaining about either, it looks like it finds a
NULL-deref through APR_RING_SENTINEL(ring, ...) where the ring cannot possibly
be NULL where reported, and AFAICT it's the only thing dereferenced by
APR_RING_SENTINEL()..

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 68763] ring warnings with CFLAGS=-fsanitize=undefined [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=68763

--- Comment #2 from Yann Ylavic <ylavic.dev@gmail.com> ---
Also does it happen with -fno-strict-aliasing too?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 68763] ring warnings with CFLAGS=-fsanitize=undefined [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=68763

Eric Covener <covener@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Component|Core |APR
Product|Apache httpd-2 |APR
Assignee|bugs@httpd.apache.org |bugs@apr.apache.org
Version|2.5-HEAD |1.7.4

--- Comment #3 from Eric Covener <covener@gmail.com> ---
After some confusing results along the way:

* -fno-strict-aliasing no affect
* 1.7.4 fails and trunk works
* just testpoll in apr is enough to hit presumably the same warning (at least
if epoll is built).


The difference seems to be APR_OFFSETOF being used in my 1.7.4 vs
__builtin_offsetof


-E output

1.7.4:

do { ((&pollset->p->query_ring))->next = (struct pfd_elem_t *)((char
*)(&((&pollset->p->query_ring))->next) - ((long) (((char *) (&(((struct
pfd_elem_t*)((void*)0))->link))) - ((char *) ((void*)0)))));
((&pollset->p->query_ring))->prev = (struct pfd_elem_t *)((char
*)(&((&pollset->p->query_ring))->next) - ((long) (((char *) (&(((struct
pfd_elem_t*)((void*)0))->link))) - ((char *) ((void*)0))))); } while (0);

trunk:
do { ((&pollset->p->query_ring))->next = (struct pfd_elem_t *)((char
*)(&((&pollset->p->query_ring))->next) - __builtin_offsetof(struct pfd_elem_t,
link)); ((&pollset->p->query_ring))->prev = (struct pfd_elem_t *)((char
*)(&((&pollset->p->query_ring))->next) - __builtin_offsetof(struct pfd_elem_t,
link)); } while (0);

But I couldn't spot what makes them different (I am just configuring both with:
env CC=clang CFLAGS="-fsanitize=undefined" ./configure --prefix=$PWD/built

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org