Bug 44522 - module-stream-restore may crash when upgrading from 0.9.23 to 1.1
Summary: module-stream-restore may crash when upgrading from 0.9.23 to 1.1
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: modules (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Tanu Kaskinen
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-06 02:53 UTC by Tanu Kaskinen
Modified: 2012-01-28 06:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
stream-restore database file from 0.9.23 (2.89 KB, application/octet-stream)
2012-01-06 02:53 UTC, Tanu Kaskinen
Details

Description Tanu Kaskinen 2012-01-06 02:53:31 UTC
Created attachment 55201 [details]
stream-restore database file from 0.9.23

Wang Xingchao reported in irc that he was getting this assertion:

E: [pulseaudio] module-stream-restore.c: Assertion 'pa_hashmap_put(u->dbus_entries, de->entry_name, de) == 0' failed at modules/module-stream-restore.c:2306, function module_stream_restore_LTX_pa__init(). Aborting.

I asked him to send the database file to me, and it turns out that I can reproduce this issue. The problem is that at startup module-stream-restore iterates through all database entries and calls entry_read() for each entry. If entry_read() encounters an entry that is written by Pulseaudio 0.9.23, it will call entry_write(). This should not be done while iterating through the database. At least in case of the "simple" database implementation, this can cause the same entry to get returned twice from pa_database_next(), which will cause the reported assertion.

I'll attach the database file that can be used to reproduce this crash.
Comment 1 Tanu Kaskinen 2012-01-06 02:57:22 UTC
Assigning to myself. I plan to remove the 0.9.x -> 1.x conversion from entry_read() and add a phase to the stream-restore module initialization where the database is scanned for old or invalid entries. Old entries will be converted and invalid entries will be removed in a safe manner.
Comment 2 Tanu Kaskinen 2012-01-06 06:25:47 UTC
Fix sent to the mailing list for review: http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-January/012570.html


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.