Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Build Firefox Error in Linux when "ac_add_options --enable-address-sanitizer" is added to the file `.mozconfig`

  • No replies
  • 1 has this problem
  • 69 views
more options

when I try to build the Firefox according to fuzz-interface 。after I added ac_add_options --enable-address-sanitizer to the file ".mozconfig" there exist some errors when I run "./mach build", there comes the error info: 5:21.99 ld.lld: error: duplicate symbol: operator delete[](void*)

5:21.99 >>> defined at asan_new_delete.cc:163 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:163)
5:21.99 >>>            asan_new_delete.cc.o:(operator delete[](void*)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
5:21.99 >>> defined at cxxalloc.h:60 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:60)
5:21.99 >>>            ../../memory/mozalloc/cxxalloc.o:(.text+0x60)
5:21.99 ld.lld: error: duplicate symbol: operator delete[](void*, std::nothrow_t const&)
5:21.99 >>> defined at asan_new_delete.cc:169 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:169)
5:21.99 >>>            asan_new_delete.cc.o:(operator delete[](void*, std::nothrow_t const&)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
5:22.00 >>> defined at cxxalloc.h:65 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:65)
5:22.00 >>>            ../../memory/mozalloc/cxxalloc.o:(.text+0x70)
5:22.00 ld.lld: error: duplicate symbol: operator delete(void*)
5:22.00 >>> defined at asan_new_delete.cc:160 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:160)
5:22.00 >>>            asan_new_delete.cc.o:(operator delete(void*)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
5:22.00 >>> defined at cxxalloc.h:51 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:51)
5:22.00 >>>            ../../memory/mozalloc/cxxalloc.o:(.text+0x40)
5:22.00 ld.lld: error: duplicate symbol: operator delete(void*, std::nothrow_t const&)
5:22.00 >>> defined at asan_new_delete.cc:166 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:166)
5:22.00 >>>            asan_new_delete.cc.o:(operator delete(void*, std::nothrow_t const&)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
5:22.00 >>> defined at cxxalloc.h:56 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:56)
5:22.00 >>>            ../../memory/mozalloc/cxxalloc.o:(.text+0x50)
5:22.00 ld.lld: error: duplicate symbol: operator new[](unsigned long)
5:22.00 >>> defined at asan_new_delete.cc:102 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:102)
5:22.00 >>>            asan_new_delete.cc.o:(operator new[](unsigned long)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
5:22.00 >>> defined at cxxalloc.h:42 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:42)
5:22.00 >>>            ../../memory/mozalloc/cxxalloc.o:(.text+0x20)
5:22.00 ld.lld: error: duplicate symbol: operator new[](unsigned long, std::nothrow_t const&)
5:22.00 >>> defined at asan_new_delete.cc:108 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:108)
5:22.00 >>>            asan_new_delete.cc.o:(operator new[](unsigned long, std::nothrow_t const&)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
5:22.00 >>> defined at cxxalloc.h:47 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:47)
5:22.00 >>>            ../../memory/mozalloc/cxxalloc.o:(.text+0x30)
5:22.00 ld.lld: error: duplicate symbol: operator new(unsigned long)
5:22.00 >>> defined at asan_new_delete.cc:99 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:99)
5:22.00 >>>            asan_new_delete.cc.o:(operator new(unsigned long)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
5:22.00 >>> defined at cxxalloc.h:33 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:33)
5:22.00 >>>            ../../memory/mozalloc/cxxalloc.o:(.text+0x0)
5:22.00 ld.lld: error: duplicate symbol: operator new(unsigned long, std::nothrow_t const&)
5:22.01 >>> defined at asan_new_delete.cc:105 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105)
5:22.01 >>>            asan_new_delete.cc.o:(operator new(unsigned long, std::nothrow_t const&)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
5:22.01 >>> defined at cxxalloc.h:38 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:38)
5:22.01 >>>            ../../memory/mozalloc/cxxalloc.o:(.text+0x10)
5:22.01 clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
5:22.01 /home/szl/src/firefox_asan/config/rules.mk:458: recipe for target '../../dist/bin/firefox' failed
5:22.01 make[5]: *** [../../dist/bin/firefox] Error 1
5:22.01 /home/szl/src/firefox_asan/config/recurse.mk:72: recipe for target 'browser/app/target' failed
5:22.01 make[4]: *** [browser/app/target] Error 2
5:22.01 make[4]: *** Waiting for unfinished jobs....
5:22.02 dom/media/gmp-plugin-openh264/libfakeopenh264.so
5:22.56 3 warnings generated.
5:23.16    Compiling webrender v0.61.0 (/home/szl/src/firefox_asan/gfx/wr/webrender)
5:39.65    Compiling webrender_bindings v0.1.0 (/home/szl/src/firefox_asan/gfx/webrender_bindings)
5:58.64    Compiling geckoservo v0.0.1 (/home/szl/src/firefox_asan/servo/ports/geckolib)
6:18.81    Compiling gkrust v0.1.0 (/home/szl/src/firefox_asan/toolkit/library/rust)
6:20.75     Finished release [optimized] target(s) in 5m 21s
6:25.73 /home/szl/src/firefox_asan/config/recurse.mk:32: recipe for target 'compile' failed
6:25.73 make[3]: *** [compile] Error 2
6:25.73 /home/szl/src/firefox_asan/config/rules.mk:390: recipe for target 'default' failed
6:25.73 make[2]: *** [default] Error 2
6:25.73 client.mk:125: recipe for target 'build' failed
6:25.73 make[1]: *** [build] Error 2
6:25.74 258 compiler warnings present.
6:25.86 Notification center failed: Install notify-send (usually part of the libnotify package) to get a notification when the build finishes.

GNUmakefile:9: recipe for target 'build' failed make: *** [build] Error 2


how can I fix it?

when I try to build the Firefox according to [https://firefox-source-docs.mozilla.org/tools/fuzzing/fuzzing_interface.html fuzz-interface] 。after I added ''ac_add_options --enable-address-sanitizer'' to the file ".mozconfig" there exist some errors when I run "./mach build", there comes the error info: 5:21.99 ld.lld: error: duplicate symbol: operator delete[](void*) 5:21.99 >>> defined at asan_new_delete.cc:163 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:163) 5:21.99 >>> asan_new_delete.cc.o:(operator delete[](void*)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a 5:21.99 >>> defined at cxxalloc.h:60 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:60) 5:21.99 >>> ../../memory/mozalloc/cxxalloc.o:(.text+0x60) 5:21.99 ld.lld: error: duplicate symbol: operator delete[](void*, std::nothrow_t const&) 5:21.99 >>> defined at asan_new_delete.cc:169 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:169) 5:21.99 >>> asan_new_delete.cc.o:(operator delete[](void*, std::nothrow_t const&)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a 5:22.00 >>> defined at cxxalloc.h:65 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:65) 5:22.00 >>> ../../memory/mozalloc/cxxalloc.o:(.text+0x70) 5:22.00 ld.lld: error: duplicate symbol: operator delete(void*) 5:22.00 >>> defined at asan_new_delete.cc:160 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:160) 5:22.00 >>> asan_new_delete.cc.o:(operator delete(void*)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a 5:22.00 >>> defined at cxxalloc.h:51 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:51) 5:22.00 >>> ../../memory/mozalloc/cxxalloc.o:(.text+0x40) 5:22.00 ld.lld: error: duplicate symbol: operator delete(void*, std::nothrow_t const&) 5:22.00 >>> defined at asan_new_delete.cc:166 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:166) 5:22.00 >>> asan_new_delete.cc.o:(operator delete(void*, std::nothrow_t const&)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a 5:22.00 >>> defined at cxxalloc.h:56 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:56) 5:22.00 >>> ../../memory/mozalloc/cxxalloc.o:(.text+0x50) 5:22.00 ld.lld: error: duplicate symbol: operator new[](unsigned long) 5:22.00 >>> defined at asan_new_delete.cc:102 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:102) 5:22.00 >>> asan_new_delete.cc.o:(operator new[](unsigned long)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a 5:22.00 >>> defined at cxxalloc.h:42 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:42) 5:22.00 >>> ../../memory/mozalloc/cxxalloc.o:(.text+0x20) 5:22.00 ld.lld: error: duplicate symbol: operator new[](unsigned long, std::nothrow_t const&) 5:22.00 >>> defined at asan_new_delete.cc:108 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:108) 5:22.00 >>> asan_new_delete.cc.o:(operator new[](unsigned long, std::nothrow_t const&)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a 5:22.00 >>> defined at cxxalloc.h:47 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:47) 5:22.00 >>> ../../memory/mozalloc/cxxalloc.o:(.text+0x30) 5:22.00 ld.lld: error: duplicate symbol: operator new(unsigned long) 5:22.00 >>> defined at asan_new_delete.cc:99 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:99) 5:22.00 >>> asan_new_delete.cc.o:(operator new(unsigned long)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a 5:22.00 >>> defined at cxxalloc.h:33 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:33) 5:22.00 >>> ../../memory/mozalloc/cxxalloc.o:(.text+0x0) 5:22.00 ld.lld: error: duplicate symbol: operator new(unsigned long, std::nothrow_t const&) 5:22.01 >>> defined at asan_new_delete.cc:105 (/builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105) 5:22.01 >>> asan_new_delete.cc.o:(operator new(unsigned long, std::nothrow_t const&)) in archive /home/szl/.mozbuild/clang/lib/clang/9.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a 5:22.01 >>> defined at cxxalloc.h:38 (/home/szl/src/firefox_asan/obj-x86_64-pc-linux-gnu/dist/include/mozilla/cxxalloc.h:38) 5:22.01 >>> ../../memory/mozalloc/cxxalloc.o:(.text+0x10) 5:22.01 clang-9: error: linker command failed with exit code 1 (use -v to see invocation) 5:22.01 /home/szl/src/firefox_asan/config/rules.mk:458: recipe for target '../../dist/bin/firefox' failed 5:22.01 make[5]: *** [../../dist/bin/firefox] Error 1 5:22.01 /home/szl/src/firefox_asan/config/recurse.mk:72: recipe for target 'browser/app/target' failed 5:22.01 make[4]: *** [browser/app/target] Error 2 5:22.01 make[4]: *** Waiting for unfinished jobs.... 5:22.02 dom/media/gmp-plugin-openh264/libfakeopenh264.so 5:22.56 3 warnings generated. 5:23.16 Compiling webrender v0.61.0 (/home/szl/src/firefox_asan/gfx/wr/webrender) 5:39.65 Compiling webrender_bindings v0.1.0 (/home/szl/src/firefox_asan/gfx/webrender_bindings) 5:58.64 Compiling geckoservo v0.0.1 (/home/szl/src/firefox_asan/servo/ports/geckolib) 6:18.81 Compiling gkrust v0.1.0 (/home/szl/src/firefox_asan/toolkit/library/rust) 6:20.75 Finished release [optimized] target(s) in 5m 21s 6:25.73 /home/szl/src/firefox_asan/config/recurse.mk:32: recipe for target 'compile' failed 6:25.73 make[3]: *** [compile] Error 2 6:25.73 /home/szl/src/firefox_asan/config/rules.mk:390: recipe for target 'default' failed 6:25.73 make[2]: *** [default] Error 2 6:25.73 client.mk:125: recipe for target 'build' failed 6:25.73 make[1]: *** [build] Error 2 6:25.74 258 compiler warnings present. 6:25.86 Notification center failed: Install notify-send (usually part of the libnotify package) to get a notification when the build finishes. GNUmakefile:9: recipe for target 'build' failed make: *** [build] Error 2 '''how can I fix it?'''