https://bugs.winehq.org/show_bug.cgi?id=47035
Bug ID: 47035 Summary: widl generates typelib file with enums multiply defined Product: Wine Version: 4.5 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: rpc Assignee: wine-bugs@winehq.org Reporter: richard@torproject.org Distribution: ---
When generating typelibs from idl where enums are defined, the generated tlb ends up with a copy of the enum definition for every instance that the enum is mentioned as a parameter to a function, plus 1.
I've created a branch with a min-repro here:
https://github.com/pospeselr/mingw-widl-bug/tree/enum_bug
Once again, update the Makefile to point to your local copy of widl.
I tested this with the latest mingw ( commit c61763cc740f8f4986755eeafce832baa3655ee8 ) which uses widl version 4.5 plus I've applied the patch from https://bugs.winehq.org/show_bug.cgi?id=47031 (note: this issue occurs even without the patch applied).
https://bugs.winehq.org/show_bug.cgi?id=47035
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 CC| |z.figura12@gmail.com Status|UNCONFIRMED |NEW
--- Comment #1 from Zebediah Figura z.figura12@gmail.com --- Confirmed; patch sent: https://source.winehq.org/patches/data/163149.
https://bugs.winehq.org/show_bug.cgi?id=47035
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase
--- Comment #2 from Zebediah Figura z.figura12@gmail.com --- (In reply to Zebediah Figura from comment #1)
Confirmed; patch sent: https://source.winehq.org/patches/data/163149.
As the testbot shows, this exposes some existing problems which run a little deeper. It'll need some more work. As a workaround, it should be safe to apply that patch locally, or alternatively typedef the enums, in which case they won't suffer from this bug.
https://bugs.winehq.org/show_bug.cgi?id=47035
--- Comment #3 from Zebediah Figura z.figura12@gmail.com --- Generally I think we want to avoid duplicating types in widl, and just rely on pointer equality to test if a type was already written (to a typelib, header, eventually also NDR format string). This means getting rid of duptype(), which is only used in a couple places, but they're kind of tricky to get rid of. I think it'd be a matter of moving type qualifiers and specifiers out of the type structure itself and into the decl_spec stucture, and then propagating those upward a layer to the typedef, arg, declaration, etc.
The other option is that we don't rely on pointer equality to test if two types are equal, and instead do a deep comparison, i.e. along the lines of type_is_equal(). (Despite the comment in that function I'm not sure we'd need to do deep inspection in that case.) I'm a little lukewarm about this, though, inasmuch as it means we can't as easily store information like offset / whether the type was written in the type structure itself (i.e. we can, but every time we look it up we'd have to search the namespace for another type that was written, if this one wasn't.)
https://bugs.winehq.org/show_bug.cgi?id=47035
--- Comment #4 from Richard Pospesel richard@torproject.org --- Blocker for Mozilla bug #1520177: ( https://bugzilla.mozilla.org/show_bug.cgi?id=1520177 )
I'm currently working on a patch for this issue.
https://bugs.winehq.org/show_bug.cgi?id=47035
Richard Pospesel richard@torproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |47041
https://bugs.winehq.org/show_bug.cgi?id=47035
--- Comment #5 from Richard Pospesel richard@torproject.org --- (In reply to Richard Pospesel from comment #4)
Blocker for Mozilla bug #1520177: ( https://bugzilla.mozilla.org/show_bug.cgi?id=1520177 )
I'm currently working on a patch for this issue.
Patches for this has been submitted to wine-dev. The fix (and some fixes surrounding inline function specifier) can be found here across 3 commits:
https://github.com/pospeselr/wine/commits/bug_47035_review
https://bugs.winehq.org/show_bug.cgi?id=47035
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |0aa6049c8d46dd6d4e92c30f7b0 | |380d1e5f46af2
--- Comment #6 from Zebediah Figura z.figura12@gmail.com --- This should finally be fixed by https://source.winehq.org/git/wine.git/commitdiff/0aa6049c8d46dd6d4e92c30f7b0380d1e5f46af2. Thanks Richard!
https://bugs.winehq.org/show_bug.cgi?id=47035
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.15.
https://bugs.winehq.org/show_bug.cgi?id=47035
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.15.
https://bugs.winehq.org/show_bug.cgi?id=47035
--- Comment #9 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.15.