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

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

    <bug>
          <bug_id>35722</bug_id>
          
          <creation_ts>2018-12-04 08:00:29 +0300</creation_ts>
          <short_desc>Роняет apt-get с SIGSEGV</short_desc>
          <delta_ts>2019-06-11 17:54:46 +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>rpm-plugin-syslog</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Evgenii Terechkov">evg</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>at</cc>
    
    <cc>glebfm</cc>
    
    <cc>imz</cc>
    
    <cc>iv</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>sotor</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>176328</commentid>
    <comment_count>0</comment_count>
    <who name="Evgenii Terechkov">evg</who>
    <bug_when>2018-12-04 08:00:29 +0300</bug_when>
    <thetext>После установки rpm-plugin-syslog апт падает при попытке выполнить любую транзакцию, таким образом:

=8&lt;=========================================================================
[Пн дек  3 15:44:32 2018] show_signal_msg: 73 callbacks suppressed
[Пн дек  3 15:44:32 2018] apt-get[25378]: segfault at 0 ip 00007fe269c0ac68 sp 00007ffc8423a2c0 error 4 in syslog.so[7fe269c0a000+1000]
[Пн дек  3 15:44:32 2018] Code: 00 48 89 c3 e8 99 fc ff ff a8 03 74 06 c7 03 00 00 00 00 48 89 ef e8 e7 fc ff ff 48 8d 3d b0 00 00 00 48 89 c6 b9 02 00 00 00 &lt;f3&gt; a6 0f 97 c0 1c 00 84 c0 74 15 c7 03 00 00 00 00 48 83 c4 08 31
=8&lt;=========================================================================

увы, коредамп собрать не получилось.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178555</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-14 13:54:43 +0300</bug_when>
    <thetext>Воспроизводится на раз. В gdb:

Program received signal SIGSEGV, Segmentation fault.
syslog_tsm_pre (plugin=plugin@entry=0x4b87220, ts=ts@entry=0x4b6b260) at syslog.c:46
46          if (!rstreq(rpmtsRootDir(ts), &quot;/&quot;))
(gdb) bt
#0  syslog_tsm_pre (plugin=plugin@entry=0x4b87220, ts=ts@entry=0x4b6b260) at syslog.c:46
#1  0x00007ffff7a829c8 in rpmpluginsCallTsmPre (plugins=0x4b0300, ts=ts@entry=0x4b6b260) at rpmplugins.c:231
#2  0x00007ffff7a7be3a in rpmtsRun (ts=0x4b6b260, okProbs=okProbs@entry=0x0, ignoreSet=&lt;optimized out&gt;) at transaction.c:1507
#3  0x00007ffff7f0ec10 in pkgRPMLibPM::Process (this=0x4876a10, install=..., upgrade=std::vector of length 1, capacity 1 = {...}, uninstall=...) at rpm/rpmpm.cc:1029
#4  0x00007ffff7f106f2 in pkgRPMPM::Go (this=0x4876a10) at rpm/rpmpm.cc:402
#5  0x00007ffff7f4e335 in pkgPackageManager::DoInstall (this=this@entry=0x4876a10) at packagemanager.cc:673
#6  0x0000000000410011 in InstallPackages (Cache=..., ShwKept=&lt;optimized out&gt;, Ask=&lt;optimized out&gt;, Saftey=&lt;optimized out&gt;) at apt-get.cc:497
#7  0x000000000041334a in DoInstall (CmdL=...) at apt-get.cc:1733
#8  0x00007ffff7ee3cce in CommandLine::DispatchArg (this=this@entry=0x7fffffffd9d0, Map=Map@entry=0x7fffffffda10, NoMatch=NoMatch@entry=true) at contrib/cmndline.cc:360
#9  0x00000000004086eb in main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) at apt-get.cc:2897
(gdb) p ts
$1 = (rpmts) 0x4b6b260
(gdb) p ts-&gt;rootDir
$2 = 0x0

rstreq -- тонкая обёртка над strcmp, которая естественно в NULL&apos;ы не умеет.

Вроде бы rpmtsRootDir имеет право возвращать NULL -- в паре мест где она вызывается этот случай обработан явно. Очевидно проблемных места я нашёл два:
* plugins/syslog.c:46
* rpmbuild.c:442 -- но тут не упадёт, потому что вначале main у rpmbuild вызывается rpmtsSetRootDir, после которого ts-&gt;rootDir NULL&apos;ом быть не может.

Похоже, нужно просто добавить проверку на NULL в syslog_tsm_pre.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182346</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-06-11 14:39:30 +0300</bug_when>
    <thetext>&gt; Похоже, нужно просто добавить проверку на NULL в syslog_tsm_pre.

Например, так:

http://git.altlinux.org/people/iv/packages/rpm.git?p=rpm.git;a=commitdiff;h=6c659545d2af01e7683338848c96b5167bf3a8f9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182352</commentid>
    <comment_count>3</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2019-06-11 16:29:45 +0300</bug_when>
    <thetext>rpm-4.13.0.1-alt8 -&gt; sisyphus:

Tue Jun 11 2019 Ivan A. Melnikov &lt;iv@altlinux&gt; 4.13.0.1-alt8
- Fix crash in syslog plugin (closes: #35722).
- Fix setting permissions for hardlinked files even if some
  of the files are skipped (closes: #32997).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>