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

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

    <bug>
          <bug_id>38068</bug_id>
          
          <creation_ts>2020-02-10 18:17:31 +0300</creation_ts>
          <short_desc>При запуске gnucash: terminate called without an active exception: getrandom: ENOSYS</short_desc>
          <delta_ts>2020-02-12 03:13:00 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Distributions</classification>
          <product>Branch p9</product>
          <component>boost-devel-headers</component>
          <version>не указана</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>https://github.com/boostorg/uuid/issues/92</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vitaly Lipatov">lav</reporter>
          <assigned_to name="Vitaly Lipatov">lav</assigned_to>
          
          
          <qa_contact name="qa-p9@altlinux.org">qa-p9</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>187719</commentid>
    <comment_count>0</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2020-02-10 18:17:31 +0300</bug_when>
    <thetext>После обновления до p9 (с gnucash-2.6.17-alt0.M80P.1 до gnucash-3.6-alt1) ранее открывавшийся файл стал вызывать падение с сообщением

$ gnucash TEST.gnucash
Found Finance::Quote version 1.47.
terminate called without an active exception

$ gdb gnucash
Thread 1 &quot;gnucash&quot; received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	  return ret;
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff6c13515 in __GI_abort () at abort.c:79
#2  0x00007ffff65ad9d7 in __gnu_cxx::__verbose_terminate_handler () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
#3  0x00007ffff65d14d6 in __cxxabiv1::__terminate (handler=&lt;optimized out&gt;) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x00007ffff65d1511 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x00007ffff6e5ac5b in gnc::GUID::create_random () at /usr/include/c++/8/ext/new_allocator.h:86
#6  0x00007ffff6ee7e92 in guid_replace (guid=guid@entry=0x7a3400) at /usr/src/debug/gnucash-3.6/libgnucash/engine/guid.cpp:147
#7  0x00007ffff6f0d5fd in qof_instance_init_data (inst=inst@entry=0x7a3450, type=type@entry=0x7ffff6f7f1a8 &quot;Book&quot;, book=book@entry=0x7a3450) at /usr/src/debug/gnucash-3.6/libgnucash/engine/qofinstance.cpp:301
#8  0x00007ffff6f0616d in qof_book_init (book=0x7a3450) at /usr/src/debug/gnucash-3.6/libgnucash/engine/qofbook.cpp:135
#9  qof_book_init (book=0x7a3450) at /usr/src/debug/gnucash-3.6/libgnucash/engine/qofbook.cpp:126
#10 0x00007ffff71782d7 in g_type_create_instance (type=&lt;optimized out&gt;) at ../gobject/gtype.c:1864
#11 0x00007ffff715a718 in g_object_new_internal (class=class@entry=0x1a13a10, params=params@entry=0x0, n_params=n_params@entry=0) at ../gobject/gobject.c:1805
#12 0x00007ffff715be95 in g_object_new_with_properties (object_type=27342544, n_properties=0, names=names@entry=0x0, values=values@entry=0x0) at ../gobject/gobject.c:1973
#13 0x00007ffff715c901 in g_object_new (object_type=&lt;optimized out&gt;, first_property_name=first_property_name@entry=0x0) at ../gobject/gobject.c:1645
#14 0x00007ffff6f06507 in qof_book_new () at /usr/src/debug/gnucash-3.6/libgnucash/engine/qofbook.cpp:390
#15 0x00007ffff6f1a6f9 in QofSessionImpl::QofSessionImpl (this=0x1a0e850) at /usr/src/debug/gnucash-3.6/libgnucash/engine/qofsession.cpp:121
#16 0x00007ffff6f1a756 in qof_session_new () at /usr/src/debug/gnucash-3.6/libgnucash/engine/qofsession.cpp:150
#17 0x00007ffff709d9bf in gnc_post_file_open (parent=0x792260, filename=filename@entry=0x1531b40 &quot;TEST.gnucash&quot;, is_readonly=is_readonly@entry=0)
    at /usr/src/debug/gnucash-3.6/gnucash/gnome-utils/gnc-file.c:738
#18 0x00007ffff709e372 in gnc_file_open_file (open_readonly=0, newfile=0x1531b40 &quot;TEST.gnucash&quot;, parent=&lt;optimized out&gt;)
    at /usr/src/debug/gnucash-3.6/gnucash/gnome-utils/gnc-file.c:1088
