Comment 7 for bug 1934995

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

So I don't have the faintest idea what caused this to start failing but the issue here is in mir:

    int (*real_open)(char const *path, int flags, mode_t mode);
    *(void **)(&real_open) = dlsym(RTLD_NEXT, "open");

    return (*real_open)(path, flags, mode);

The declaration for real_open here does not match that used by the open() function call in umockdev, which uses va_args. This means that the stack frame gcc creates for mir's wrapper does not have space for a parameter save area which the code gcc generates for umockdev assumes it has, and so the stack gets stomped on. So if the prototype in mir is fixed here (also the one for open64) I bet things will start working again.