> On Mar 16, 2017, at 6:34 PM, Joe Mistachkin <[email protected]> wrote:
> 
> 
> That's really odd.  I've run Tcl-enabled Fossil on multiple flavors of Linux, 
> both statically and dynamically linked to Tcl and never seen this crash or 
> failure.
> 
> It should be noted that simply using "fossil version --verbose" actually 
> loads and uses Tcl from TH1 (and that appears to work on your machine?).

If Fossil is statically linked, running "fossil version --verbose” crashes when 
it loads libtcl8.6.so.

If Fossil is dynamically linked, running "fossil version --verbose” runs find 
and shows that Tcl gets loaded. However, when I try to run a TH1 script that 
uses a command that requires Tcl integration (e.g. tclInvoke) I get the 
following error:

"TH_ERROR: no such command:  tclInvoke"

> 
> Sent from my iPhone
> https://urn.to/r/mistachkin
> 
>> On Mar 16, 2017, at 9:29 PM, Ryan Dingman <[email protected]> wrote:
>> 
>> I’m having trouble with Fossil and Tcl integration. At a high level, I have 
>> two main problems:
>> 
>> Problem 1. When I configure Fossil to build as a dynamically linked binary, 
>> the build succeeds and loads the Tcl library. However, when I run a TH1 
>> script that uses a command requiring Tcl integration (e.g. tclInvoke) it 
>> fails.
>> 
>> Problem 2. When I configure Fossil to build as a statically linked binary, 
>> the build either fails or the Fossil crashes when loading the Tcl library.
>> 
>> Here’s a summary of what I’ve tried on a machine running Ubuntu 16.04.
>> 
>> 1. I’ve successfully built Fossil with Tcl integration as a dynamically 
>> linked binary using:
>> 
>> ./configure --json --with-tcl --with-tcl-stubs --with-tcl-private-stubs
>> make
>> 
>> I can see that the Tcl library is getting loaded by running ‘fossil version 
>> -v’ and getting the following output:
>> 
>> **** Begin 'fossil version -v' output ****
>> This is fossil version 2.1 [4fa4c0218f] 2017-03-13 01:12:30 UTC
>> Compiled on Mar 16 2017 17:33:43 using clang-3.8.0 (tags/RELEASE_380/final) 
>> (64-bit)
>> Schema version 2015-01-24
>> zlib 1.2.8, loaded 1.2.8
>> hardened-SHA1 by Marc Stevens and Dan Shumow
>> SSL (OpenSSL 1.0.2g  1 Mar 2016)
>> TCL (Tcl 8.6.0, loaded TH_OK: 8.6.5)
>> USE_TCL_STUBS
>> FOSSIL_ENABLE_TCL_PRIVATE_STUBS
>> JSON (API 20120713)
>> UNICODE_COMMAND_LINE
>> FOSSIL_DYNAMIC_BUILD
>> SQLite 3.18.0 2017-03-10 17:03:11 f8560c60d1
>> SQLITE_ENABLE_DBSTAT_VTAB
>> SQLITE_ENABLE_FTS3
>> SQLITE_ENABLE_FTS3_PARENTHESIS
>> SQLITE_ENABLE_FTS4
>> SQLITE_ENABLE_FTS5
>> SQLITE_ENABLE_JSON1
>> SQLITE_LIKE_DOESNT_MATCH_BLOBS
>> SQLITE_OMIT_DECLTYPE
>> SQLITE_OMIT_DEPRECATED
>> SQLITE_OMIT_LOAD_EXTENSION
>> SQLITE_OMIT_PROGRESS_CALLBACK
>> SQLITE_OMIT_SHARED_CACHE
>> SQLITE_SYSTEM_MALLOC
>> SQLITE_THREADSAFE=0
>> SQLITE_USE_ALLOCA
>> **** End 'fossil version -v' output ****
>> 
>> However, when I try to test a TH1 script that uses a command that requires 
>> Tcl integration, it doesn’t work. For example, I tried this with the 
>> following:
>> 
>> fossil test-th-source -th-trace ~/test.th1 
>> Has TCL
>> TCL Not Ready
>> TH_ERROR: no such command:  tclInvoke
>> 
>> ------------------ BEGIN TRACE LOG ------------------
>> th1-init 0x0 => 0x0<br />
>> th1-setup {} => TH_OK<br />
>> [hasfeature tcl] => 1<br />
>> [tclReady] => 0<br />
>> 
>> ------------------- END TRACE LOG -------------------
>> 
>> I’ve included test.th1 in case I’m doing something wrong there. I’ve also 
>> tried the same script from the the Fossil UI page Admin -> TH1. I’ve 
>> verified that Tcl is enabled with 'fossil settings tcl’ which gives the 
>> following output:
>> 
>> **** Begin 'fossil settings tcl’ output ****
>> tcl                  (local)  1
>> tcl-setup           
>> **** End 'fossil settings tcl’ output ****
>> 
>> I’m not sure what I’m missing here. If anyone has guidance here, any help 
>> would be appreciated. I’m happy to provide any relevant information that I 
>> may be missing here.
>> 
>> 2. To build Fossil as a statically linked binary, I first tried just using 
>> the Tcl stubs that come with Fossil.
>> 
>> ./configure --static --json --with-tcl --with-tcl-stubs 
>> --with-tcl-private-stubs
>> 
>> After configuring Fossil in this way, the build succeeds. However, Fossil 
>> crashes when loading the Tcl library. For example, Fossil crashes when I run:
>> 
>> ./fossil version -v
>> Segmentation fault (core dumped)
>> 
>> I’ve attached a stack trace of the crash if that’s useful to anyone.
>> 
>> Next, I tried to build Tcl as a static library first and then build Fossil 
>> using that library. I configured and built Tcl 8.6.6 from source with:
>> 
>> ./configure --disable-shared
>> make
>> sudo make install
>> 
>> Then, configure and build Fossil with:
>> 
>> ./configure --static --json --with-tcl=/usr/local
>> make
>> 
>> The build fails during linking with the following error:
>> 
>> /usr/bin/ld: dynamic STT_GNU_IFUNC symbol `sin' with pointer equality in 
>> `/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/libm.a(s_sin.o)'
>>  can not be used when making an executable; recompile with -fPIE and relink 
>> with -pie
>> clang: error: linker command failed with exit code 1 (use -v to see 
>> invocation)
>> src/main.mk:591: recipe for target 'fossil' failed
>> make: *** [fossil] Error 1
>> 
>> Again, if any one has guidance on how to properly build Fossil with Tcl 
>> integration as a statically linked binary, any help would be appreciated.
>> 
>> Thanks,
>> 
>> Ryan
>> 
>> 
>> <fossil-crash.log>
>> <test.th1>
>> _______________________________________________
>> fossil-users mailing list
>> [email protected]
>> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
> 
> _______________________________________________
> fossil-users mailing list
> [email protected]
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to