users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: seg violation compiling gprolog under x86 mandrake 8.1


From: Daniel Diaz
Subject: Re: seg violation compiling gprolog under x86 mandrake 8.1
Date: Tue, 04 Dec 2001 09:14:55 +0100

Erick

Thank you for your bug report (thats a bug :-)). Fixed in 1.2.9. It is due to 
the fact that
EnginePl/engine1.c is compiled with optimizations (while it should not else gcc 
remove a register
initialization that seems useless for it...).

To fix it, modify EnginePl/Makefile.in (around line 88)

the entry

address@hidden@: engine1.c

becomes

address@hidden@: engine1.c
        $(GPLC) -c engine1.c

then (in src) make clean; ./configure --disable-regs; make; make install


Erick Alphonse wrote:
> 
> Hello,
> 
> Using the following compiler:
> gcc-2.96-0.62mdk
> 
> I got a segmentation violation, compiling this way (the trace follows):
> $./configure --disable-regs ; make; make install
> 
> trying without --disable-regs works, even if I still get the error:
> cp pl2wam pl2wam0
> cp: cannot stat `pl2wam': No such file or directory
> 
> the compilation succeeds.
> 
> More generally, do you think there could be a problem with gcc-2.96 and
> gplc? because, after compiling with success gplc, my program reaches
> either a seg fault or an illegal instruction.
> 
> thank you to tell me if you experienced such a problem,
> Regards,
> Erick.
> 
> -----------------------------------------------------------
> 
> ./configure --cache-file=/dev/null --disable-regs
> loading cache /dev/null
> ./configure: .: /dev/null: not a regular file
> checking for gcc... gcc
> checking whether the C compiler (gcc  ) works... yes
> checking whether the C compiler (gcc  ) is a cross-compiler... no
> checking whether we are using GNU C... yes
> checking whether gcc accepts -g... yes
> checking for ranlib... ranlib
> checking for Cygwin environment... no
> checking for mingw32 environment... no
> checking for executable suffix... no
> checking whether make sets ${MAKE}... yes
> checking for a BSD compatible install... /usr/bin/install -c
> checking whether ln -s works... yes
> checking host system type... i686-pc-linux-gnu
> checking size of long... 4
> checking how to run the C preprocessor... gcc -E
> checking for sys/ioctl_compat.h... no
> checking for termios.h... yes
> checking for malloc.h... yes
> checking for unistd.h... yes
> checking for getpagesize... yes
> checking for working mmap... yes
> checking for mallopt... yes
> checking for mkstemp... yes
> checking for inline... inline
> use ebp and move -fomit-frame-pointer to CFLAGS_MACHINE
> checking for socket... yes
> checking for gethostbyname... yes
> DIRECTORIES
> --> Installation:       /usr/local/gprolog-1.2.8
> --> Link to binaries:   /usr/local/bin
> --> Documentation:      /usr/local/gprolog-1.2.8/doc
> --> HTML documentation: /usr/local/gprolog-1.2.8/doc/Html
> --> Examples:           /usr/local/gprolog-1.2.8
> updating cache /dev/null
> creating ./config.status
> creating Makefile
> creating TopComp/Makefile
> creating Pl2Wam/Makefile
> creating Wam2Ma/Makefile
> creating Ma2Asm/Makefile
> creating Fd2C/Makefile
> creating Linedit/Makefile
> creating W32GUICons/Makefile
> creating EnginePl/Makefile
> creating BipsPl/Makefile
> creating EngineFD/Makefile
> creating BipsFD/Makefile
> creating Ma2Asm/FromC/Makefile
> creating EnginePl/gp_config.h
> 
> --------------------------------
> 
> 424# make
> (cd EnginePl; make config)
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/EnginePl'
> gcc -O3   -o pl_config pl_config.c
> ./pl_config
> 
>         -------------------------------
>         --- GNU PROLOG INSTALLATION ---
>         -------------------------------
> 
> GNU Prolog version: 1.2.8 (Oct 8 2001)
> Operating system  : linux-gnu
> Processor         : i686
> Size of a word    : 32 bits
> C compiler        : gcc
> C flags           : -O3
> C flags machine   : -mpentiumpro -fomit-frame-pointer
> Loader flags      :
> Loader libraries  : -lm
> Use line editor   : Yes
> Use sockets       : Yes
> Use FD solver     : Yes
> Use machine regs. : No
> Use fast call     : Yes
> 
>         ------------------------------
> 
> (cd ../TopComp; make gplc)
> make[2]: Entering directory `/usr/local/src/gprolog-1.2.8/src/TopComp'
> gcc -O3  -o gplc top_comp.c
> make[2]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/TopComp'
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/EnginePl'
> . ./SETVARS;for i in TopComp EnginePl Wam2Ma Ma2Asm Linedit BipsPl
> Pl2Wam Fd2C EngineFD BipsFD;do (cd $i; make) || exit 1; done;\
> (cd TopComp; make gprolog)
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/TopComp'
> gcc -O3  -o hexgplc hexfilter.c
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/TopComp'
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/EnginePl'
> gcc -O3   -o cpp_headers cpp_headers.c
> D=`(cd ..;for i in *;do test -d $i && X="$X
> /usr/local/src/gprolog-1.2.8/src/$i";done;echo $X)`; ./cpp_headers
> headers.h gprolog.h $D
> gplc -c -C '-O3 ' obj_begin.c
> gplc -c -C '-O3 ' obj_end.c
> gplc -c -C '-O3 ' machine.c
> gplc -c -C '-O3 ' machine1.c
> gplc -c -C '-O3 ' mem_alloc.c
> gplc -c -C '-O3 ' misc.c
> gplc -c -C '-O3 ' hash.c
> gplc -c -C '-O3 ' obj_chain.c
> gplc -c -C '-O3 ' engine.c
> gplc -c -C '-O3 ' engine1.c
> gplc -c -C '-O3 ' wam_inst.c
> gplc -c -C '-O3 ' atom.c
> gplc -c -C '-O3 ' pred.c
> gplc -c -C '-O3 ' oper.c
> gplc -c -C '-O3 ' if_no_fd.c
> gplc -c -C '-O3 ' main.c
> rm -f libengine_pl.a
> ar rc  libengine_pl.a machine.o machine1.o mem_alloc.o misc.o hash.o
> obj_chain.o engine.o engine1.o wam_inst.o atom.o pred.o oper.o
> if_no_fd.o main.o
> ranlib libengine_pl.a
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/EnginePl'
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/Wam2Ma'
> gcc -O3  -c wam2ma.c
> gcc -O3  -c wam_parser.c
> gcc -O3  -o wam2ma wam2ma.o wam_parser.o
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/Wam2Ma'
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/Ma2Asm'
> gcc -O3  -c ma2asm.c
> gcc -O3  -c ma_parser.c
> gcc -O3  -c ma2asm_inst.c
> gcc -O3  -o ma2asm ma2asm.o ma2asm_inst.o ma_parser.o
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/Ma2Asm'
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/Linedit'
> gcc -c -mpentiumpro -fomit-frame-pointer -O3  linedit.c
> gcc -c -mpentiumpro -fomit-frame-pointer -O3  stty.c
> gcc -c -mpentiumpro -fomit-frame-pointer -O3  char_io.c
> rm -f liblinedit.a
> ar rc  liblinedit.a linedit.o stty.o char_io.o
> ranlib liblinedit.a
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/Linedit'
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/BipsPl'
> gplc -c -C '-O3  -funsigned-char' error_supp.c
> gplc -c -C '-O3  -funsigned-char' c_supp.c
> gplc -c -C '-O3  -funsigned-char' foreign_supp.c
> gplc -c -C '-O3  -funsigned-char' pred_supp.c
> gplc -c -C '-O3  -funsigned-char' term_supp.c
> gplc -c -C '-O3  -funsigned-char' stream_supp.c
> gplc -c -C '-O3  -funsigned-char' scan_supp.c
> gplc -c -C '-O3  -funsigned-char' parse_supp.c
> gplc -c -C '-O3  -funsigned-char' write_supp.c
> gplc -c -C '-O3  -funsigned-char' dynam_supp.c
> gplc -c -C '-O3  -funsigned-char' callinf_supp.c
> gplc -c -C '-O3  -funsigned-char' bc_supp.c
> gplc -c foreign.wam
> gplc -c pl_error.wam
> gplc -c utils.wam
> gplc -c unify.wam
> gplc -c assert.wam
> gplc -c -C '-O3  -funsigned-char' assert_c.c
> gplc -c read.wam
> gplc -c -C '-O3  -funsigned-char' read_c.c
> gplc -c write.wam
> gplc -c -C '-O3  -funsigned-char' write_c.c
> gplc -c print.wam
> gplc -c const_io.wam
> gplc -c -C '-O3  -funsigned-char' const_io_c.c
> gplc -c oper.wam
> gplc -c -C '-O3  -funsigned-char' oper_c.c
> gplc -c pred.wam
> gplc -c -C '-O3  -funsigned-char' pred_c.c
> gplc -c atom.wam
> gplc -c -C '-O3  -funsigned-char' atom_c.c
> gplc -c control.wam
> gplc -c -C '-O3  -funsigned-char' control_c.c
> gplc -c call.wam
> gplc -c call_args.wam
> gplc -c -C '-O3  -funsigned-char' call_args_c.c
> gplc -c catch.wam
> gplc -c throw.wam
> gplc -c -C '-O3  -funsigned-char' throw_c.c
> gplc -c flag.wam
> gplc -c -C '-O3  -funsigned-char' flag_c.c
> gplc -c arith_inl.wam
> gplc -c -C '-O3  -funsigned-char' arith_inl_c.c
> gplc -c type_inl.wam
> gplc -c -C '-O3  -funsigned-char' type_inl_c.c
> gplc -c term_inl.wam
> gplc -c -C '-O3  -funsigned-char' term_inl_c.c
> gplc -c g_var_inl.wam
> gplc -c -C '-O3  -funsigned-char' g_var_inl_c.c
> gplc -c all_solut.wam
> gplc -c -C '-O3  -funsigned-char' all_solut_c.c
> gplc -c sort.wam
> gplc -c -C '-O3  -funsigned-char' sort_c.c
> gplc -c list.wam
> gplc -c stat.wam
> gplc -c -C '-O3  -funsigned-char' stat_c.c
> gplc -c stream.wam
> gplc -c -C '-O3  -funsigned-char' stream_c.c
> gplc -c file.wam
> gplc -c -C '-O3  -funsigned-char' file_c.c
> gplc -c char_io.wam
> gplc -c -C '-O3  -funsigned-char' char_io_c.c
> gplc -c dec10io.wam
> gplc -c format.wam
> gplc -c -C '-O3  -funsigned-char' format_c.c
> gplc -c os_interf.wam
> gplc -c -C '-O3  -funsigned-char' os_interf_c.c
> gplc -c expand.wam
> gplc -c -C '-O3  -funsigned-char' expand_c.c
> gplc -c consult.wam
> gplc -c -C '-O3  -funsigned-char' consult_c.c
> gplc -c pretty.wam
> gplc -c -C '-O3  -funsigned-char' pretty_c.c
> gplc -c random.wam
> gplc -c -C '-O3  -funsigned-char' random_c.c
> gplc -c top_level.wam
> gplc -c -C '-O3  -funsigned-char' top_level_c.c
> gplc -c debugger.wam
> gplc -c -C '-O3  -funsigned-char' debugger_c.c
> gplc -c all_pl_bips.wam
> gplc -c sockets.wam
> gplc -c -C '-O3  -funsigned-char' sockets_c.c
> gplc -c le_interf.wam
> gplc -c -C '-O3  -funsigned-char' le_interf_c.c
> rm -f libbips_pl.a
> ar rc  libbips_pl.a error_supp.o c_supp.o foreign_supp.o pred_supp.o
> term_supp.o stream_supp.o scan_supp.o parse_supp.o write_supp.o
> dynam_supp.o callinf_supp.o bc_supp.o foreign.o pl_error.o utils.o
> unify.o assert.o assert_c.o read.o read_c.o write.o write_c.o print.o
> const_io.o const_io_c.o oper.o oper_c.o pred.o pred_c.o atom.o atom_c.o
> control.o control_c.o call.o call_args.o call_args_c.o catch.o throw.o
> throw_c.o flag.o flag_c.o arith_inl.o arith_inl_c.o type_inl.o
> type_inl_c.o term_inl.o term_inl_c.o g_var_inl.o g_var_inl_c.o
> all_solut.o all_solut_c.o sort.o sort_c.o list.o stat.o stat_c.o
> stream.o stream_c.o file.o file_c.o char_io.o char_io_c.o dec10io.o
> format.o format_c.o os_interf.o os_interf_c.o expand.o expand_c.o
> consult.o
> consult_c.o pretty.o pretty_c.o random.o random_c.o top_level.o
> top_level_c.o debugger.o debugger_c.o all_pl_bips.o sockets.o
> sockets_c.o le_interf.o le_interf_c.o
> ranlib libbips_pl.a
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/BipsPl'
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/Pl2Wam'
> gplc -c pl2wam.wam
> gplc -c read_file.wam
> gplc -c bip_list.wam
> gplc -c syn_sugar.wam
> gplc -c internal.wam
> gplc -c code_gen.wam
> gplc -c reg_alloc.wam
> gplc -c inst_codif.wam
> gplc -c first_arg.wam
> gplc -c indexing.wam
> gplc -c wam_emit.wam
> cp pl2wam pl2wam0
> cp: cannot stat `pl2wam': No such file or directory
> make[1]: [pl2wam] Error 1 (ignored)
> gplc -o pl2wam --no-fd-lib --min-bips pl2wam.o read_file.o bip_list.o
> syn_sugar.o internal.o code_gen.o reg_alloc.o inst_codif.o first_arg.o
> indexing.o wam_emit.o
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/Pl2Wam'
> make[1]: Entering directory `/usr/local/src/gprolog-1.2.8/src/Fd2C'
> gplc -c --fast-math fd2c.pl
> 
> Fatal Error: Segmentation Violation
> compilation failed
> make[1]: *** [fd2c.o] Error 1
> make[1]: Leaving directory `/usr/local/src/gprolog-1.2.8/src/Fd2C'
> make: *** [all] Error 1
> 
> _______________________________________________
> Users-prolog mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/users-prolog

-- 
Daniel Diaz   address@hidden
http://pauillac.inria.fr/~diaz
gprolog --version 2>&1 | sed -n -e 's/By //p'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]