Skip to content

OS_ModuleUnload() for statically loaded module may segfault #637

@jphickey

Description

@jphickey

Describe the bug
Calling OS_ModuleUnload() on a statically loaded module will still attempt to call dlclose() but the handle is NULL because no module was loaded. At least on Linux/Glibc this actually causes a segmentation fault.

To Reproduce
Using the CFE framework switch any app (e.g. sample_app) from a regular dynamic app to a static app.
Build and run CFE, then shutdown with CTRL+C.
The shutdown ends up calling OS_DeleteAllObjects() which in turn will trigger this bug - one gets a segfault instead of a clean exit.

Expected behavior
Should shutdown cleanly.

System observed on:
Ubuntu 20.04

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions