PerseusDL / morpheus

Morpheus parser
26 stars 24 forks source link

Libraries do not compile properly #18

Open christiancasey opened 5 years ago

christiancasey commented 5 years ago

After finally getting cruncher to compile properly after much difficulty (it does not work on all systems, despite what the docs say), I then tried to compile the libraries. It seems to work fine for nouns, but when it gets to verbs everything falls apart. Here is the error I'm seeing (on a late-2013 MBP with Mojave):

cat stemsrc/vbs.latin.bas stemsrc/vbs.latin.irreg stemsrc/vbs.latin stemsrc/vbs.irreg stemsrc/vbs.mpi | \
        perl -pe 's/([a-z])([aei])_v[ \t]+perfstem/$1\t$2vperf/g;' > \
        conjfile
cat: stemsrc/vbs.mpi: No such file or directory
do_conj -L
make: *** [stemind/vbind] Abort trap: 6
christiansmbp2:Latin christiancasey$ 

I believe the problem is that my system lacks something that it needs, but I can't seem to figure out what it is. It could also have something to do with my workaround for the problem with Flex (see my response to another issue for details). The error message: Abort trap: 6 is wildly unhelpful.

lutetiensis commented 2 years ago

The problem is here.

strcpy(stembuf,stembuf+4);

It seems strcpy() tries to access beyond stembuf, ie. that the string starting at stembuf+4 is longer than the stembuf buffer.

I fixed the problem by changing the call into a strncpy():

strncpy(stembuf,stembuf+4,sizeof(stembuf));

I created another ticket for the rest of your issue.