Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build breaks on i386: Abort trap #218

Closed
yurivict opened this issue Sep 7, 2022 · 7 comments
Closed

Build breaks on i386: Abort trap #218

yurivict opened this issue Sep 7, 2022 · 7 comments

Comments

@yurivict
Copy link
Contributor

yurivict commented Sep 7, 2022

eisl-2.62 breaks:

===>  Building for eisl-2.62
gmake[1]: Entering directory '/wrkdirs/usr/ports/lang/eisl/work/eisl-2.62'
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c main.c -o main.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c function.c -o function.o
function.c:837:48: warning: implicit conversion from 'long long' to 'double' changes value from -999999999999999999 to -1.0E+18 [-Wimplicit-const-int-float-conversion]
      else if (x <= 999999999999999999 && x >= -999999999999999999)
                                            ~~ ^~~~~~~~~~~~~~~~~~~
function.c:837:21: warning: implicit conversion from 'long long' to 'double' changes value from 999999999999999999 to 1.0E+18 [-Wimplicit-const-int-float-conversion]
      else if (x <= 999999999999999999 && x >= -999999999999999999)
                 ~~ ^~~~~~~~~~~~~~~~~~
function.c:4717:3: warning: function 'f_quit' declared 'noreturn' should not return [-Winvalid-noreturn]
  return -1;                    /* Shut up warning */
  ^
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c extension.c -o extension.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c syntax.c -o syntax.o
3 warnings generated.
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c data.c -o data.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c gbc.c -o gbc.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c cell.c -o cell.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c error.c -o error.o
error.c:608:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c bignum.c -o bignum.o
1 warning generated.
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c compute.c -o compute.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c edit.c -o edit.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c syn_highlight.c -o syn_highlight.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c long.c -o long.o
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c cii/src/except.c -o cii/src/except.o
cii/src/except.c:1:13: warning: unused variable 'rcsid' [-Wunused-variable]
static char rcsid[] = "$Id$" "\n$Id$";
            ^
