#564 Can't compile on Debian-sparc

build problems
open
Bruno Haible
clisp (525)
5
2010-08-27
2010-08-27
Chuchur Stomnev
No

When compiling with './configure --with-module=rawsock --cbc build-dir' The process terminates this way :

The make command ends with :

;; Loading file ../src/defseq.lisp ...
;; Loaded file ../src/defseq.lisp
;; Loading file ../src/backquote.lisp ...make: *** [interpreted.mem] Segmentation fault

After issuing a 'make install' it ends with :

;; Loading file /root/clisp-2.49/src/cmacros.lisp ...
;; Loaded file /root/clisp-2.49/src/cmacros.lisp
*** - READ from #<INPUT BUFFERED FILE-STREAM CHARACTER #P"/root/clisp-2.49/build-dir/compiler.fas" @>: illegal character #\Etb
Bye.
make: *** [halfcompiled.mem] Error 1

My machine is SunFire T1000 with Debian Lenny

# uname -a
Linux host 2.6.26-2-sparc64-smp #1 SMP Thu Aug 19 05:29:05 UTC 2010 sparc64 GNU/Linux

# cat /etc/debian-version
5.0.5

# gcc --version
gcc (Debian 4.3.2-1.1) 4.3.2

(I have also tried with gcc-3.4 but then other problems occur I don't get to the end of the compilation process)

Here is what gdb shows when I run lisp.run through it. (I omit some insignificant lines, please tell me if you need all the output)

# gdb ./lisp.run

(gdb) run -B . -N locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp ../src/ -x '(and (load "../src/init.lisp") (sys::%saveinitmem) (ext::exit)) (ext::exit t)'
Starting program: /root/clisp-2.49/build-dir/lisp.run -B . -N locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp ../src/ -x '(and (load "../src/init.lisp") (sys::%saveinitmem) (ext::exit)) (ext::exit t)'

Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010

Type :h and hit Enter for context help.

;; Loading file ../src/defseq.lisp ...
;; Loaded file ../src/defseq.lisp
;; Loading file ../src/backquote.lisp ...
Program received signal SIGSEGV, Segmentation fault.
gar_col_normal () at ../src/spvw_garcol.d:404
404 var object next_obj = *(gcv_object_t*)p;

(gdb)bt

#0 gar_col_normal () at ../src/spvw_garcol.d:404
#1 0x00036488 in do_gar_col_simple () at ../src/spvw_garcol.d:3007
#2 0x000e7cbc in with_gc_statistics (fun=0x3647c <do_gar_col_simple>) at ../src/predtype.d:3162
#3 0x00030b54 in allocate_cons () at ../src/spvw_garcol.d:3036
#4 0x0009a914 in read_delimited_list_recursive (stream_=0xf7a464e8, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2383
#5 0x0009adcc in read_delimited_list (stream_=0xf7a464e8, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#6 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#7 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#8 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a464cc) at ../src/io.d:1793
#9 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a464cc, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#10 0x0009adcc in read_delimited_list (stream_=0xf7a464cc, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#11 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#12 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#13 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a464b0) at ../src/io.d:1793
#14 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a464b0, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#15 0x0009adcc in read_delimited_list (stream_=0xf7a464b0, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#16 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#17 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#18 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a46494) at ../src/io.d:1793
#19 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a46494, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#20 0x0009adcc in read_delimited_list (stream_=0xf7a46494, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#21 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#22 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#23 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a46478) at ../src/io.d:1793
#24 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a46478, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#25 0x0009adcc in read_delimited_list (stream_=0xf7a46478, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#26 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#27 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#28 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a4645c) at ../src/io.d:1793
#29 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a4645c, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#30 0x0009adcc in read_delimited_list (stream_=0xf7a4645c, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#31 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#32 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#33 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a46440) at ../src/io.d:1793
#34 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a46440, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#35 0x0009adcc in read_delimited_list (stream_=0xf7a46440, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#36 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#37 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#38 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a4642c) at ../src/io.d:1793
#39 0x00097b10 in read_internal (stream_=0xf7a4642c) at ../src/io.d:1894
#40 0x00098338 in read_recursive_no_dot (stream_=0xf7a4642c) at ../src/io.d:2176
#41 0x000983b4 in list2_reader (stream_=0xf7a4642c) at ../src/io.d:2639
#42 0x0003b084 in funcall_subr (fun=0x1d28f2, args_on_stack=3) at ../src/eval.d:5227
#43 0x00092b38 in read_macro (ch=0x11a7, stream_=0xf7a46410) at ../src/io.d:1857
#44 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a46410, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#45 0x0009adcc in read_delimited_list (stream_=0xf7a46410, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#46 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#47 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#48 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a463f4) at ../src/io.d:1793
#49 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a463f4, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#50 0x0009adcc in read_delimited_list (stream_=0xf7a463f4, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#51 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#52 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#53 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a463d8) at ../src/io.d:1793
#54 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a463d8, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#55 0x0009adcc in read_delimited_list (stream_=0xf7a463d8, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#56 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#57 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#58 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a463bc) at ../src/io.d:1793
#59 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a463bc, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#60 0x0009adcc in read_delimited_list (stream_=0xf7a463bc, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#61 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#62 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#63 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a463a0) at ../src/io.d:1793
#64 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a463a0, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#65 0x0009adcc in read_delimited_list (stream_=0xf7a463a0, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2329
#66 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#67 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#68 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a46378) at ../src/io.d:1793
#69 0x0009aa9c in read_delimited_list_recursive (stream_=0xf7a46378, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2410
#70 0x0009ae74 in read_delimited_list (stream_=0xf7a46378, endch=0x14a7, ifdotted=0x686e86bf) at ../src/io.d:2332
#71 0x0009aed8 in C_lpar_reader () at ../src/io.d:2497
#72 0x0003b084 in funcall_subr (fun=0x1d2852, args_on_stack=2) at ../src/eval.d:5227
#73 0x000929ec in read_macro (ch=0x1427, stream_=0xf7a46320) at ../src/io.d:1793
#74 0x00097b10 in read_internal (stream_=0xf7a46320) at ../src/io.d:1894
#75 0x0009b3e4 in read_top (stream_=0xf7a46320, whitespace_p=0x1d8719) at ../src/io.d:2263
#76 0x0009b4c4 in read_w (whitespace_p=0x1d8719) at ../src/io.d:4444
#77 0x0003e1cc in eval1 (form=0x666d4e23) at ../src/eval.d:3592
#78 0x0003edec in eval (form=0x666d4e23) at ../src/eval.d:2966
#79 0x000537fc in C_let () at ../src/control.d:684
#80 0x0003dbf4 in eval1 (form=0x666d4e33) at ../src/eval.d:3263
#81 0x0003edec in eval (form=0x666d4e33) at ../src/eval.d:2966
#82 0x000505e8 in C_tagbody () at ../src/control.d:1645
#83 0x0003dbf4 in eval1 (form=0x666d4ecb) at ../src/eval.d:3263
#84 0x0003edec in eval (form=0x666d4ecb) at ../src/eval.d:2966
#85 0x000500e4 in C_unwind_protect () at ../src/control.d:1943
#86 0x0003dbf4 in eval1 (form=0x666d4ed3) at ../src/eval.d:3263
#87 0x0003edec in eval (form=0x666d4ed3) at ../src/eval.d:2966
#88 0x00050d64 in C_progv () at ../src/control.d:862
#89 0x0003dbf4 in eval1 (form=0x666d4fd3) at ../src/eval.d:3263
#90 0x0003edec in eval (form=0x666d4fd3) at ../src/eval.d:2966
#91 0x0005372c in C_letstar () at ../src/control.d:736
#92 0x0003dbf4 in eval1 (form=0x666d5263) at ../src/eval.d:3263
#93 0x0003edec in eval (form=0x666d5263) at ../src/eval.d:2966
#94 0x0003dbf4 in eval1 (form=0x666d5313) at ../src/eval.d:3263
#95 0x0003edec in eval (form=0x666d5313) at ../src/eval.d:2966
#96 0x0003f9dc in funcall_iclosure (closure=0x19c31d71, args_pointer=0xf7a460e4, argcount=0) at ../src/eval.d:2744
#97 0x000494a0 in eval_closure (closure=<value optimized out>) at ../src/eval.d:3935
#98 0x0003de48 in eval1 (form=0x666d17cb) at ../src/eval.d:3091
#99 0x0003edec in eval (form=0x666d17cb) at ../src/eval.d:2966
#100 0x0003ef54 in eval_5env (form=0x666d17cb, var_env=0x1d8719, fun_env=0x1d8719, block_env=0x1d8719, go_env=0x1d8719, decl_env=0x666f74cb) at ../src/eval.d:1087
#101 0x000dc3b4 in C_load () at ../src/debug.d:606
#102 0x0003e1cc in eval1 (form=0x666f7263) at ../src/eval.d:3592
#103 0x0003edec in eval (form=0x666f7263) at ../src/eval.d:2966
#104 0x0004d328 in C_and () at ../src/control.d:2479
#105 0x0003dbf4 in eval1 (form=0x666f726b) at ../src/eval.d:3263
#106 0x0003edec in eval (form=0x666f726b) at ../src/eval.d:2966
#107 0x000dd688 in C_read_eval_print () at ../src/debug.d:409
#108 0x0003b084 in funcall_subr (fun=0x1d1f12, args_on_stack=1) at ../src/eval.d:5227
#109 0x000dc910 in driver () at ../src/debug.d:490
#110 0x00037594 in main_actions (p=0x1e8038) at ../src/spvw.d:3632
#111 0x000383ec in main (argc=18, argv=0xffb517fc) at ../src/spvw.d:3885

Please tell me if you need some more informations.
Thank you for your time !
Best regards

Discussion

  • Sam Steingold
    Sam Steingold
    2010-08-27

    I think you need gcc 3. if you are an assembly expert, you might want to try to figure out what us being mis-compiled in io.d by gcc 4.
    see file unix/PLATFORMS (especially section "Hints for porting to new platforms")

     
  • Sam Steingold
    Sam Steingold
    2010-08-27

    btw, this is a 32-bit build, right? (try `file lisp.run`)
    did you build with libsigsegv & libffcall?

     
  • Hello

    Yes indeed this is a 32 bit version:
    # file lisp.run
    lisp.run: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped

    It is build with libsigsegv and libffcall :
    # ldd lisp.run
    libreadline.so.5 => /lib/libreadline.so.5 (0xf7ee0000)
    libncurses.so.5 => /lib/libncurses.so.5 (0xf7e9c000)
    libdl.so.2 => /lib/libdl.so.2 (0xf7e84000)
    -> libavcall.so.0 => /usr/lib/libavcall.so.0 (0xf7e70000)
    -> libcallback.so.0 => /usr/lib/libcallback.so.0 (0xf7e5c000)
    -> libsigsegv.so.0 => /usr/lib/libsigsegv.so.0 (0xf7e48000)
    libc.so.6 => /lib/libc.so.6 (0xf7cd4000)
    /lib/ld-linux.so.2 (0xf7f28000)

    When I build with gcc-3.4 here is the problem that occurs:

    # ./lisp.run -B . -N locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp ../src/ -x '(and (load "../src/init.lisp") (sys::%saveinitmem) (ext::exit)) (ext::exit t)'
    make: *** [interpreted.mem] Segmentation fault

    # gdb lisp.run
    ...
    This GDB was configured as "sparc-linux-gnu"...
    warning: not using untrusted file "/root/clisp-2.49/build-dir/.gdbinit"
    (gdb) run -B . -N locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp ../src/ -x '(and (load "../src/init.lisp") (sys::%saveinitmem) (ext::exit)) (ext::exit t)'
    Starting program: /root/clisp-2.49/build-dir/lisp.run -B . -N locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp ../src/ -x '(and (load "../src/init.lisp") (sys::%saveinitmem) (ext::exit)) (ext::exit t)'

    Program received signal SIGSEGV, Segmentation fault.
    gar_col_normal () at ../src/spvw_garcol.d:117
    117 objptr skipSTACKop 1; /* advance */
    (gdb) bt
    #0 gar_col_normal () at ../src/spvw_garcol.d:117
    #1 0x00029784 in do_gar_col_simple () at ../src/spvw_garcol.d:3007
    #2 0x000d14b4 in with_gc_statistics (fun=0x29778 <do_gar_col_simple>) at ../src/predtype.d:3165
    #3 0x00026618 in gar_col_simple () at ../src/spvw_garcol.d:3036
    #4 0x0002b96c in make_space_gc_true (need=40, heapptr=0x1d3f50) at ../src/spvw_allocate.d:282
    #5 0x0002cb80 in allocate_vector (len=7) at ../src/spvw_typealloc.d:107
    #6 0x0002ef40 in initmem () at ../src/subrkw.d:7
    #7 0x000349cc in main (argc=18, argv=0xffa41c94) at ../src/spvw.d:3270

    # $CC --version
    gcc-3.4 (GCC) 3.4.6 (Debian 3.4.6-9)

    Unfortunately I am not at all an assembly expert. Could I bring you more details about this problem ? I will try a 64bit to see if something changes.

    Best,

     
  • Sam Steingold
    Sam Steingold
    2010-08-30

    >> # ldd lisp.run
    >>-> libavcall.so.0 => /usr/lib/libavcall.so.0 (0xf7e70000)
    >>-> libcallback.so.0 => /usr/lib/libcallback.so.0 (0xf7e5c000)

    this is no good. this means that libffcall was built with --enable-shared which is wrong.
    please see http://cvs.savannah.gnu.org/viewvc/\*checkout*/ffcall/README?root=libffcall

     
  • Here is the error that I come to when compiling in 64bit mode :

    ./lisp.run -B . -N locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp ../src/ -x '(and (load "../src/init.lisp") (sys::%saveinitmem) (ext::exit)) (ext::exit t)'
    Cannot map memory to address 0x4000000000000 .
    [../src/spvw_mmap.d:347] errno = EINVAL: Invalid argument.
    ./lisp.run: Not enough memory for Lisp.
    make: *** [interpreted.mem] Error 1

    I will try to compile the ffcall lib in static. Any other ideas ?

    Thanks

     
  • When compilling in static it gives the same error :
    # export "CFLAGS=-static"
    # export "CC=gcc -ansi"
    # ./configure --with-module=rawsock --cbc build-dir
    ...
    ...
    socket.c:(.text+0x17c): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    ./lisp.run -B . -N locale -E UTF-8 -Epathname 1:1 -Emisc 1:1 -norc -m 2MW -lp ../src/ -x '(and (load "../src/init.lisp") (sys::%saveinitmem) (ext::exit)) (ext::exit t)'
    Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

    Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
    Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
    Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
    Copyright (c) Bruno Haible, Sam Steingold 1999-2000
    Copyright (c) Sam Steingold, Bruno Haible 2001-2010

    Type :h and hit Enter for context help.

    ;; Loading file ../src/defseq.lisp ...
    ;; Loaded file ../src/defseq.lisp
    ;; Loading file ../src/backquote.lisp ...make: *** [interpreted.mem] Segmentation fault

    # ldd build-dir/lisp.run
    not a dynamic executable

    # cd build-dir ; make install
    ...
    ...
    ;; Loading file /root/clisp-2.49/src/cmacros.lisp ...
    ;; Loaded file /root/clisp-2.49/src/cmacros.lisp
    *** - READ from #<INPUT BUFFERED FILE-STREAM CHARACTER #P"/root/clisp-2.49/build-dir/compiler.fas" @>: illegal character #\Etb
    Bye.
    make: *** [halfcompiled.mem] Error 1

    However if I run the executable file alone it seems to work (I don't remember whether I tried this in the dynamic version) :
    # ./lisp.run
    Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

    Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
    Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
    Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
    Copyright (c) Bruno Haible, Sam Steingold 1999-2000
    Copyright (c) Sam Steingold, Bruno Haible 2001-2010

    Type :h and hit Enter for context help.

    WARNING: No initialization file specified.
    Please try: ./lisp.run -M lispinit.mem

    WARNING: No installation directory specified.
    Please try: ./lisp.run -B /usr/local/lib/clisp
    > (cons 'a '(b c))
    (A B C)

    That's it for now, I hope this would give you some hints.
    Regards,

     
  • btw I am running linux on a sparc architecture and not solaris...

    I agree with you that most of the flavors are lost without the lispinit.mem.

    Will try to compile with clisp dynamic and libffcall static, but I don't think that this will change anything to the problem.

    Please let me know if I could bring you more information about the problem.

    Cheers