Hello gnuCash members,

I hope all is well.

I experienced a crash (segmentation fault) while using the 
Scheduled Transactions --> Mortgage & Loan Repayment tool.

This seems to be due to an error in creating the pmt string; i.e.,
For example (see additional information below), it generates 
                 pmt(  /  :   :   : 0 : 0 )
which should be
                 pmt( .05750 / 12.00 : 180.00 : 360000.00 : 0 : 0 )

A possible solution is to add the following 3 functions 
to the assistant-loan.cpp -- struct cust_prec_punct:
                                         
     pattern do_pos_format() const { return {value, none, none, none}; }
     pattern do_neg_format() const { return {sign, value, none, none}; }
     string_type do_negative_sign() const { return L"-"; }              

resulting in:

template<int prec>
struct cust_prec_punct : std::moneypunct_byname<wchar_t, false> {
  cust_prec_punct(const char* name) : moneypunct_byname(name) {}
  int do_frac_digits() const { return prec; }
  pattern do_pos_format() const { return {value, none, none, none}; }
  pattern do_neg_format() const { return {sign, value, none, none}; }
  string_type do_negative_sign() const { return L"-"; }
};

I hope this information is helpful.

respectfully,

guardian

==    see additional information below   ==

...............................................................................

Steps to Reproduce this Issue:

1. Navigate to Actions -> Scheduled Transactions -> Mortgage & Loan Repayment.

2. Loan Details: 
                  Loan Account: Liabilities:Loans:Mortgage Loan 
                        Amount: 360000.00 
                 Interest Rate: Interest Rate       5.750                     
                          Type: Fixed Rate
                    Start Date: 08/01/2026 
                        Length: 180 Months                        
              Months Remaining: 180

3. Loan Repayment Options: none of these options were selected on this page

4. Loan Repayment: 
                           Name: Loan 
                         Amount: pmt( / : : 0:0)
                   Payment From: Assets:Current Assets
                   Principal To: Liabilities:Loans:Mortgage Loan                
                    Interest To: Expenses:Interest:Mortgage Interest
                      Frequency: Monthly                                        
 
                     Start Date: 08/01/26
                          Every: 1 months
                         On the: 1st                                     
             execpt on weekends: No change
                         
             Note: clicking "next" results in a segmentation fault
                   Possibly due to the "pmt( / : : 0:0)" in Amount gui entry

...............................................................................

output from gdb (including backtrace):

Note: downloaded current version of gnucash (version 5.16) for testing.

luke@mint:~/temp/swe/gnucash-testing$ gdb gnucash
GNU gdb (Ubuntu 15.1-1ubuntu1~24.04.1) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gnucash...
(No debugging symbols found in gnucash)
(gdb) run
Starting program: /usr/bin/gnucash 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffea1ca6c0 (LWP 1711777)]
[New Thread 0x7fffe17ff6c0 (LWP 1711778)]
[New Thread 0x7fffe99c96c0 (LWP 1711779)]
[New Thread 0x7fffe37576c0 (LWP 1711790)]
[New Thread 0x7fffe2f566c0 (LWP 1711791)]
[New Thread 0x7fffe21496c0 (LWP 1711792)]
[New Thread 0x7fffe0bdd6c0 (LWP 1711793)]
[New Thread 0x7fffcbfff6c0 (LWP 1711794)]
[New Thread 0x7fffcb7fe6c0 (LWP 1711795)]
[New Thread 0x7fffcaffd6c0 (LWP 1711796)]
[New Thread 0x7fffca7fc6c0 (LWP 1711797)]
[New Thread 0x7fffc9ffb6c0 (LWP 1711798)]
[New Thread 0x7fffc97fa6c0 (LWP 1711799)]
[New Thread 0x7fffc8ff96c0 (LWP 1711800)]
[Detaching after fork from child process 1711812]
[New Thread 0x7fffc5f0b6c0 (LWP 1711824)]
[Thread 0x7fffc5f0b6c0 (LWP 1711824) exited]
[Thread 0x7fffe21496c0 (LWP 1711792) exited]

Thread 1 "gnucash" received signal SIGSEGV, Segmentation fault.
0x00007ffff7161403 in ?? () from 
/usr/lib/x86_64-linux-gnu/gnucash/libgnc-expressions.so
(gdb) bt full
#0  0x00007ffff7161403 in ??? () at 
/usr/lib/x86_64-linux-gnu/gnucash/libgnc-expressions.so
#1  0x00007ffff715b103 in ??? () at 
/usr/lib/x86_64-linux-gnu/gnucash/libgnc-expressions.so
#2  0x00007ffff715b509 in ??? () at 
/usr/lib/x86_64-linux-gnu/gnucash/libgnc-expressions.so
#3  0x00007ffff715ce08 in parse_string () at 
/usr/lib/x86_64-linux-gnu/gnucash/libgnc-expressions.so
#4  0x00007ffff7161a2a in gnc_exp_parser_parse_separate_vars () at 
/usr/lib/x86_64-linux-gnu/gnucash/libgnc-expressions.so
#5  0x00007ffff7ca33e9 in loan_assistant_prepare () at 
/usr/lib/x86_64-linux-gnu/gnucash/libgnc-gnome.so
#6  0x00007ffff64e2cf7 in g_cclosure_marshal_VOID__OBJECTv () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7  0x00007ffff650390b in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#8  0x00007ffff65047c1 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9  0x00007ffff6504883 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffff73fe73b in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#11 0x00007ffff64e2cf7 in g_cclosure_marshal_VOID__OBJECTv () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x00007ffff65046bd in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x00007ffff65047c1 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x00007ffff6504883 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x00007ffff73fe73b in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#16 0x00007ffff73fe99b in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#17 0x00007ffff73fec2e in gtk_assistant_next_page () at 
/lib/x86_64-linux-gnu/libgtk-3.so.0
#18 0x00007ffff65046bd in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#19 0x00007ffff65047c1 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x00007ffff6504883 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x00007ffff7416f08 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#22 0x00007ffff65046bd in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x00007ffff65047c1 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff6504883 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff7416ccd in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#26 0x00007ffff73d5b43 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#27 0x00007ffff65046bd in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007ffff65047c1 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#29 0x00007ffff6504883 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#30 0x00007ffff74f22f3 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007ffff64e88da in g_cclosure_marshal_VOID__BOXEDv () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#32 0x00007ffff65046bd in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#33 0x00007ffff65047c1 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#34 0x00007ffff6504883 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#35 0x00007ffff74e9f5c in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#36 0x00007ffff74f1ccb in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#37 0x00007ffff74f55ca in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#38 0x00007ffff74b4ab3 in gtk_event_controller_handle_event () at 
/lib/x86_64-linux-gnu/libgtk-3.so.0
#39 0x00007ffff769a6d8 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#40 0x00007ffff73d42f7 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#41 0x00007ffff65046bd in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#42 0x00007ffff65047c1 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#43 0x00007ffff6504883 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#44 0x00007ffff76a2bf4 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#45 0x00007ffff753f390 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#46 0x00007ffff753ff2a in gtk_main_do_event () at 
/lib/x86_64-linux-gnu/libgtk-3.so.0
#47 0x00007ffff5cb0407 in ??? () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#48 0x00007ffff5d09e2e in ??? () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#49 0x00007ffff6cfa585 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#50 0x00007ffff6d59977 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#51 0x00007ffff6cfaf47 in g_main_loop_run () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#52 0x00007ffff753abc5 in gtk_main () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#53 0x00007ffff7b746d3 in gnc_ui_start_event_loop () at 
/usr/lib/x86_64-linux-gnu/gnucash/gnucash/libgnc-gnome-utils.so
#54 0x00005555555677eb in ??? ()
#55 0x00007ffff7dab258 in ??? () at /lib/x86_64-linux-gnu/libguile-3.0.so.1
#56 0x00007ffff7d915b6 in ??? () at /lib/x86_64-linux-gnu/libguile-3.0.so.1
#57 0x00007ffff7e1c013 in ??? () at /lib/x86_64-linux-gnu/libguile-3.0.so.1
#58 0x00007ffff7e2619b in scm_call_n () at 
/lib/x86_64-linux-gnu/libguile-3.0.so.1
--Type <RET> for more, q to quit, c to continue without paging--c
#59 0x00007ffff7d92e42 in scm_call_2 () at 
/lib/x86_64-linux-gnu/libguile-3.0.so.1
#60 0x00007ffff7e3619d in ??? () at /lib/x86_64-linux-gnu/libguile-3.0.so.1
#61 0x00007ffff7e13570 in scm_c_catch () at 
/lib/x86_64-linux-gnu/libguile-3.0.so.1
#62 0x00007ffff7d93b12 in scm_c_with_continuation_barrier () at 
/lib/x86_64-linux-gnu/libguile-3.0.so.1
#63 0x00007ffff7e1ac15 in ??? () at /lib/x86_64-linux-gnu/libguile-3.0.so.1
#64 0x00007ffff5c2b04e in GC_call_with_stack_base () at 
/lib/x86_64-linux-gnu/libgc.so.1
#65 0x00007ffff7e13460 in scm_with_guile () at 
/lib/x86_64-linux-gnu/libguile-3.0.so.1
#66 0x00007ffff7db459b in scm_boot_guile () at 
/lib/x86_64-linux-gnu/libguile-3.0.so.1
#67 0x000055555556a58d in Gnucash::Gnucash::start(int, char**) ()
#68 0x0000555555560d89 in main ()
(gdb) quit
A debugging session is active.

    Inferior 1 [process 1711760] will be killed.

Quit anyway? (y or n) y
luke@mint:~/temp/swe/gnucash-testing$ 

...............................................................................



_______________________________________________
gnucash-user mailing list
[email protected]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to