[Webkit-unassigned] [Bug 233007] New: ODR violations caused by ANGLE and WebCore's use of bison

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 11 11:45:48 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=233007

            Bug ID: 233007
           Summary: ODR violations caused by ANGLE and WebCore's use of
                    bison
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: ANGLE
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at gnome.org
                CC: dino at apple.com, kbr at google.com, kkinnunen at apple.com

In bug #229867 I propose disabling -Wodr, but it does catch some real bugs that we should try to fix:

[2044/2295] Linking CXX executable bin/TestWebKitAPI/TestWebCore
XPathGrammar.y:72: warning: type ‘union YYSTYPE’ violates the C++ One Definition Rule [-Wodr]
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.h:243: note: a different type is defined in another translation unit
  243 | union YYSTYPE
      | 
XPathGrammar.y:58: note: the first difference of corresponding definitions is field ‘numericOpcode’
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.h:257: note: a field with different name is defined in another translation unit
  257 |     } lex;
      | 
XPathGrammar.cpp:366: warning: type ‘union yyalloc’ violates the C++ One Definition Rule [-Wodr]
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.cpp:645: note: a different type is defined in another translation unit
  645 | union yyalloc
      | 
XPathGrammar.cpp:368: note: the first difference of corresponding definitions is field ‘yyss’
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.cpp:647: note: a field with different name is defined in another translation unit
  647 |     yytype_int16 yyss_alloc;
      | 
glslang.l:982: warning: type ‘struct yyguts_t’ violates the C++ One Definition Rule [-Wodr]
preprocessor.l:777: note: a different type is defined in another translation unit
glslang.l:986: note: the first difference of corresponding definitions is field ‘yyextra_r’
preprocessor.l:781: note: a field of same name but different type is defined in another translation unit
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/ParseContext.h:33: note: type name ‘sh::TParseContext’ should match type name ‘angle::pp::Tokenizer::Context’
   33 | class TParseContext : angle::NonCopyable
      | 
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.h:25: note: the incompatible type is defined here
   25 |     struct Context
      | 
/home/mcatanzaro/Projects/WebKit/Source/WebCore/xml/XPathParser.h:45: warning: ‘lex’ violates the C++ One Definition Rule [-Wodr]
   45 |     int lex(YYSTYPE&);
      | 
/home/mcatanzaro/Projects/WebKit/Source/WebCore/xml/XPathParser.cpp:404: note: type mismatch in parameter 1
  404 | int Parser::lex(YYSTYPE& yylval)
      | 

These are real bugs, but they're not simple to avoid because fixing them probably requires a decent understanding of bison. I'm not sure if we can rename YYSTYPE when using bison's standard C language skeleton. At first I thought ANGLE might need to switch to using bison's C++ support, but we actually cannot do that because it's probably not available in Apple's older version of bison (and if it is available, it will for sure be too buggy to rely on).

It might be possible to try naively enclosing bison stuff in C++ namespaces, but I'm not sure about that either.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211111/206767e4/attachment.htm>


More information about the webkit-unassigned mailing list