Bug 63923

Summary: Module index can be read before a real index has been assigned
Product: PulseAudio Reporter: Tanu Kaskinen <tanuk>
Component: coreAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Tanu Kaskinen 2013-04-25 14:48:41 UTC
pa_module.index is set after calling the init() callback. Prior to that it's PA_IDXSET_INVALID. The init() callback can do things that cause hooks to be fired, and that in turn may make the module object visible to code that reads the module index.

I'm not sure what would be the best way to fix this. The simplest way would be to add the new module to pa_core.modules before calling init(), but then module indexes would be consumed also by modules that fail to load. Perhaps that's not a significant problem, though.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.