[mercury-users] segmentation violation with wrong syntax sources
Jean-Marc Vanel
jeanmarc.vanel at gmail.com
Tue Jun 29 00:47:54 AEST 2010
Hi
I tried to run the pasted and corrected version of the cryptarithm example
from the tutorial (cf my preceding post) .
Alas, I couln't, as I met a segmentation violation.
So I tried to write a small example showing the same problem. Here it is :
:- module crypt_crash3.
:- interface.
:- pred main is det.
:- implementation.
main :-
CAT = 100 * C % segmentation violation <<<<<<<<<<<<
% CAT = C % OK ! warning: unresolved polymorphism. The variables with
unbound types were: C: V_1 CAT: V_1
.
Here is the result of compiling this :
/usr/local/mercury-10.04-beta-2010-06-24/bin/mmc --make crypt_crash3
*** Mercury runtime: caught segmentation violation ***
cause: address not mapped to object
address involved: 0x9994f80
This may have been caused by a stack overflow, due to unbounded recursion.
exiting from signal handler
zsh: segmentation fault /usr/local/mercury-10.04-beta-2010-06-24/bin/mmc
--make crypt_crash3
It is hard to learn Mercury if the compiler does not flag syntax errors
correctly !
I put my version of crypt.m that looks good but however makes a segmentation
violation here :
http://jmvanel.free.fr/tmp/crypt.m
I'm running Ubuntu 10.4 .
uname -a
Linux jmv-desktop 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:28:05 UTC
2010 x86_64 GNU/Linux
with either
mercury-compiler-10.04-beta-2010-06-24
or
mercury-rotd-2010-06-23
Note that I couldn't install the stable version 13.1.
% make
....
mmc --generate-dependencies --grade hlc.gc --mercury-linkage shared --flags
LIB_FLAGS --flags INTER_FLAGS --no-warn-nothing-exported mer_std
*** Mercury runtime: caught segmentation violation ***
cause: bad permissions for mapped object
address involved: 0xa588f0
This may have been caused by a stack overflow, due to unbounded recursion.
exiting from signal handler
make[2]: *** [mer_std.depend] Erreur 1
make[2]: quittant le répertoire <<
/home/jmv/src/mercury-compiler-0.13.1/tmp_dir/library >>
To clean up from failed install, remove tmp_dir
make[1]: *** [install_grades] Erreur 1
make[1]: quittant le répertoire << /home/jmv/src/mercury-compiler-0.13.1 >>
make: *** [install] Erreur 2
--
Jean-Marc Vanel
Consulting, services, training,
Rule-based programming, Semantic Web
http://jmvanel.free.fr/
EulerGUI, a turntable GUI for Semantic Web + rules, XML, UML, eCore, Java
bytecode
+33 (0)6 89 16 29 52 -- +33 (0)1 39 55 58 16
( we rarely listen to voice messages, please send a mail instead )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20100628/1e5d4a9d/attachment.html>
More information about the users
mailing list