sd-event: store and compare per-module static origin id

sd-event objects use hashmaps, which use module-global state, so it is not safe
to pass a sd-event object created by a module instance to another module instance
(e.g.: when two libraries static linking sd-event are pulled in a single process).
Initialize a random per-module origin id and store it in the object, and compare
it when entering a public API, and error out if they don't match, together with
the PID.
This commit is contained in:
Luca Boccassi
2023-04-25 01:46:22 +01:00
parent e046719b74
commit 2eeff0f4f1
23 changed files with 150 additions and 88 deletions

View File

@@ -289,7 +289,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -168,7 +168,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>
</variablelist>

View File

@@ -170,7 +170,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -270,7 +270,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>
<varlistentry>

View File

@@ -236,7 +236,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>
<varlistentry>

View File

@@ -165,7 +165,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>
<varlistentry>

View File

@@ -270,7 +270,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -109,7 +109,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop was created in a different process.</para></listitem>
<listitem><para>The event loop was created in a different process, library or module instance.</para></listitem>
</varlistentry>
<varlistentry>

View File

@@ -77,7 +77,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>
</variablelist>

View File

@@ -91,7 +91,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop object was created in a different process.</para></listitem>
<listitem><para>The event loop object was created in a different process, library or module instance.</para></listitem>
</varlistentry>
</variablelist>
</refsect2>

View File

@@ -129,7 +129,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -72,7 +72,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>
<varlistentry>

View File

@@ -108,7 +108,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>
<varlistentry>

View File

@@ -109,7 +109,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -106,7 +106,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -127,7 +127,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -89,7 +89,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -104,7 +104,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -139,7 +139,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>

View File

@@ -120,7 +120,7 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
<listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
</varlistentry>
<varlistentry>

Some files were not shown because too many files have changed in this diff Show More