Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • vala vala
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 776
    • Issues 776
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 70
    • Merge requests 70
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • valavala
  • Issues
  • #153
Closed
Open
Issue created Dec 31, 2010 by Bugzilla@bugzilla-migration💬Reporter

Interfaces unsafely assume abstract functions are implemented

Submitted by Travis Reitter

Link to original bug (#638434)

Description

valac generates interface virtual function wrappers like the following:

properties

gint interface_get_foo (FolksExtendedInfo* self) {
  return INTERFACE_GET_INTERFACE (self)->get_foo (self);
}

void interface_set_foo (FolksExtendedInfo* self, gint value) {
  INTERFACE_GET_INTERFACE (self)->set_foo (self, value);
}

methods

gint interface_bar (Interface* self) {
  return INTERFACE_GET_INTERFACE (self)->bar (self);
}

If 'foo' is a property or bar() is a method added to the interface after an implementing class implements the interface, accessing the property or calling the method on the old class will cause a segfault and otherwise put the client program in a very bad state.

This situation can easily happen if a library exposes an interface which is implemented by a third-party library (which won't necessarily be up-to-date with the latest interface version), breaking backward compatibility in a very fragile way.

Edited Apr 14, 2020 by Rico Tzschichholz
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking