GNOME Bugzilla – Bug 707311
Tax Invoice fails to open when using guile 2
Last modified: 2018-06-29 23:18:48 UTC
The following backtrace is currently generated whenever I try to open the tax invoice report with the current trunk branch of GnuCash on Fedora 19 (64-bit): * 21:37:58 WARN <gnc.report.core> Failure running report: ERROR: In procedure apply-smob/1: ERROR: Wrong number of arguments to #<procedure display-error (_ _ _ _ _ _)> In ice-9/eval-string.scm: 37: 19 [lp (gnc:report-run 1)] In ice-9/eval.scm: 432: 18 [eval # #] In ice-9/boot-9.scm: 157: 17 [catch ignore #<procedure 55a7300 at ice-9/eval.scm:416:20 ()> ...] In unknown file: ?: 16 [lazy-catch #t #<procedure 55a72a0 at ice-9/eval.scm:416:20 ()> ...] In ice-9/boot-9.scm: 171: 15 [with-throw-handler #t #<catch-closure 63b3700> #<catch-closure 63b36e0>] In unknown file: ?: 14 [apply-smob/1 #<catch-closure 63b3700>] In ice-9/eval.scm: 432: 13 [eval # #] 436: 12 [eval # #] 432: 11 [eval # #] 436: 10 [eval # #] 432: 9 [eval # #] 436: 8 [eval # #] In ice-9/r4rs.scm: 35: 7 [apply #<procedure string-append _> #] In ice-9/boot-9.scm: 102: 6 [#<procedure a46f100 at ice-9/boot-9.scm:97:6 (thrown-k . args)> vm-error ...] In unknown file: ?: 5 [apply-smob/1 #<catch-closure 63b36e0> vm-error ...] In ice-9/eval.scm: 432: 4 [eval # #] In unknown file: ?: 3 [display-error #f #<output: file /dev/pts/2> vm-run "VM: Stack overflow" ()] In ice-9/boot-9.scm: 106: 2 [#<procedure a46f100 at ice-9/boot-9.scm:97:6 (thrown-k . args)> wrong-number-of-args ...] 102: 1 [#<procedure a46f180 at ice-9/boot-9.scm:97:6 (thrown-k . args)> wrong-number-of-args ...] In unknown file: ?: 0 [apply-smob/1 #<catch-closure 63b3ac0> wrong-number-of-args ...] * 21:38:56 WARN <gnc.scm> Exception thrown while printing backtrace: ERROR: In procedure display_backtrace_body: Wrong type argument in position 1 (expecting stack): #f ERROR: Unbound variable: the-environment I found that the-environment is defined in ice-9/local-eval.scm in guile 2.0, where it was in ice-9/boot-9.scm in guile 1.8. The definitions are different as well: in guile 2.0 it's defined using (define-syntax), while it guile 1.8 it's a plain define. I have tried to add (use-modules (ice-9 local-eval)) to each file that referred to "the-environment", but that just changed the back trace to: ERROR: Wrong type to apply: #<syntax-transformer the-environment> In unknown file: ?: 4 [#] In ice-9/boot-9.scm: 102: 3 [# wrong-type-arg ...] My guile knowledge is too limited to fully grasp this.
Created attachment 259745 [details] Backtrace after using (cond-expand) I read something in the guile reference manual about macro's (which include syntax transformers) being expanded at evaluation time rather than at runtime. I assume the conditional I used to include module ice-9 local-eval is run too late. So instead I have now changed that code to (cond-expand (guile-2 (eval-when (compile load eval) (use-modules (ice-9 local-eval))))) ; for the-environment This still doesn't work, but gives me yet another back trace, which I'm attaching here (it's a bit too long to paste in a comment).
Got it fixed in r23395, with some guidance from Andy Wingo.
The change in r23395 breaks things if the Guile code is not compiled. If you delete the cached compiled objects, then set GUILE_AUTO_COMPILE to zero, the EGuile balance sheet report loops when you open it. I tried a few things to fix it, but I don't understand what's going on here well enough to do much about it. Granted that running the Guile code without compiling it will not be the normal case, it should still work.
Yes, this happens on my system as well :( Unfortunately there's no trace of what is happening...
Got it fixed with the kind support of the guile developers. Incredible it was only a one-liner... r23459
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=707311. Please update any external references or bookmarks.