Comments (7)
Cannot reproduce on macOS 13.4 using the latest git version (7adebe2):
$ GLOBALSZ=160154120 gprolog
GNU Prolog 1.6.0 (64 bits)
Compiled May 1 2023, 23:01:09 with /opt/local/bin/gcc-mp-12
Copyright (C) 1999-2023 Daniel Diaz
| ?-
from gprolog.
Linux 6.3.4
Glibc 2.37 (Stable, Feb 2023)
Git: commit 7adebe2
GCC 13.1.1
-------------------------------
--- GNU PROLOG INSTALLATION ---
-------------------------------
GNU Prolog version: 1.6.0 (Jun 2 2023)
Operating system : linux-gnu
Processor : x86_64
Size of a WAM word: 64 bits
C compiler : gcc
C flags : -O3 -fomit-frame-pointer -Wno-char-subscripts
C flags machine : -fno-strict-aliasing -fcommon
Assembler : as
Assembler flags : --64
Loader flags :
Loader libraries : -lm
Use line editor : Yes
Use piped consult : Yes
Use sockets : Yes
Use FD solver : Yes
Use machine regs. : Yes (4 used)
Used register(s) : r12 (pl_reg_bank) r13 (TR) r14 (B) r15 (H)
CLANG 16.0.1
-------------------------------
--- GNU PROLOG INSTALLATION ---
-------------------------------
GNU Prolog version: 1.6.0 (Jun 4 2023)
Operating system : linux-gnu
Processor : x86_64
Size of a WAM word: 64 bits
C compiler : clang
C flags : -O3 -fomit-frame-pointer -Wno-char-subscripts
C flags machine : -fno-strict-aliasing -fcommon
Assembler : as
Assembler flags : --64
Loader flags :
Loader libraries : -lm
Use line editor : Yes
Use piped consult : Yes
Use sockets : Yes
Use FD solver : Yes
Use machine regs. : Yes (0 used)
Used register(s) : none
Diff: clang does not use registers which means what?
Both:
$ GLOBALSZ=160154120 gprolog
Fatal Error: Memory allocation fault
from gprolog.
In contrast:
$ tar xf gprolog-1.5.0.tar.gz
$ cd gprolog-1.5.0/src
$ ./configure && make
-------------------------------
--- GNU PROLOG INSTALLATION ---
-------------------------------
GNU Prolog version: 1.5.0 (Jun 4 2023)
Operating system : linux-gnu
Processor : x86_64
Size of a WAM word: 64 bits
C compiler : gcc
C flags : -O3 -fomit-frame-pointer -Wno-char-subscripts
C flags machine : -fno-strict-aliasing -fcommon
Assembler : as
Assembler flags : --64
Loader flags :
Loader libraries : -lm
Use line editor : Yes
Use piped consult : Yes
Use sockets : Yes
Use FD solver : Yes
Use machine regs. : Yes (4 used)
Used register(s) : r12 (pl_reg_bank) r13 (TR) r14 (B) r15 (H)
$ cd TopComp
$ GLOBALSZ=160154120 ./gprolog
GNU Prolog 1.5.0 (64 bits)
Compiled Jun 4 2023, 17:37:10 with gcc
Copyright (C) 1999-2023 Daniel Diaz
| ?-
from gprolog.
The amount of memory you can use depends on your architecture (even with virtual memory): thus macos can be different from linux.
In 1.6.0, I have increased the default size of all stacks (but I don't believe this explain the memory fault).
Note that you are asking a lot of memory (size are in KB). 160154120 KB is around 150 GB !
Anyway, can you report the result of statistics/0
, once you have launched 1.5.0 with your GLOBASZ=160154120 ?
About global registers: clang does not allow to specify that a global variable resides in a processor register (gcc does allow it).
from gprolog.
$ GLOBALSZ=160154120 ./gprolog
GNU Prolog 1.5.0 (64 bits)
Compiled Jun 4 2023, 17:37:10 with gcc
Copyright (C) 1999-2023 Daniel Diaz
| ?- statistics.
Memory limit in use free
trail stack 16383 Kb 0 Kb 16383 Kb
cstr stack 16384 Kb 0 Kb 16384 Kb
global stack 770567 Kb 2 Kb 770565 Kb
local stack 16383 Kb 0 Kb 16383 Kb
atom table 32768 atoms 1770 atoms 30998 atoms
Times since start since last
user time 0.001 sec 0.001 sec
system time 0.001 sec 0.001 sec
cpu time 0.002 sec 0.002 sec
real time 11.664 sec 11.664 sec
yes
| ?-
from gprolog.
This was I suspected. 1.5.0 allocates much less memory than asked (a bug).
This works for me in 1.6.0 (on a 64GB RAM machine):
GLOBALSZ=129431888 gprolog --init-goal 'statistics,halt'
(around 123 GB)
from gprolog.
Excellent! It makes sense.
Thank you very much.
Btw this config triggers a warning:
$ ./configure --without-doc-dir --without-html-dir --disable-regs --with-c-flags=debug
$ make
:
:
gcc -fno-strict-aliasing -fcommon -c -g -Wall -Wno-char-subscripts -funsigned-char terminal.c
terminal.c: In function ‘Parse_Env_Var’:
terminal.c:279:3: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
279 | use_linedit = use_gui = use_ansi = true; /* default */
| ^~~~~~~~~~~
:
:
$
from gprolog.
Related Issues (20)
- Leak with simple arithmetics HOT 4
- Power not defined HOT 1
- Linking error riscv64
- Problem processing repeated calls HOT 3
- New show_information flag regression HOT 1
- Typo in Load_Math_Expression?
- Insure project web site
- GNU Prolog Parser accepts incomplete clause.
- hand written C code lacks some garbage collection.
- real_file_name does not follow symlinks on Windows HOT 1
- numbervars/3 silently refuses to number vars
- ensure_loaded/1 wants suddently predicate indicator HOT 1
- Ubuntu defaults so that GNU compile result is speedy HOT 1
- Incorrect answers when exceeding domains
- phrase/2 too eager execution HOT 1
- Feature request: format_time
- Ma2Asm for linux x64 with gcc is not generating PIC code (v1.5.0+)
- GNU Prolog crashes when reading long string literals
- GNU Prolog segmentation faults when using read_term/3 on a huge file
- formatting floats (adaptive 16 or 17 decimal precision)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gprolog.