Closed Bug 1387572 Opened 7 years ago Closed 7 years ago

Build of mozjemalloc.cpp is failing with --enable-warnings-as-errors (-Werror=uninitialized)

Categories

(Core :: Memory Allocator, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

Details

Attachments

(1 file)

With gcc 7 0:17.20 /usr/bin/g++-7 -std=gnu++11 -o mozjemalloc.o -c -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/system_wrappers -include /root/firefox-gcc-last/config/gcc_hidden.h -DDEBUG=1 -DMOZ_JEMALLOC_IMPL -DMOZ_HAS_MOZGLUE -I/root/firefox-gcc-last/memory/mozjemalloc -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/memory/mozjemalloc -I/root/firefox-gcc-last/memory/build -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/mozilla-config.h -MD -MP -MF .deps/mozjemalloc.o.pp -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wc++1z-compat -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-overflow=2 -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -Os -fno-omit-frame-pointer -Werror -Wno-unused-function -fdiagnostics-color /root/firefox-gcc-last/memory/mozjemalloc/mozjemalloc.cpp 0:17.20 In file included from /root/firefox-gcc-last/memory/mozjemalloc/mozjemalloc.cpp:308:0: 0:17.20 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void extent_tree_szad_remove(extent_tree_t*, extent_node_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_r_s.extent_node_s::link_szad.extent_node_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 | (((uintptr_t) (a_node)->a_field.rbn_right_red) & ((size_t)1))); \ 0:17.21 ^~~~~~~~~~~~~ 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void extent_tree_ad_remove(extent_tree_t*, extent_node_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_r_s.extent_node_s::link_ad.extent_node_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void extent_tree_szad_insert(extent_tree_t*, extent_node_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_i_s.extent_node_s::link_szad.extent_node_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void extent_tree_ad_insert(extent_tree_t*, extent_node_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_i_s.extent_node_s::link_ad.extent_node_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void arena_run_tree_remove(arena_run_tree_t*, arena_chunk_map_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_r_s.arena_chunk_map_s::link.arena_chunk_map_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void arena_avail_tree_insert(arena_avail_tree_t*, arena_chunk_map_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_i_s.arena_chunk_map_s::link.arena_chunk_map_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void arena_avail_tree_remove(arena_avail_tree_t*, arena_chunk_map_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_r_s.arena_chunk_map_s::link.arena_chunk_map_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void arena_chunk_tree_dirty_remove(arena_chunk_tree_t*, arena_chunk_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_r_s.arena_chunk_s::link_dirty.arena_chunk_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void arena_chunk_tree_dirty_insert(arena_chunk_tree_t*, arena_chunk_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_i_s.arena_chunk_s::link_dirty.arena_chunk_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized] 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h: In function 'void arena_run_tree_insert(arena_run_tree_t*, arena_chunk_map_t*)': 0:17.21 /root/firefox-gcc-last/memory/mozjemalloc/rb.h:97:41: error: 'rbp_i_s.arena_chunk_map_s::link.arena_chunk_map_s::<unnamed struct>::rbn_right_red' is used uninitialized in this function [-Werror=uninitialized]
Sorry it's taking too long, but I want to be very careful here, this might actually hide a real problem, so I need to dig in some more.
Comment on attachment 8893962 [details] Bug 1387572 - Silent the -Wuninitialized warning https://reviewboard.mozilla.org/r/165040/#review177216 ::: memory/mozjemalloc/moz.build:29 (Diff revision 1) > CXXFLAGS += ['-Wno-unused-function'] > > if CONFIG['_MSC_VER']: > CXXFLAGS += ['-wd4273'] # inconsistent dll linkage (bug 558163) > > +SOURCES['mozjemalloc.cpp'].flags += ['-Wno-error=uninitialized'] Okay, after carefully reviewing the code, those uninitialized warnings are benign. But there's only one source file in this directory, so no need to apply the flag specifically to this source file only (plus, if we ever add new files, we'll go with unified sources anyways, so the flag would need to be applied globally anyways).
Attachment #8893962 - Flags: review?(mh+mozilla) → review+
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5f06e9d7c0d3 Silent the -Wuninitialized warning r=glandium
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Assignee: nobody → sledru
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: