Opened 6 months ago

Closed 6 months ago

#25980 closed defect (fixed)

Orfox bustage on tor-browser-52.7.3esr-8.0-1

Reported by: sysrqb Owned by: tbb-team
Priority: High Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-mobile, TorBrowserTeam201805R
Cc: igt0 Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

 3:24.92 In file included from /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjstdio.cpp:11:0:
 3:24.93 /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjalloc.h:34:0: warning: "feof" redefined
 3:24.93  #define feof(file)            hnjFeof(file)
 3:24.93  ^
 3:24.93 In file included from /home/sysrqb/.mozbuild/android-ndk-r11b/sources/android/support/include/stdio.h:41:0,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/stdio.h:3,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/mozilla/throw_gcc.h:13,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers/type_traits:66,
 3:24.93                  from /home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include/exception:81,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/exception:3,
 3:24.93                  from /home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include/new:68,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/new:3,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers/new:44,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/mozilla/mozalloc.h:16,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjalloc.h:13,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjstdio.cpp:11:
 3:24.93 /home/sysrqb/.mozbuild/android-ndk-r11b/platforms/android-9/arch-arm/usr/include/stdio.h:367:0: note: this is the location of the previous definition
 3:24.93  #define feof(p)  __sfeof(p)
 3:24.93  ^
 3:24.93 In file included from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/cstdio:3:0,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers/cstdio:44,
 3:24.93                  from /home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include/string:437,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/string:3,
 3:24.93                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers/string:44,
 3:24.94                  from /home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:15,
 3:24.94                  from /home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:216,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/ios:3,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers/ios:44,
 3:24.94                  from /home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:131,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/ostream:3,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers/ostream:44,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/mozilla/gfx/BasePoint.h:10,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/mozilla/gfx/Point.h:13,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/mozilla/gfx/Triangle.h:12,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/mozilla/gfx/Matrix.h:10,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/Units.h:11,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/nsContentUtils.h:29,
 3:24.94                  from /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjstdio.cpp:16:
 3:24.94 /home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include/cstdio: In function 'int __libcpp_feof(FILE*)':
 3:24.94 /home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include/cstdio:155:128: error: cannot convert 'FILE* {aka __sFILE*}' to 'hnjFile* {aka hnjFile_*}' for argument '1' to 'int hnj
Feof(hnjFile*)'
 3:24.94  inline _LIBCPP_INLINE_VISIBILITY int __libcpp_feof(FILE* __stream) {return feof(__stream);}
 3:24.94                                                                                                                                 ^
 3:24.94 
 3:24.94 In the directory  /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/intl/hyphenation/glue
 3:24.94 The following command failed to execute properly:
 3:24.94 /usr/bin/ccache /home/sysrqb/.mozbuild/android-ndk-r11b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -std=gnu++11 -o hnjstdio.o -c -I/home/sysrqb/Orfox/extern
al/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers -I/home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers -include /home/sysrqb/Orfox/external/tor-browser/config
/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue -I/home/sysrqb/Orfox/externa
l/tor-browser/obj-tbb-arm-linux-androideabi/intl/hyphenation/glue -I/home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/hyphen -I/home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/in
clude -I/home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/nspr -I/home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/nss -fPIC -DMOZILLA_CLIENT -in
clude /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/mozilla-config.h -MD -MP -MF .deps/hnjstdio.o.pp -idirafter /home/sysrqb/.mozbuild/android-ndk-r11b/platforms/android-9/arch-arm/usr/in
clude -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wthread-safety -Wno-error=
maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -fno-short-enums -fno-exceptions -march=armv7-a -mthumb -mfpu=vfp -mfloat-abi=softfp -mno-unaligned-access -I/home/sysrqb/.mozbuild/
android-ndk-r11b/sources/android/support/include -I/home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++/libcxx/include -I/home/sysrqb/.mozbuild/android-ndk-r11b/sources/cxx-stl/llvm-libc++abi/libc
xxabi/include -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pipe -g -freorder-blocks -fno-reorder-functions -Os -fomit-frame-pointer -Wno-err
or=shadow /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjstdio.cpp
 3:24.94 /home/sysrqb/Orfox/external/tor-browser/config/rules.mk:951: recipe for target 'hnjstdio.o' failed
 3:24.94 make[5]: *** [hnjstdio.o] Error 1
 3:24.94 /home/sysrqb/Orfox/external/tor-browser/config/recurse.mk:71: recipe for target 'intl/hyphenation/glue/target' failed
 3:24.94 make[4]: *** [intl/hyphenation/glue/target] Error 2

Child Tickets

Change History (10)

comment:1 Changed 6 months ago by sysrqb

This is because:

 0:28.10 In file included from /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjstdio.cpp:11:0:
 0:28.10 /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjalloc.h:34:0: warning: "feof" redefined
 0:28.10  #define feof(file)            hnjFeof(file)
 0:28.10  ^
 0:28.10 In file included from /home/sysrqb/.mozbuild/android-ndk-r11b//sources/android/support/include/stdio.h:41:0,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/stdio.h:3,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/mozilla/throw_gcc.h:13,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers/type_traits:66,
 0:28.10                  from /home/sysrqb/.mozbuild/android-ndk-r11b//sources/cxx-stl/llvm-libc++/libcxx/include/exception:81,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/exception:3,
 0:28.10                  from /home/sysrqb/.mozbuild/android-ndk-r11b//sources/cxx-stl/llvm-libc++/libcxx/include/new:68,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/system_wrappers/new:3,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/stl_wrappers/new:44,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/obj-tbb-arm-linux-androideabi/dist/include/mozilla/mozalloc.h:16,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjalloc.h:13,
 0:28.10                  from /home/sysrqb/Orfox/external/tor-browser/intl/hyphenation/glue/hnjstdio.cpp:11:
 0:28.10 /home/sysrqb/.mozbuild/android-ndk-r11b/platforms/android-9/arch-arm/usr/include/stdio.h:367:0: note: this is the location of the previous definition
 0:28.10  #define feof(p)  __sfeof(p)

and

#ifdef feof
inline _LIBCPP_INLINE_VISIBILITY int __libcpp_feof(FILE* __stream) {return feof(__stream);}
#undef feof
inline _LIBCPP_INLINE_VISIBILITY int feof(FILE* __stream) {return __libcpp_feof(__stream);}
#endif  // feof

in /home/sysrqb/.mozbuild/android-ndk-r11b//sources/cxx-stl/llvm-libc++/libcxx/include/cstdio

comment:2 Changed 6 months ago by sysrqb

Summary: Orfox bustage on Alpha branchOrfox bustage on tor-browser-52.7.3esr-8.0-1

comment:3 Changed 6 months ago by sysrqb

Looks like this came in from upstream

commit 0e1e49d4971bb891152c93b8b62665f24bd8a0c2
Author: Jonathan Kew <jkew@mozilla.com>
Date:   Wed Mar 28 10:17:51 2018 +0100

    Bug 1448771 - Update hnjstdio to handle additional functions from stdio.h that libhyphen wants to use. r=glandium, a=RyanVM
    
    --HG--
    extra : source : 846bcaa210aa2264bec412c0595113964fafc972

comment:4 Changed 6 months ago by sysrqb

Right, so this patch redefines feof() and changes the function signature (feof(FILE*) -> feof(hnjFile*)), and it seems there isn't a conversion between FILE and hnjFile. Fun.

diff --git a/intl/hyphenation/glue/hnjalloc.h b/intl/hyphenation/glue/hnjalloc.h
index fec3a4b..5cee1be1 100644
--- a/intl/hyphenation/glue/hnjalloc.h
+++ b/intl/hyphenation/glue/hnjalloc.h
@@ -31,6 +31,8 @@
 #define fopen(path,mode)      hnjFopen(path,mode)
 #define fclose(file)          hnjFclose(file)
 #define fgets(buf,count,file) hnjFgets(buf,count,file)
+#define feof(file)            hnjFeof(file)
+#define fgetc(file)           hnjFgetc(file)
 
 typedef struct hnjFile_ hnjFile;
 
@@ -44,6 +46,10 @@ int hnjFclose(hnjFile* f);
 
 char* hnjFgets(char* s, int n, hnjFile* f);
 
+int hnjFeof(hnjFile* f);
+
+int hnjFgetc(hnjFile* f);
+
 #ifdef __cplusplus
 }
 #endif

comment:5 Changed 6 months ago by sysrqb

The reason this isn't busted on Mozilla beta or alpha is because the newer Android NDK doesn't explicitly declare the signature.

$ grep -n feof /home/sysrqb/.mozbuild/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/cstdio
143:using ::feof;

comment:6 Changed 6 months ago by sysrqb

Status: newneeds_review

Okay, easy fix.

On Android, the NDK (from LLVM) defines __libc_feof(FILE*) as a wrapper around feof(FILE*). Mozilla redefined feof as feof(hnjFile*), this caused a type mismatch because __libc_feof(FILE* f) then called feof(f) but f was the wrong type (FILE*, instead of hnjFile*). We can redefine __libc_feof the same way Mozilla redefined feof - using a C++ preprocessor.

The guards around the #define aren't strictly necessary, but I didn't want to introduce unnecessary changes on other platforms. We can delete them if that's preferred.

Branch bug25980
https://git.torproject.org/user/sysrqb/tor-browser.git

comment:7 Changed 6 months ago by gk

Keywords: TorBrowserTeam201805R added

comment:8 Changed 6 months ago by gk

Status: needs_reviewneeds_information

Looks reasonable to me, thanks. igt0: does the patch fix the Orfox build bustage for you as well?

comment:9 in reply to:  8 Changed 6 months ago by igt0

Yes, I also ran the hyphenation reftests and the patch looks good. +1.
Replying to gk:

Looks reasonable to me, thanks. igt0: does the patch fix the Orfox build bustage for you as well?

comment:10 Changed 6 months ago by gk

Resolution: fixed
Status: needs_informationclosed

Thanks, cherry-picked to tor-browser-52.7.3esr-8.0-1 as commit d51742d0dd8364c20bb33a15cec5c2ae6d81f9b5.

Note: See TracTickets for help on using tickets.