[CWB] Segmentation fault
Maarten Janssen
maartenpt at gmail.com
Fri May 1 16:42:04 CEST 2020
Hi Stefan,
Sorry for the delay in response, but I am trying this on quite a few Linux flavours atm, so my Debian installation was gone for a while. It is strange not many more people have this problem, since it is really just an out-of-the-box Debian 10 (buster) installation, fresh and clean, where I run the standard CWB install script; it works without a problem on other Debian flavours like Mint and Ubuntu, but on buster it gives this problem. Maybe I am doing something wrong, but like I said, it works like a charm on Ubuntu and Mint - so the idea behind it cannot be all bad. The only thing it runs is what it says on the website - here is the underlying Perl code of what the installer tries to do - which should be straightforward, but hence does not work on buster:
if ( $os eq 'debian' ) {
$cwbname = "cwb-3.0.0-osx-10.5-universal.tar";
$cwbpath = "https://sourceforge.net/projects/cwb/files/cwb/cwb-3.0.0/cwb-3.0.0-osx-10.5-universal.tar.gz/download";
} elsif ( $os eq 'solaris') {
$cwbname = "cwb-3.0.0-solaris-sparc";
$cwbpath = "https://sourceforge.net/projects/cwb/files/cwb/cwb-3.0.0/cwb-3.0.0-solaris-sparc.tar.gz/download";
} elsif ( !$Config{use64bitint} ) {
$cwbname = "cwb-3.0.0-linux-i386";
$cwbpath = "https://sourceforge.net/projects/cwb/files/cwb/cwb-3.0.0/cwb-3.0.0-linux-i386.tar.gz/download";
} else {
$cwbname = "cwb-3.0.0-linux-x86_64";
$cwbpath = "https://sourceforge.net/projects/cwb/files/cwb/cwb-3.0.0/cwb-3.0.0-linux-x86_64.tar.gz/download";
};
print "Attempting to install CWB - version $cwbname\n";
print "Downloading\n";
print `wget $cwbpath`;
print "Installing\n";
`tar -zxvf download`;
print `cd $cwbname ; sh install-cwb.sh`;
The “set h off” indeed solveds the problem with the (null), and you get the output you would expect; but still, only while running under valgrind; just running cqp (with any arguments) still gives a segmentation fault. Under valgrind it works, but it does throw a whole lot of warning, as pasted below (in TEITOK, the registry is stored in the project folder, hence the -r but that should not change anything). Any idea what I would have to do different to make this work under Debian 10?
Maarten
root at debian:/var/www/html/teitok/new# valgrind cqp -e -r cqp -D TT-DEFMIN
==3104== Memcheck, a memory error detector
==3104== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3104== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==3104== Command: cqp -e -r cqp -D TT-DEFMIN
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x490053: __linkin_atfork (in /usr/local/bin/cqp)
==3104== by 0x4660A2: ptmalloc_init (in /usr/local/bin/cqp)
==3104== by 0x46A313: malloc_hook_ini (in /usr/local/bin/cqp)
==3104== by 0x4C0BF2: _dl_init_paths (in /usr/local/bin/cqp)
==3104== by 0x49126A: _dl_non_dynamic_init (in /usr/local/bin/cqp)
==3104== by 0x491B22: __libc_init_first (in /usr/local/bin/cqp)
==3104== by 0x44F752: (below main) (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x4902DD: __strcpy_chk (in /usr/local/bin/cqp)
==3104== by 0x40D357: load_corpusnames (in /usr/local/bin/cqp)
==3104== by 0x40D4F7: check_available_corpora (in /usr/local/bin/cqp)
==3104== by 0x40154C: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x46C7ED: strcat (in /usr/local/bin/cqp)
==3104== by 0x40D221: load_corpusnames (in /usr/local/bin/cqp)
==3104== by 0x40D4F7: check_available_corpora (in /usr/local/bin/cqp)
==3104== by 0x40154C: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x46C8CD: strcat (in /usr/local/bin/cqp)
==3104== by 0x40D221: load_corpusnames (in /usr/local/bin/cqp)
==3104== by 0x40D4F7: check_available_corpora (in /usr/local/bin/cqp)
==3104== by 0x40154C: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x46C7ED: strcat (in /usr/local/bin/cqp)
==3104== by 0x40D24B: load_corpusnames (in /usr/local/bin/cqp)
==3104== by 0x40D4F7: check_available_corpora (in /usr/local/bin/cqp)
==3104== by 0x40154C: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x451E4C: __ctype_toupper_loc (in /usr/local/bin/cqp)
==3104== by 0x40D2AE: load_corpusnames (in /usr/local/bin/cqp)
==3104== by 0x40D4F7: check_available_corpora (in /usr/local/bin/cqp)
==3104== by 0x40154C: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x451E0C: __ctype_tolower_loc (in /usr/local/bin/cqp)
==3104== by 0x40C1FC: changecase_string (in /usr/local/bin/cqp)
==3104== by 0x40C8D4: GetSystemCorpus (in /usr/local/bin/cqp)
==3104== by 0x40D304: load_corpusnames (in /usr/local/bin/cqp)
==3104== by 0x40D4F7: check_available_corpora (in /usr/local/bin/cqp)
==3104== by 0x40154C: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x451E8C: __ctype_b_loc (in /usr/local/bin/cqp)
==3104== by 0x4335F3: component_full_name (in /usr/local/bin/cqp)
==3104== by 0x4334B4: declare_component (in /usr/local/bin/cqp)
==3104== by 0x4337EB: declare_default_components (in /usr/local/bin/cqp)
==3104== by 0x434454: cregparse (in /usr/local/bin/cqp)
==3104== by 0x431C08: setup_corpus (in /usr/local/bin/cqp)
==3104== by 0x40C8E2: GetSystemCorpus (in /usr/local/bin/cqp)
==3104== by 0x40D304: load_corpusnames (in /usr/local/bin/cqp)
==3104== by 0x40D4F7: check_available_corpora (in /usr/local/bin/cqp)
==3104== by 0x40154C: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x46C9DB: index (in /usr/local/bin/cqp)
==3104== by 0x40DD7D: findcorpus (in /usr/local/bin/cqp)
==3104== by 0x40E0AE: set_current_corpus_name (in /usr/local/bin/cqp)
==3104== by 0x401562: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
==3104== Conditional jump or move depends on uninitialised value(s)
==3104== at 0x46C9DB: index (in /usr/local/bin/cqp)
==3104== by 0x40DE64: findcorpus (in /usr/local/bin/cqp)
==3104== by 0x40E0AE: set_current_corpus_name (in /usr/local/bin/cqp)
==3104== by 0x401562: initialize_cqp (in /usr/local/bin/cqp)
==3104== by 0x400695: main (in /usr/local/bin/cqp)
==3104==
TT-DEFMIN>
> On 23 Apr 2020, at 10:49, Stefan Evert <stefanML at collocations.de> wrote:
>
>
>
>> On 22 Apr 2020, at 19:14, Maarten Janssen <maartenpt at gmail.com> wrote:
>>
>> I am trying to create a TEITOK installer that installs all the required dependencies automatically, but when testing system, I ran into this weird issue with issue with CWB: on Debian, when I run the standard install script of CWB, it gives me a segmentation fault; and when trying to pinpoint the problem, running it with valgrind avoids the problem altogether, and it happily starts cqp -e - but it somehow does give a very strange type of output on a simple [word=".*"]:
>>
>> 0: <(null)This(null)> is my first little TEITO
>> 1: This <(null)is(null)> my first little TEITOK c
>>
>> Did anybody see that problem before, and/or have any clue how to solve it
>
> Wild guess after a quick look at the source code: the (null) values are probably where CQP tries to emit terminal escapes for highlighting.
>
> If this is the case, then something must be wrong with your termcap library, especially if it also segfaults during compilation. CQP does check for NULL values and changes them to empty strings, so it's a bit mysterious how this would lead to a segfault.
>
> Quick test: in CQP enter
>
> set h off;
>
> before carrying out the search and see if you still get a segfault / NULL values. You can also run CQP in child mode (cqp -c), but keep in mind that autoshow is off then and you need to "cat;" after the query do display results.
>
> Best,
> Stefan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20200501/a7362895/attachment-0001.html>
More information about the CWB
mailing list