#19 gnc_file_open_file (parent=&lt;optimized out&gt;, newfile=newfile@entry=0x1531b40 &quot;TEST.gnucash&quot;, open_readonly=open_readonly@entry=0)
    at /usr/src/debug/gnucash-3.6/gnucash/gnome-utils/gnc-file.c:1081
#20 0x0000000000403fc5 in inner_main (closure=&lt;optimized out&gt;, argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) at /usr/src/debug/gnucash-3.6/gnucash/gnucash-bin.c:651
#21 0x00007ffff7be25ad in invoke_main_func (body_data=0x7fffffffe0c0) at init.c:340
#22 0x00007ffff7bc4c4a in c_body (d=0x7fffffffe000) at continuations.c:422
#23 0x00007ffff7c46317 in vm_regular_engine (thread=0x2, vp=0xb3ff30, registers=0x0, resume=-1) at vm-engine.c:786
#24 0x00007ffff7c48b47 in scm_call_n (proc=proc@entry=0xaef820, argv=argv@entry=0x0, nargs=nargs@entry=0) at vm.c:1257
#25 0x00007ffff7bca889 in scm_call_0 (proc=proc@entry=0xaef820) at eval.c:481
#26 0x00007ffff7c376e2 in catch (tag=tag@entry=0x404, thunk=0xaef820, handler=0xaef800, pre_unwind_handler=0xaef7a0) at throw.c:137
#27 0x00007ffff7c379d5 in scm_catch_with_pre_unwind_handler (key=key@entry=0x404, thunk=&lt;optimized out&gt;, handler=&lt;optimized out&gt;, pre_unwind_handler=&lt;optimized out&gt;) at throw.c:254
#28 0x00007ffff7c37b9f in scm_c_catch (tag=tag@entry=0x404, body=body@entry=0x7ffff7bc4c40 &lt;c_body&gt;, body_data=body_data@entry=0x7fffffffe000, handler=handler@entry=0x7ffff7bc4ed0 &lt;c_handler&gt;, handler_data=handler_data@entry=0x7fffffffe000, 
    pre_unwind_handler=pre_unwind_handler@entry=0x7ffff7bc4d30 &lt;pre_unwind_handler&gt;, pre_unwind_handler_data=0xb3abc0) at throw.c:377
#29 0x00007ffff7bc5230 in scm_i_with_continuation_barrier (body=body@entry=0x7ffff7bc4c40 &lt;c_body&gt;, body_data=body_data@entry=0x7fffffffe000, handler=handler@entry=0x7ffff7bc4ed0 &lt;c_handler&gt;, handler_data=handler_data@entry=0x7fffffffe000, 
    pre_unwind_handler=pre_unwind_handler@entry=0x7ffff7bc4d30 &lt;pre_unwind_handler&gt;, pre_unwind_handler_data=0xb3abc0) at continuations.c:360
#30 0x00007ffff7bc52c5 in scm_c_with_continuation_barrier (func=&lt;optimized out&gt;, data=&lt;optimized out&gt;) at continuations.c:456
#31 0x00007ffff7c3632c in with_guile (base=base@entry=0x7fffffffe068, data=data@entry=0x7fffffffe090) at threads.c:661
#32 0x00007ffff6221aa8 in GC_call_with_stack_base (fn=fn@entry=0x7ffff7c362e0 &lt;with_guile&gt;, arg=arg@entry=0x7fffffffe090) at misc.c:1965
#33 0x00007ffff7c36648 in scm_i_with_guile (dynamic_state=&lt;optimized out&gt;, data=data@entry=0x7fffffffe090, func=func@entry=0x7ffff7be2590 &lt;invoke_main_func&gt;) at threads.c:704
#34 scm_with_guile (func=func@entry=0x7ffff7be2590 &lt;invoke_main_func&gt;, data=data@entry=0x7fffffffe0c0) at threads.c:710
#35 0x00007ffff7be2742 in scm_boot_guile (argc=1, argv=0x7fffffffe228, main_func=0x403e10 &lt;inner_main&gt;, closure=0x0) at init.c:323
#36 0x00000000004039d8 in main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) at /usr/src/debug/gnucash-3.6/gnucash/gnucash-bin.c:919</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187720</commentid>
    <comment_count>1</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2020-02-10 18:23:23 +0300</bug_when>
    <thetext>Установка gnucash-3.7-alt1 (пересобраннного из Сизифа) ничего не дало:

