<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>61261</bug_id>
          
          <creation_ts>2026-10-29 17:00:20 +0300</creation_ts>
          <short_desc>manticore-converter: index_converter завершается с ошибкой сегментирования при конвертации индексов sphinx</short_desc>
          <delta_ts>2026-10-29 17:02:23 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>manticore-converter</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=43414</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexander Makeenkov">amakeenk</reporter>
          <assigned_to name="Vitaly Lipatov">lav</assigned_to>
          <cc>lav</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>303629</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-10-29 17:00:20 +0300</bug_when>
    <thetext>Версия пакета:
==============
manticore-converter-29.9.0-alt1 (Sisyphus, x86_64)
sphinx-2.3.2-alt5.1

Описание проблемы:
==================
Утилита index_converter падает с ошибкой сегментирования (SIGSEGV) при попытке конвертации индексов Sphinx как при передаче файла конфигурации (--config /etc/sphinx/sphinx.conf.rpmsave --all), так и при передаче директории с индексами (--path ./sphinx.bac --all).

Ранее закрытый баг #43414 (где рекомендовалось завести новый баг с бэктрейсом при повторении на актуальной версии).

Шаги для воспроизведения:
=========================
1. Установить sphinx, mariadb-server и подготовить тестовый индекс sphinx:
   # apt-get install sphinx libsphinxclient mariadb-server -y
   # systemctl enable --now mysqld
   # echo &quot;CREATE USER &apos;test&apos;@&apos;localhost&apos; IDENTIFIED BY &apos;1&apos;;&quot; | mysql
   # echo &quot;GRANT ALL PRIVILEGES ON test.* TO &apos;test&apos;@&apos;localhost&apos;;&quot; | mysql
   # mysql test &lt; /usr/share/doc/sphinx-*/example.sql
   # sed -i &quot;s/sql_pass.*/sql_pass = 1/&quot; /etc/sphinx/sphinx.conf
   # systemctl enable --now searchd
   # su - _sphinx -s /bin/sh -c &quot;indexer --verbose --rotate --all&quot;

2. Установить manticore и manticore-converter:
   # apt-get install manticore manticore-converter -y
   # cp -r /var/lib/sphinx ./sphinx.bac

3. Выполнить конвертацию:
   # index_converter --config /etc/sphinx/sphinx.conf.rpmsave --all
   или
   # index_converter --path ./sphinx.bac --all

Результат:
==========
В обоих случаях процесс немедленно завершается с кодом 139 (Segmentation fault).

GDB Backtrace 1 (при вызове с --config):
========================================
Program received signal SIGSEGV, Segmentation fault.
0x00005555558a0af4 in CSphOrderedHash&lt;CSphConfigSection, CSphString, CSphStrHashFunc, 256&gt;::Iterator_c::operator++ (this=&lt;synthetic pointer&gt;) at /usr/src/debug/manticore-29.9.0/src/std/orderedhash.h:153
153                     Iterator_c&amp; operator++()
#0  0x00005555558a0af4 in CSphOrderedHash&lt;CSphConfigSection, CSphString, CSphStrHashFunc, 256&gt;::Iterator_c::operator++ (this=&lt;synthetic pointer&gt;) at /usr/src/debug/manticore-29.9.0/src/std/orderedhash.h:153
#1  main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) at /usr/src/debug/manticore-29.9.0/src/index_converter.cpp:2595

Причина: в src/index_converter.cpp объект `CSphConfig hConfig` объявлен локально в блоке `if (!sConfig.IsEmpty()) { ... }`, а указатель `pIndexes = hConfig(&quot;index&quot;)` используется после выхода из блока (use-after-free).

GDB Backtrace 2 (при вызове с --path):
======================================
Program received signal SIGSEGV, Segmentation fault.
main (argc=4, argv=0x7fffffffe978) at /usr/src/debug/manticore-29.9.0/src/index_converter.cpp:2587
2587            auto pItt = pIndexes-&gt;begin();
#0  main (argc=4, argv=0x7fffffffe978) at /usr/src/debug/manticore-29.9.0/src/index_converter.cpp:2587

Причина: `pIndexes` равен nullptr, происходит разыменование нулевого указателя.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>