Stubs in spec files

Zebediah Figura z.figura12 at gmail.com
Wed Feb 1 15:47:48 CST 2017


On 02/01/2017 03:08 PM, Stefan Dösinger wrote:
> Am 2017-02-01 um 20:37 schrieb Zebediah Figura:
>> My question, then, is—is there any purpose of the stub lines besides to
>> directly call __wine_spec_unimplemented_stub, or any other reason why
>> this proposal would be detrimental?
> I am not an expert on .spec files and I am not sure if I understand your
> proposal correctly.
> 
> If you remove the stub lines GetProcAddress on the symbol will return
> NULL, and applications might take a different codepath based on that.

Is there any way in which "applications might take a different codepath"
would be worse than simply crashing?

> Also the crash from calling a stub is fairly specific ("Unimplemented
> function XXX called") while the one from a nonexistent one that is
> resolved on library load is more generic (Access violation). You have
> the load-time warning, but you don't know if that warning has a relation
> to a crash much later on. Things are even trickier if the program has a
> signal handler for access violations.

For what it's worth, the error message I get for the (one) 32-bit
function that I tested was identical. For 16 bit the stub gives me

wine: Call from 0x7b43c26c to unimplemented function
compobj.dll16.COINITIALIZE, aborting
wine: Unimplemented function compobj.dll16.COINITIALIZE called at
address 0x7b43c26c (thread 0030), starting debugger...

while the nonexistent one gives me

err:fixup:apply_relocations No implementation for COMPOBJ.2, setting to
0xdeadbeef
wine: Unhandled page fault on read access to 0x0000dea8 at address
0x101f:0x000017c3 (thread 0030), starting debugger...

The latter is a bit less obvious, but my reasoning is that a "no
implementation" line should be enough of a red flag that the generic
exception (or other misbehavior) could still be as easily fixed.

> Maybe we need a different kind of stub for data exports that point to a
> X byte large block filled with 0xdeadcode?

This could work, but there is the problem that most of the stub
constants that I found weren't outputted to the console. I only noticed
the one because it showed up in a FIXME line for a function I was trying
to implement.

Also, is there any way of actually telling whether a DLL export is a
function or a constant?




More information about the wine-devel mailing list