Bug 197189 - lang/guile2 failure during build of finance/gnucash on FreeBSD 8.4 i386
Summary: lang/guile2 failure during build of finance/gnucash on FreeBSD 8.4 i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-30 00:08 UTC by Don Lewis
Modified: 2015-04-10 19:31 UTC (History)
3 users (show)

See Also:


Attachments
script to run guild compile under truss (1.43 KB, application/x-shellscript)
2015-01-30 00:08 UTC, Don Lewis
no flags Details
truss output from guild on FreeBSD 8.4 i386 (41.74 KB, application/gzip)
2015-01-30 00:10 UTC, Don Lewis
no flags Details
truss output from guild on FreeBSD 10.1 amd64 (163.75 KB, application/gzip)
2015-01-30 00:11 UTC, Don Lewis
no flags Details
Update patch with fix (13.61 KB, patch)
2015-04-01 16:02 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer freebsd_triage 2015-01-30 00:08:32 UTC
Created attachment 152360 [details]
script to run guild compile under truss

The finance/gnucash port defaults to using lang/guile, but that conflicts with one of the other ports that I use, which requires lang/guile2.  To avoid the conflict, I'm attempting to build gnucash with the GUILE2 option.  This appears to work on FreeBSD 10.1 amd64, but fails on FreeBSD 8.4 i386.

When building gnucash "guild compile" is executed a number of times, apparently successfully most of the time, even on FreeBSD 8.4, but it always fails on the same file on FreeBSD 8.4:

GNC_UNINSTALLED=yes \
GNC_BUILDDIR=../../.. \
GNC_MODULE_PATH="../../../src/app-utils/.libs:../../../src/engine/.libs:${GNC_MODULE_PATH}" GUILE_LOAD_PATH="../../../src/app-utils:../../../src/core-utils:../../../src/engine:../../../src/gnc-module:../../../src/gnome-utils:../../../src/scm:${GUILE_LOAD_PATH}" GUILE_LOAD_COMPILED_PATH="../../../src/app-utils:../../../src/core-utils:../../../src/engine:../../../src/gnc-module:../../../src/gnome-utils:../../../src/scm:${GUILE_LOAD_COMPILED_PATH}" LD_LIBRARY_PATH="../../../src/report/report-gnome/.libs:../../../src/report/report-system/.libs:../../../src/html/.libs:../../../src/backend/sql/.libs:../../../src/backend/xml/.libs:../../../src/gnome-utils/.libs:../../../src/gnc-module/.libs:../../../src/core-utils/.libs:../../../src/app-utils/.libs:../../../src/libqof/qof/.libs:../../../src/engine/.libs:${LD_LIBRARY_PATH}" DYLD_LIBRARY_PATH="../../../src/report/report-gnome/.libs:../../../src/report/report-system/.libs:../../../src/html/.libs:../../../src/backend/sql/.libs:../../../src/backend/xml/.libs:../../../src/gnome-utils/.libs:../../../src/gnc-module/.libs:../../../src/core-utils/.libs:../../../src/app-utils/.libs:../../../src/libqof/qof/.libs:../../../src/engine/.libs:${DYLD_LIBRARY_PATH}"  \
/usr/local/bin/guild compile -o report-gnome.go report-gnome.scm
* 09:03:34  WARN <qof.engine> [guid_init()] only got 5814 bytes.
The identifiers might not be very random.
Backtrace:
In /usr/local/bin/guild:
  74: 19 [main ("/usr/local/bin/guild" "compile" "-o" ...)]
In srfi/srfi-1.scm:
 619: 18 [for-each #<procedure 8455880 at scripts/compile.scm:179:14 (file)> #]
In scripts/compile.scm:
 182: 17 [#<procedure 8455880 at scripts/compile.scm:179:14 (file)> "report-gnome.scm"]
In system/base/target.scm:
  59: 16 [with-target "i386-portbld-freebsd8.4" ...]
In system/base/compile.scm:
 150: 15 [compile-file "report-gnome.scm" #:output-file ...]
  43: 14 [call-once #<procedure 84551a0 at system/base/compile.scm:56:5 ()>]
In ice-9/boot-9.scm:
 171: 13 [with-throw-handler #t ...]
In system/base/compile.scm:
  59: 12 [#<procedure 8455180 at system/base/compile.scm:58:9 ()>]
 153: 11 [#<procedure 84551c0 at system/base/compile.scm:151:8 (port)> #<closed: file 0>]
 216: 10 [read-and-compile #<input: report-gnome.scm 7> #:from ...]
 232: 9 [lp (# # # # ...) #<directory # 85d99d8> #<directory # 85d99d8>]
 180: 8 [lp (#<procedure compile-tree-il (x e opts)>) (cond-expand # #) ...]
In ice-9/boot-9.scm:
2401: 7 [save-module-excursion #<procedure 88d5b40 at language/scheme/compile-tree-il.scm:29:3 ()>]
In language/scheme/compile-tree-il.scm:
  31: 6 [#<procedure 88d5b40 at language/scheme/compile-tree-il.scm:29:3 ()>]
In ice-9/psyntax.scm:
1106: 5 [expand-top-sequence ((cond-expand (guile-2 #) (else))) () ...]
 989: 4 [scan ((cond-expand (guile-2 #) (else))) () ...]
 989: 3 [scan (#(syntax-object (eval-when # # ...) (#) ...)) () ...]
 279: 2 [scan (#) () (#) ...]
In unknown file:
   ?: 1 [load-extension "libgncmod-report-gnome" "scm_init_sw_report_gnome_module"]
In ice-9/boot-9.scm:
 106: 0 [#<procedure 8455160 at ice-9/boot-9.scm:97:6 (thrown-k . args)> misc-error ...]

ice-9/boot-9.scm:106:20: In procedure #<procedure 8455160 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
ice-9/boot-9.scm:106:20: In procedure dynamic-link: file: "libgncmod-report-gnome", message: "file not found"
Makefile:1144: recipe for target 'report-gnome.go' failed
gmake[5]: *** [report-gnome.go] Error 1


A search of the work directory shows that libgncmod-report-gnome.so is present.

If use truss to run guild, it shows that guild is successfully accessing libgncmod-report-gnome.so from the work directory several times, but later on tries to access it under /usr/local/lib/guile/2.0/extensions/, which fails.

I stated earlier that it "appears" to work correctly on FreeBSD 10, but when run under truss I see a large number of open() syscalls that have either empty strings as their path argument, or binary garbage, which suggests that there may be an internal memory corruption problem.

I have attached a compile script that sets up the environment properly and then runs guild under truss.  Since this was tested in a poudriere jail, it may be necessary to change the path to the gnucash work directory.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-01-30 00:08:32 UTC
Maintainers CC'd
Comment 2 Don Lewis freebsd_committer freebsd_triage 2015-01-30 00:10:39 UTC
Created attachment 152361 [details]
truss output from guild on FreeBSD 8.4 i386
Comment 3 Don Lewis freebsd_committer freebsd_triage 2015-01-30 00:11:35 UTC
Created attachment 152362 [details]
truss output from guild on FreeBSD 10.1 amd64
Comment 4 Guido Falsi freebsd_committer freebsd_triage 2015-04-01 16:02:29 UTC
Created attachment 155094 [details]
Update patch with fix

Hi,

While updating the port to version 2.6.6 I also experienced this failure and found a fix.

First I had to fix the file not found error, I added the path to the Makefile (new file files/patch-src_report_report-gnome_Makefile.in).

After that the port complained about GLIBC++ symbols, and I found bug 196078 (from same submitter), so I implemented the fix suggested there.

Please test the attached patch, which includes update to 2.6.6 and other fixes. It works fine for me.

I was given implicit commit rights on this port, so I'll commit it in a few days or just after positive feedback, whatever happens first

To bofh@FreeBSD.org, do you have any objection if I take this bug report as responsible?

Thanks all!
Comment 5 Don Lewis freebsd_committer freebsd_triage 2015-04-08 11:50:27 UTC
(In reply to Guido Falsi from comment #4)

Seems to be working for me.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-04-10 19:30:35 UTC
A commit references this bug:

Author: madpilot
Date: Fri Apr 10 19:30:16 UTC 2015
New revision: 383753
URL: https://svnweb.freebsd.org/changeset/ports/383753

Log:
  - Update to 2.6.6
  - Fix build when GUILE2 option is enabled
  - Rework compiler:c++11-lib definition to fix build problems

  PR:		196704 [2], 197189 [1]
  Submitted by:   Lawrence Chen <beastie@tardisi.com> [2]
  Submitted by:   Don Lewis <truckman@FreeBSD.org> [1]
  Approved by:    kwm (gnome, implicit)

Changes:
  head/finance/gnucash/Makefile
  head/finance/gnucash/distinfo
  head/finance/gnucash/files/patch-src_report_report-gnome_Makefile.in
  head/finance/gnucash/pkg-plist
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2015-04-10 19:31:15 UTC
Patch committed.