1 warning generated.
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c cii/src/fmt.c -o cii/src/fmt.o
cii/src/fmt.c:23:23: warning: unused parameter 'code' [-Wunused-parameter]
static void cvt_s(int code, va_list_box *box,
                      ^
cii/src/fmt.c:31:23: warning: unused parameter 'code' [-Wunused-parameter]
static void cvt_d(int code, va_list_box *box,
                      ^
cii/src/fmt.c:52:23: warning: unused parameter 'code' [-Wunused-parameter]
static void cvt_u(int code, va_list_box *box,
                      ^
cii/src/fmt.c:64:23: warning: unused parameter 'code' [-Wunused-parameter]
static void cvt_o(int code, va_list_box *box,
                      ^
cii/src/fmt.c:76:23: warning: unused parameter 'code' [-Wunused-parameter]
static void cvt_x(int code, va_list_box *box,
                      ^
cii/src/fmt.c:88:23: warning: unused parameter 'code' [-Wunused-parameter]
static void cvt_p(int code, va_list_box *box,
                      ^
cii/src/fmt.c:101:23: warning: unused parameter 'code' [-Wunused-parameter]
static void cvt_c(int code, va_list_box *box,
                      ^
cii/src/fmt.c:103:40: warning: unused parameter 'precision' [-Wunused-parameter]
        unsigned char flags[], int width, int precision) {
                                              ^
cii/src/fmt.c:1:13: warning: unused variable 'rcsid' [-Wunused-variable]
static char rcsid[] = "$Id$";
            ^
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c cii/src/str.c -o cii/src/str.o
9 warnings generated.
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c cii/src/text.c -o cii/src/text.o
cii/src/str.c:273:18: warning: unused parameter 'code' [-Wunused-parameter]
void Str_fmt(int code, va_list_box *box,
                 ^
cii/src/str.c:1:13: warning: unused variable 'rcsid' [-Wunused-variable]
static char rcsid[] = "$Id$";
            ^
cii/src/text.c:38:35: warning: adding 'char' to a string pointer does not append to the string [-Wstring-plus-char]
const T Text_ucase  = {  26, cset + 'A' };
                             ~~~~~^~~~~
cii/src/text.c:38:35: note: use array indexing to silence this warning
const T Text_ucase  = {  26, cset + 'A' };
                                  ^
                             &    [    ]
cii/src/text.c:39:35: warning: adding 'char' to a string pointer does not append to the string [-Wstring-plus-char]
const T Text_lcase  = {  26, cset + 'a' };
                             ~~~~~^~~~~
cii/src/text.c:39:35: note: use array indexing to silence this warning
const T Text_lcase  = {  26, cset + 'a' };
                                  ^
                             &    [    ]
cii/src/text.c:40:35: warning: adding 'char' to a string pointer does not append to the string [-Wstring-plus-char]
const T Text_digits = {  10, cset + '0' };
                             ~~~~~^~~~~
cii/src/text.c:40:35: note: use array indexing to silence this warning
const T Text_digits = {  10, cset + '0' };
                                  ^
                             &    [    ]
cii/src/text.c:91:31: warning: unused parameter 'size' [-Wunused-parameter]
char *Text_get(char *str, int size, T s) {
                              ^
cii/src/text.c:168:13: warning: variable 'inited' set but not used [-Wunused-but-set-variable]
        static int inited = 0;
                   ^
cii/src/text.c:387:19: warning: unused parameter 'code' [-Wunused-parameter]
void Text_fmt(int code, va_list_box *box,
                  ^
cii/src/text.c:1:20: warning: unused variable 'rcsid' [-Wunused-variable]
static const char *rcsid = "$Id$";
                   ^
2 warnings generated.
7 warnings generated.
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c cii/src/mem.c -o cii/src/mem.o
cii/src/mem.c:36:38: warning: unused parameter 'file' [-Wunused-parameter]
void Mem_free(void *ptr, const char *file, int line) {
                                     ^
cii/src/mem.c:36:48: warning: unused parameter 'line' [-Wunused-parameter]
void Mem_free(void *ptr, const char *file, int line) {
                                               ^
cii/src/mem.c:1:13: warning: unused variable 'rcsid' [-Wunused-variable]
static char rcsid[] = "$Id$";
            ^
3 warnings generated.
cc  -lncursesw -Wl,-rpath=/usr/local/lib -fstack-protector-strong  -flto -s main.o function.o extension.o syntax.o data.o gbc.o cell.o error.o bignum.o compute.o edit.o syn_highlight.o long.o cii/src/except.o cii/src/fmt.o cii/src/str.o cii/src/text.o cii/src/mem.o -o eisl -lm -ldl -lncurses
gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/eisl/work/eisl-2.62'
===========================================================================
=======================<phase: run-depends    >============================
===>   eisl-2.62 depends on file: /usr/local/lib/libncurses.so.6 - found
===========================================================================
=======================<phase: stage          >============================
===>  Staging for eisl-2.62
===>   Generating temporary packing list
gmake[1]: Entering directory '/wrkdirs/usr/ports/lang/eisl/work/eisl-2.62'
cc -Icii/include -Wall -Wextra -D_FORTIFY_SOURCE=2  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -Inana/src -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -std=c17 -DSHAREDIR=/usr/local/share/eisl -c edlis.c
cc  -lncursesw -Wl,-rpath=/usr/local/lib -fstack-protector-strong  -flto -s edlis.o syn_highlight.o cii/src/except.o cii/src/fmt.o cii/src/str.o cii/src/text.o cii/src/mem.o -o edlis -lncurses
echo '(load "library/compiler.lsp") (compile-file "library/bit.lsp")' | ./eisl -r
Abort trap
gmake[1]: *** [makefile:130: library/bit.o] Error 134
gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/eisl/work/eisl-2.62'
*** Error code 2

Please also note that clang prints a lot of warnings, some of which might to be serious.

clang-14
FreeBSD 13.1

@sasagawa888
Copy link
Owner

I know nothing about FreeBSD. Mainly intended for use with RaspberryPI.

@poldy
Copy link
Contributor

poldy commented Sep 7, 2022

I have access to an OpenBSD machine where I was able to reproduce the compiler warnings (I usually use macOS), and logged a pull request.

Unfortunately I don't have access to any 32-bit x86 machines to reproduce the crash. You may have to try debug it yourself, I wrote up some hints in documents/DEBUG.md.

@yurivict
Copy link
Contributor Author

yurivict commented Sep 8, 2022

When I reproduce the problem on amd64 by cross-compiling to i386 I also get this:

echo '(load "library/compiler.lsp") (compile-file "library/bit.lsp")' | ./eisl -r
Data segment size exceeds process limit
Abort trap

Do you know why would the data segment exceed the limit? Is it explicitly specified somewhere?

@poldy
Copy link
Contributor

poldy commented Sep 8, 2022

(Sorry if you already know this.) UNIX processes can have various limits. You should be able to see them using the ulimit builtin in your shell, e.g. ulimit -a to print them all. On my system interesting limits are "data seg size", "max memory size", and "virtual memory", which are all unlimited for me.

The other possibility is that we're just exceeding a 32-bit address space. I put the following line at the start of main.c because I think these are the biggest data structures:

printf("bigcell %lu heap %lu\n", sizeof(bigcell), sizeof(heap));

On my system it showed heap is 720 Mb and bigcell is 80. This should fit comfortably in 4 Gb. So I think it's your process limits.

@yurivict
Copy link
Contributor Author

yurivict commented Sep 8, 2022

On FreeBSD i386 processes have default RLIMIT_DATA=536,870,912 which probably explains the problem.

@poldy
Copy link
Contributor

poldy commented Sep 8, 2022

Ah, in that case you should be able to override the limit from your shell before starting eisl (or running make, the limits apply to all subprocesses). Something like ulimit -d <new limit>.

@yurivict
Copy link
Contributor Author

yurivict commented Sep 8, 2022

Ok, thank you for your help!

@yurivict yurivict closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants