http://bugs.winehq.org/show_bug.cgi?id=5218
Summary: Wine compiled with -Os optimization crashes Product: Wine Version: CVS Platform: PC URL: http://appdb.winehq.org/appview.php?appId=1836 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-loader AssignedTo: wine-bugs@winehq.org ReportedBy: phil@mail.ru
Wine compiled with -Os optimization flag crashes when loading some native dlls. Using git bisect I've tracked it down to this recent commit:
Alexandre Julliard: ntdll: Add wrappers for the string functions. http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=473fbcb781a2d42dd93d 05680dfdef88999349fa
+loaddll,+module,+imports log and backtrace attached.
You can see from the backtrace that the top of the stack is corrupted. I tried to single-step to the crash, and it happens on a TRACE_() in fixup_imports(). When I step by single instructions, I see that it enters wine_dbg_log@PLT and next segfaults - I think that the relocation table or whatever this @PLT thing uses gets overwritten with ASCII data at some previous stage.
When I comment out these TRACE_()s or compile without -Os, everything works fine.