Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmpfr causes the process to exit SIGSEGV when closing the application #189

Open
sp1ritCS opened this issue Jan 27, 2023 · 0 comments
Open

Comments

@sp1ritCS
Copy link

This happens when 1 - 1 / e^2 was calculated at any time during the runtime of the app.

Based on the following backtrace,

#0  0x00007ffff5362c68 in mpfr_clear (m=0x7fffd4039ac0) at /usr/src/debug/mpfr-4.1.1/src/clear.c:29
#1  0x00007ffff539437a in mpfr_clears (x=<optimized out>) at /usr/src/debug/mpfr-4.1.1/src/clears.c:56
#2  0x00007ffff69f6ad1 in Number::~Number() (this=0x7fffd4039a98, this=<optimized out>) at /usr/src/debug/libqalculate-4.5.0/libqalculate/Number.cc:448
#3  0x00007ffff6a43692 in MathStructure::~MathStructure() (this=0x7fffd4039a30, this=<optimized out>)
    at /usr/src/debug/libqalculate-4.5.0/libqalculate/MathStructure.cc:214
#4  0x00007ffff69f0e8b in KnownVariable::~KnownVariable() (this=0x7fffe0066a60, this=<optimized out>)
    at /usr/src/debug/libqalculate-4.5.0/libqalculate/Variable.cc:291
#5  0x00007ffff69f0fb7 in DynamicVariable::~DynamicVariable() (this=<optimized out>, this=<optimized out>)
    at /usr/src/debug/libqalculate-4.5.0/libqalculate/Variable.cc:557
#6  0x00007ffff69f1297 in EVariable::~EVariable() (this=0x7fffe0066a60, this=<optimized out>)
    at /usr/src/debug/libqalculate-4.5.0/libqalculate/Variable.h:420
#7  EVariable::~EVariable() (this=0x7fffe0066a60, this=<optimized out>) at /usr/src/debug/libqalculate-4.5.0/libqalculate/Variable.h:420
#8  0x00007ffff6935c67 in Calculator::~Calculator() (this=0x7fffe00ace00, this=<optimized out>)
    at /usr/src/debug/libqalculate-4.5.0/libqalculate/Calculator.cc:603
#9  0x00007ffff6936ad9 in Calculator::~Calculator() (this=0x7fffe00ace00, this=<optimized out>)
    at /usr/src/debug/libqalculate-4.5.0/libqalculate/Calculator.cc:618
#10 0x00005555555878ba in std::_Sp_counted_ptr<Calculator*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (this=0x7fffe00d2c30)
    at /usr/include/c++/12/bits/shared_ptr_base.h:428
#11 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (this=0x7fffe00d2c30) at /usr/include/c++/12/bits/shared_ptr_base.h:346
#12 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (this=0x7fffe00d2c30) at /usr/include/c++/12/bits/shared_ptr_base.h:317
#13 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (this=<optimized out>, this=<optimized out>)
    at /usr/include/c++/12/bits/shared_ptr_base.h:1071
#14 std::__shared_ptr<Calculator, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (this=<optimized out>, this=<optimized out>)
    at /usr/include/c++/12/bits/shared_ptr_base.h:1524
#15 std::shared_ptr<Calculator>::~shared_ptr() (this=<optimized out>, this=<optimized out>) at /usr/include/c++/12/bits/shared_ptr.h:175
#16 0x00007ffff6245095 in __run_exit_handlers
    (status=0, listp=0x7ffff63ea820 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:113
#17 0x00007ffff6245220 in __GI_exit (status=<optimized out>) at exit.c:143
#18 0x00007ffff622c5b7 in __libc_start_call_main (main=main@entry=0x5555555668f0 <main(int, char**)>, argc=argc@entry=1, argv=argv@entry=0x7fffffffd0a8)
    at ../sysdeps/nptl/libc_start_call_main.h:74
#19 0x00007ffff622c679 in __libc_start_main_impl
     (main=0x5555555668f0 <main(int, char**)>, argc=1, argv=0x7fffffffd0a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd098) at ../csu/libc-start.c:381
#20 0x0000555555566ac5 in _start () at ../sysdeps/x86_64/start.S:115

the issue seems to be caused in the destructor of libqalculate Number class, likely by an erroneous use of mpfr_clears here.

This seems obviously more like an error with libqalculate, however I wasn't able to reproduce it in qalc, so I'm reporting it here. Feel free to forward if this isn't nasc's issue.

This happens on openSUSE Tumbleweed 20230106 with:

  • NASC: nasc-0.5.4-2.17.x86_64
  • libqalculate: libqalculate22-4.5.0-1.1.x86_64
  • MPFR: libmpfr6-4.1.1-3.1.x86_64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant