Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: [email protected], [email protected]
Control: affects -1 + src:akonadi-search
User: [email protected]
Usertags: pu

[ Reason ]
akonadi_html_to is carshing very frequently and creating a lot
coredumps. That is tracked in #1104598.

[ Impact ]
This issue creates thousands of coredumps for Users of KDEPIM.
For most users this is not visible that those coredumps are created, as
this happens in background and the services are restarted. This is at
least annoving, but a programm should not crash.

[ Tests ]
Run a manual test with the patched version that the following command
does not crash anymore:

echo -n '' | /usr/bin/akonadi_html_to_text

[ Risks ]
The code change is very simple and focused, so it is very unlikely that
any other bug get introduced by this two line patch.

A workaround exists use html2text as replacement for
akonadi_html_to_text:

apt install html2text

dpkg-divert --add --rename --divert /usr/bin/akonadi_html_to_text.original /
usr/bin/akonadi_html_to_text

update-alternatives --install /usr/bin/akonadi_html_to_text
akonadi_html_to_text /usr/bin/html2text 1

That woraround would divert a lot more from upstream and makes it harder
to track bugs, if that would have been introdiced by this workaround.


[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
Added a 2 line patch from Fab Stz to fix the crash on empty input.
diff -Nru akonadi-search-24.12.3/debian/changelog 
akonadi-search-24.12.3/debian/changelog
--- akonadi-search-24.12.3/debian/changelog     2025-03-29 18:49:31.000000000 
+0100
+++ akonadi-search-24.12.3/debian/changelog     2026-07-22 19:46:25.000000000 
+0200
@@ -1,3 +1,11 @@
+akonadi-search (4:24.12.3-1+deb13u1) trixie; urgency=medium
+
+  [ Fab Stz ]
+  * Fix "akonadi_html_to_text is crashing a lot" (Closes: #1104598)
+    * Added a patch to not crash on empty input.
+
+ -- Sandro Knauß <[email protected]>  Wed, 22 Jul 2026 19:46:25 +0200
+
 akonadi-search (4:24.12.3-1) unstable; urgency=medium
 
   [ Patrick Franz ]
diff -Nru akonadi-search-24.12.3/debian/patches/fixcrashOnEmptyInput.patch 
akonadi-search-24.12.3/debian/patches/fixcrashOnEmptyInput.patch
--- akonadi-search-24.12.3/debian/patches/fixcrashOnEmptyInput.patch    
1970-01-01 01:00:00.000000000 +0100
+++ akonadi-search-24.12.3/debian/patches/fixcrashOnEmptyInput.patch    
2026-07-21 23:31:36.000000000 +0200
@@ -0,0 +1,20 @@
+Description: Fix crash in akonadi_html_to_text
+ Fix crash when input is empty string.
+Author: Fab Stz <[email protected]>
+Origin: self
+Bug: https://bugs.kde.org/show_bug.cgi?id=516865
+Debian-Bug: https://bugs.debian.org/1104598
+Forwarded: not-needed
+Last-Update: 2026-07-17
+
+--- akonadi-search-24.12.3.orig/agent/htmltotext.cpp
++++ akonadi-search-24.12.3/agent/htmltotext.cpp
+@@ -56,6 +56,8 @@ int main(int argc, char *argv[])
+         int s = std::cin.gcount();
+         content.append(arr, s);
+     }
++    if (content.isEmpty())
++        return 0;
+ 
+ #ifdef HAS_HTMLPARSER
+     const auto html = content.toStdString();
diff -Nru akonadi-search-24.12.3/debian/patches/series 
akonadi-search-24.12.3/debian/patches/series
--- akonadi-search-24.12.3/debian/patches/series        2024-12-18 
22:30:27.000000000 +0100
+++ akonadi-search-24.12.3/debian/patches/series        2026-07-21 
23:31:54.000000000 +0200
@@ -1 +1,2 @@
 rust-dependencies.patch
+fixcrashOnEmptyInput.patch

Reply via email to