Thread 1 &quot;gnucash&quot; received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	  return ret;
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff6c10515 in __GI_abort () at abort.c:79
#2  0x00007ffff65a99d7 in __gnu_cxx::__verbose_terminate_handler () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
#3  0x00007ffff65cd4d6 in __cxxabiv1::__terminate (handler=&lt;optimized out&gt;) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x00007ffff65cd511 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x00007ffff6e58cab in gnc::GUID::create_random () at /usr/include/c++/8/ext/new_allocator.h:86
#6  0x00007ffff6ee6002 in guid_replace (guid=guid@entry=0x7a4400) at /usr/src/debug/gnucash-3.7/libgnucash/engine/guid.cpp:147
#7  0x00007ffff6f0b85d in qof_instance_init_data (inst=inst@entry=0x7a4450, type=type@entry=0x7ffff6f7d368 &quot;Book&quot;, book=book@entry=0x7a4450) at /usr/src/debug/gnucash-3.7/libgnucash/engine/qofinstance.cpp:301
#8  0x00007ffff6f0435d in qof_book_init (book=0x7a4450) at /usr/src/debug/gnucash-3.7/libgnucash/engine/qofbook.cpp:135</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187721</commentid>
    <comment_count>2</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2020-02-10 18:38:09 +0300</bug_when>
    <thetext>Ну да, gnucash - падучее недоразумение.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187722</commentid>
    <comment_count>3</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2020-02-10 19:19:33 +0300</bug_when>
    <thetext>(Ответ для Andrey Cherepanov на комментарий #2)
&gt; Ну да, gnucash - падучее недоразумение.
В данном случае это ядро openvz-2.6.32 и getrandom

strace:
getrandom(0x7ffd6ea4c6b0, 16, 0)        = -1 ENOSYS (Функция не реализована)
write(2, &quot;terminate called after throwing &quot;..., 48terminate called after throwing an instance of &apos;) = 48

для тестовой программы
#include &lt;boost/uuid/uuid.hpp&gt;            // uuid class
#include &lt;boost/uuid/uuid_generators.hpp&gt; // generators
#include &lt;boost/uuid/uuid_io.hpp&gt;         // streaming operators etc.

#include &lt;iostream&gt;

int main()
{
    boost::uuids::uuid uuid = boost::uuids::random_generator()();
    std::cout &lt;&lt; uuid &lt;&lt; std::endl;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187724</commentid>
    <comment_count>4</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2020-02-10 19:55:35 +0300</bug_when>
    <thetext>#7  0x0000000000402c1b in void boost::exception_detail::throw_exception_&lt;boost::uuids::entropy_error&gt;(boost::uuids::entropy_error const&amp;, char const*, char const*, int) ()
#8  0x000000000040292d in boost::uuids::detail::random_provider_base::get_random_bytes(void*, unsigned long) ()
#9  0x00000000004029bb in boost::uuids::random_generator_pure::operator()() ()


После отладки get_random_bytes выяснилось, что это библиотечная getentropy не работает:
#include &lt;unistd.h&gt;
#include &lt;stdio.h&gt;

int main()
{
    char buf[100];
    int res = getentropy(buf,100);
    printf(&quot;getentropy result=%d\n&quot;, res);
}

strace:
getrandom(0x7ffe6b1d76c0, 100, 0)       = -1 ENOSYS (Функция не реализована)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187735</commentid>
    <comment_count>5</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2020-02-10 22:59:15 +0300</bug_when>
    <thetext>Подобная проблема была с python:
https://bugzilla.altlinux.org/show_bug.cgi?id=33356

boost сейчас тоже не парится, если glibc &gt;=2.25, использует getentropy:
#elif BOOST_LIB_C_GNU &gt;= BOOST_VERSION_NUMBER(2, 25, 0) &amp;&amp; !defined(BOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX)
# define BOOST_UUID_RANDOM_PROVIDER_GETENTROPY
# define BOOST_UUID_RANDOM_PROVIDER_NAME getentropy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187762</commentid>
    <comment_count>6</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2020-02-12 03:13:00 +0300</bug_when>
    <thetext>Ядро 2.6.32-ovz-el не поддерживается.
Если в каком-то случае проблема будет актуальна, можно применять свою реализацию getrandom по аналогии с https://github.com/Etersoft/ignoreflock</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>