Skip to content

glb does not compile on Ubuntu 24.04 #38

Description

@shinguz

The same code and the same build script worked in Ubuntu 20.04 and 22.04 as well as on Debian 10 - 12. Compiling on Ubuntu 24.04 gave an error:

gcc --version
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0

make
make all-recursive
make[1]: Entering directory '/home/build/buildpack/glb-1.0.1'
Making all in src
make[2]: Entering directory '/home/build/buildpack/glb-1.0.1/src'
gcc -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -D_GNU_SOURCE -DUSE_EPOLL -Wdate-time -D_FORTIFY_SOURCE=3 -g -O3 -Wall -Werror -DGLBD -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/home/build/buildpack/glb-1.0.1=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/home/build/buildpack/glb-1.0.1=/usr/src/glb-1.0.1-3-noble -c -o glbd-glb_wdog.o test -f 'glb_wdog.c' || echo './'glb_wdog.c
glb_wdog.c: In function 'wdog_copy_result':
glb_wdog.c:335:21: error: pointer 'others_72' may be used after 'realloc' [-Werror=use-after-free]
335 | free (others);
| ^~~~~~~~~~~~~
glb_wdog.c:332:36: note: call to 'realloc' here
332 | d->result.others = realloc (others, res->others_len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:720: glbd-glb_wdog.o] Error 1
make[2]: Leaving directory '/home/build/buildpack/glb-1.0.1/src'
make[1]: *** [Makefile:413: all-recursive] Error 1
make[1]: Leaving directory '/home/build/buildpack/glb-1.0.1'
make: *** [Makefile:345: all] Error 2

329 if (others_len < res->others_len ||
330 others_len > (res->others_len * 2)) {
331 // buffer size is too different, reallocate
332 d->result.others = realloc (others, res->others_len);
333 if (!d->result.others && res->others_len > 0) {
334 // this is pretty much fatal, but we'll try
335 free (others);
336 d->result.others_len = 0;
337 }
338 else {
339 changed_length = true;
340 d->result.others_len = res->others_len;
341 }
342 }

Would be happy for a fix/hint. Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions