Re: [GNC-dev] [GNC] custom report freezing - work done gets lost.

2019-10-09 Thread Steven Bruniges
I have fixed the report – but don’t know why it was broken.  I am idly curious 
why the first approach failed, mostly in case I have drawn away from some 
boundary condition that I will meet again in a few years’ time as the records 
grow!

 

1.   Is there a fixed amount of stack space for a gnucash report on the 
windows 10 platform? (or similar limited system resource)?

2.   Can the code of my report be causing memory leakage, and what steps 
are required to manage this in gnucash/scheme?

3.   Could the autosave thread have interfered with the report thread?

4.   Is autosave delayed while a report is running?

5.   Are queries cached in gnucash using the standard backend - so that 
they are returned faster?

6.   Can any other gnucash thread -  lock a transaction, memory etc. etc.?

 

If you’re interested, here’s the background.

 

Having got deeper I discovered the hang was not caused by destroying splits as 
I first thought (e.g. I commented out the xaccDestroySplit).  It still froze on 
code similar to 

 

(let (  (all_ accs (xaccAccountGetDescendants (root

(for-each (lambda (split)

(let* ((name“fred”)

(count  (set! count (1+ count)))

(func (lamda (acc) (equal? (xaccAccountGetName 
(xaccAccountGetParent acc)) name  )))

(don’t-care(gnc-warn "before suspect code ")) 

(accounts  (filter func 
all-accs))

(don’t-care(gnc-warn "after 
suspect code"))

(acc  (find …. 
accounts)…..

 

Etc.

 

It worked as expected for the first 700ish passes of 3000, until it freezes.  
Surprisingly, as I added and removed diagnostic code, the last successful 
loop/split before the hang varied on subsequent runs as did the precise place 
where it freezes.  Most of the time though it freezes between the two warns – 
but not always on the same split.  

 

The apparently inconsistent behaviour makes me wonder about memory management 
issues and thread competition – rather than some particular property of a 
specific split.  

 

The work-around.  I avoided the hang by fetching and  filtering the children of 
a specific account inside the loop, rather than the code as you see it (fetches 
all accounts once outside the loop and filters per pass).   Both code 
strategies achieve the same outcome with different overheads.  With this one 
change the report prints (at least so-far).   

 

Steve

 

 

 

-Original Message-
From: John Ralls [mailto:jra...@ceridwen.us] 
Sent: Monday, 7 October 2019 4:42 AM
To: Steven Bruniges 
Cc: Gnucash Users ; GnuCash Developer 

Subject: Re: [GNC-dev] [GNC] custom report freezing - work done gets lost.

 

You mean why does it hang instead of crashing? Possibly because the memory was 
reallocated back to the program for something else and the attempt to free the 
splits is freeing whatever that is and that's resulting in a hang. 

 

But why would a report create or delete splits or transactions? A report should 
be describing the book as it is, not changing it.

 

 

Regards,

John Ralls

 

> On Oct 6, 2019, at 2:36 AM, Christopher Lam < 
>  christopher@gmail.com> wrote:

> 

> Ok forwarding to people who have better idea.

> 

> -- Forwarded message -

> From: Steven Bruniges <  
> steven.bruni...@gmail.com>

> Date: Sun, 6 Oct 2019 at 09:34

> Subject: Re: [GNC] custom report freezing - work done gets lost.

> To: Christopher Lam <  
> christopher@gmail.com>

> 

> 

> Have identifies my issue.   Was calling xaccTransDestroy with pointers to

> splits that had been destroyed in an earlier loop.  Not sure why this 

> locks up gnucash.

> 

> Steve

> 

> On Sun, 6 Oct 2019, 22:20 Christopher Lam, < 
>  christopher@gmail.com>

> wrote:

> 

>> Sorry without specific detail what you're trying to do, we can't help.

>> Moreover this is open-source, including open-source help requests.

>> cc: devel

>> 

>> On Sun, 6 Oct 2019 at 05:58, Steven Bruniges 

>> <  steven.bruni...@gmail.com>

>> wrote:

>> 

>>> Not even sure it’s the session I want to save (hoping for the 

>>> function underlying the save option in the file menu).

>>> 

>>> 

>>> 

>>> Working through a process of elimination.  I’d love to find the 

>>> transaction that’s triggering this behaviour.  If I can reduce the 

>>> 3000 splits to something more manageable I may find the issue?

>>> 

>>> 

>>> 

>>> The report typically hangs and Task manager shows the system is at rest.

>>> If I modify the code to open warning dialogs it crashes after a 

>>> number of loops.  No output in the trace file.  Either way, I get no 

>>> diagnostic feedback.


Re: [GNC-dev] Help packaging GnuCash 3.x for Ubuntu Bionic

2019-10-09 Thread Tommy Trussell
Here's a tested working procedure for building and installing GnuCash under
Ubuntu Bionic 18.04 LTS. I presume it should also work with Mint or any
other distro based on Bionic.

REQUIREMENTS
An Ubuntu Bionic installation *with bionic-backports activated. (I used a
minimal Xubuntu installation in a VirtualBox VM for this test.)

1) Create a source directory

  $ mkdir bionic37
  $ cd bionic37

2) Get the latest Ubuntu package

  $ dget
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/gnucash/1:3.7-1ubuntu1/gnucash_3.7-1ubuntu1.dsc

2b) Move into the directory created by the source package

  $ cd gnucash-3.7

3) Comment out a build flag line in debian/rules so it will build in Bionic

  $ sed -i 's/export DEB_CXXFLAGS/#export DEB_CXXFLAGS/' debian/rules

4) Make this your custom version (so any "official" release should
supersede it).

  $ dch --nmu

4b) Edit the version at the top so it reads something like
  gnucash (1:3.7-1ubuntu18.04~1)

4c) Add a comment under your name and email in the first comment saying
something like
  "Commented out DEB_CXXFLAGS instruction in debian/rules"

4d) Save and exit the editor.

5) Upgrade debhelper

  $ sudo apt install debhelper/bionic-backports

6) Build the package

  $ dpkg-buildpackage

7) You will see the package files in the bionic37 directory, ready to
install.

  $ sudo dpkg -i *.deb *.ddeb

  $ sudo apt install -f

The dpkg -i command above attempts to install gnucash .deb files (and the
optional .ddeb debugging files). In a fresh installation, "dpkg -i" will
fail because of missing dependencies, so the "apt install -f" command will
install the missing dependencies and finish installing gnucash.
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Help packaging GnuCash 3.x for Ubuntu Bionic

2019-10-09 Thread Tommy Trussell
I requested a backport of GnuCash 3.7 from Ubuntu eoan 19.10 to bionic 18.04

https://bugs.launchpad.net/bionic-backports/+bug/1847547

UNFORTUNATELY I still don't understand why I cannot get the eoan package to
build in an sbuild bionic chroot with bionic-backports. I also cannot get
the eoan gnucash-docs package to build, either inside or outside a chroot.
A task for another day...
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel