Opened 4 months ago

Closed 4 months ago

#30375 closed defect (fixed)

Backported fix for bug 24622 does not compile with --enable-tests

Reported by: gk Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: TorBrowserTeam201905
Cc: acat Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Compiling commit c722d57604db58695140d95565a78433989fe9ca and later in our tor-browser repo with --enable-tests results in a busted build:

23:59.27 /var/tmp/dist/gcc/bin/g++ -o Unified_cpp_caps_tests_gtest0.o -c -I/var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -I/var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/system_wrappers -include /var/tmp/build/firefox-7a0a10b8ff98/config/gcc_hidden.h -DDEBUG=1 -DOS_POSIX=1 -DOS_LINUX=1 -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest -I/var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest -I/var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/ipc/ipdl/_ipdlheaders -I/var/tmp/build/firefox-7a0a10b8ff98/ipc/chromium/src -I/var/tmp/build/firefox-7a0a10b8ff98/ipc/glue -I/var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include -I/var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/mozilla-config.h -U_FORTIFY_SOURCE -fno-common -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++1z-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-security -Wformat-overflow=2 -fno-sized-deallocation -fsanitize=address -fsanitize=address -Dxmalloc=myxmalloc -U_FORTIFY_SOURCE -fno-common -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -Os -fno-omit-frame-pointer  -MD -MP -MF .deps/Unified_cpp_caps_tests_gtest0.o.pp   /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp
24:00.70 In file included from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsUtils.h:14:0,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupports.h:77,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISerializable.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsIPrincipal.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsJSPrincipals.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BasePrincipal.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:5,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp:2:
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h: In instantiation of 'nsCOMPtr<T>::~nsCOMPtr() [with T = nsIURI]':
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:25:20:   required from here
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsImpl.h:156:37: error: invalid static_cast from type 'nsIURI*' to type 'nsISupports*'
24:00.70    if (_p) NS_LogCOMPtrRelease((_c), static_cast<nsISupports*>(_p))
24:00.70                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:379:5: note: in expansion of macro 'NSCAP_LOG_RELEASE'
24:00.70      NSCAP_LOG_RELEASE(this, mRawPtr);
24:00.70      ^~~~~~~~~~~~~~~~~
24:00.70 In file included from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsIPrincipal.h:23:0,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsJSPrincipals.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BasePrincipal.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:5,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp:2:
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:91:41: error: invalid use of incomplete type 'class nsIURI'
24:00.70  #define NSCAP_RELEASE(this, ptr) (ptr)->Release()
24:00.70                                   ~~~~~~~^
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:381:7: note: in expansion of macro 'NSCAP_RELEASE'
24:00.70        NSCAP_RELEASE(this, mRawPtr);
24:00.70        ^~~~~~~~~~~~~
24:00.70 In file included from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsJSPrincipals.h:10:0,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BasePrincipal.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:5,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp:2:
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsIPrincipal.h:45:7: note: forward declaration of 'class nsIURI'
24:00.70  class nsIURI; /* forward declaration */
24:00.70        ^~~~~~
24:00.70 In file included from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsUtils.h:14:0,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupports.h:77,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISerializable.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsIPrincipal.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsJSPrincipals.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BasePrincipal.h:10,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:5,
24:00.70                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp:2:
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h: In instantiation of 'nsGetterAddRefs<T>::~nsGetterAddRefs() [with T = nsIURI]':
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:26:3:   required from here
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsImpl.h:153:47: error: invalid static_cast from type 'nsIURI*' to type 'nsISupports*'
24:00.70    if (_p != nullptr) NS_LogCOMPtrAddRef((_c), static_cast<nsISupports*>(_p))
24:00.70                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24:00.70 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:1144:5: note: in expansion of macro 'NSCAP_LOG_ASSIGNMENT'
24:00.70      NSCAP_LOG_ASSIGNMENT(reinterpret_cast<void*>(address_of(mTargetSmartPtr)),
24:00.70      ^~~~~~~~~~~~~~~~~~~~
24:00.74 In file included from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsIPrincipal.h:23:0,
24:00.74                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsJSPrincipals.h:10,
24:00.74                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BasePrincipal.h:10,
24:00.74                  from /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:5,
24:00.74                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp:2:
24:00.74 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h: In instantiation of 'void nsCOMPtr<T>::assert_validity() [with T = nsIURI]':
24:00.74 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:402:20:   required from 'nsCOMPtr<T>::nsCOMPtr() [with T = nsIURI]'
24:00.74 /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:25:20:   required from here
24:00.74 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:366:5: error: static assertion failed: nsCOMPtr only works for types with IIDs.  Either use RefPtr; add an IID to your type with NS_DECLARE_STATIC_IID_ACCESSOR/NS_DEFINE_STATIC_IID_ACCESSOR; or make the nsCOMPtr point to a base class with an IID.
24:00.74      static_assert(1 < sizeof(TestForIID<T>(nullptr)),
24:00.74      ^~~~~~~~~~~~~
24:00.78 In file included from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsUtils.h:14:0,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupports.h:77,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISerializable.h:10,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsIPrincipal.h:10,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsJSPrincipals.h:10,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BasePrincipal.h:10,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:5,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp:2:
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h: In instantiation of 'void nsCOMPtr<T>::assign_assuming_AddRef(T*) [with T = nsIURI]':
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:1099:25:   required from 'void** nsCOMPtr<T>::begin_assignment() [with T = nsIURI]'
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:725:50:   required from 'T** nsCOMPtr<T>::StartAssignment() [with T = nsIURI]'
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:1158:59:   required from 'nsGetterAddRefs<T>::operator T**() [with T = nsIURI]'
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:26:3:   required from here
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsImpl.h:153:47: error: invalid static_cast from type 'nsIURI*' to type 'nsISupports*'
24:00.78    if (_p != nullptr) NS_LogCOMPtrAddRef((_c), static_cast<nsISupports*>(_p))
24:00.78                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:354:5: note: in expansion of macro 'NSCAP_LOG_ASSIGNMENT'
24:00.78      NSCAP_LOG_ASSIGNMENT(this, aNewPtr);
24:00.78      ^~~~~~~~~~~~~~~~~~~~
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsISupportsImpl.h:156:37: error: invalid static_cast from type 'nsIURI*' to type 'nsISupports*'
24:00.78    if (_p) NS_LogCOMPtrRelease((_c), static_cast<nsISupports*>(_p))
24:00.78                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:355:5: note: in expansion of macro 'NSCAP_LOG_RELEASE'
24:00.78      NSCAP_LOG_RELEASE(this, oldPtr);
24:00.78      ^~~~~~~~~~~~~~~~~
24:00.78 In file included from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsIPrincipal.h:23:0,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsJSPrincipals.h:10,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BasePrincipal.h:10,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:5,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp:2:
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:91:41: error: invalid use of incomplete type 'class nsIURI'
24:00.78  #define NSCAP_RELEASE(this, ptr) (ptr)->Release()
24:00.78                                   ~~~~~~~^
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsCOMPtr.h:357:7: note: in expansion of macro 'NSCAP_RELEASE'
24:00.78        NSCAP_RELEASE(this, oldPtr);
24:00.78        ^~~~~~~~~~~~~
24:00.78 In file included from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsJSPrincipals.h:10:0,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BasePrincipal.h:10,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/caps/tests/gtest/TestOriginAttributes.cpp:5,
24:00.78                  from /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/caps/tests/gtest/Unified_cpp_caps_tests_gtest0.cpp:2:
24:00.78 /var/tmp/build/firefox-7a0a10b8ff98/obj-x86_64-pc-linux-gnu/dist/include/nsIPrincipal.h:45:7: note: forward declaration of 'class nsIURI'
24:00.78  class nsIURI; /* forward declaration */
24:00.78        ^~~~~~
24:00.85 make[4]: *** [Unified_cpp_caps_tests_gtest0.o] Error 1

Chances are high this is a test-only issue, but we should double-check that and either remove the test or (better) fix it up.

Child Tickets

Change History (2)

comment:1 Changed 4 months ago by acat

I forgot to add the headers: https://github.com/acatarineu/tor-browser/commit/30375.

With this the test passes, checked with ./mach gtest "OriginAttributes.*".

comment:2 in reply to:  1 Changed 4 months ago by gk

Resolution: fixed
Status: newclosed

Replying to acat:

I forgot to add the headers: https://github.com/acatarineu/tor-browser/commit/30375.

Thanks, looks good to me (in fact I should have caught this when applying your mozilla-central patch to esr60... :/ ).

I modified your commit message a bit. Could you use a fixup commit next time? You could mention the bug it closes in it to have some reference. But that way we could squash the commits during the next rebase which would make it easier to keep track of the patches. Anyway, cherry-picked to tor-browser-60.6.1esr-8.5-1 (commit a491b06ba9622bede413085a0b67146fcedbf90f).

(And, please set the ticket state to needs_review and ideally adding the TorBrowserTeamYYYMMR keyword so that the ticket does not fall through the cracks).

Note: See TracTickets for help on using tickets.