8000 Storing state in global variables considered harmful · Issue #1057 · dynup/kpatch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Storing state in global variables considered harmful #1057
Open
@jpoimboe

Description

@jpoimboe

If a patch stores state in a global variable, and then the patch is later replaced with a newer cumulative patch, the global variable in the new patch will be distinct from the variable in the original patch, and thus won't have the original state. This is dangerous and needs to be prevented. Instead a shadow variable should be used to store global state.

Ideally the best option would be to report an error (or at least a warning) if non-rodata data is added to a patch. I'm not sure if there would be any false positive warnings. It needs to be investigated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0