Bug when instantiating long list of compounds from consulted file

STREBELLE Alain <[email protected]> Tue, 3 Jun 2014 16:04:37 +0000
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <CFB3BF1B.2BFE9%[email protected]>
Hello everyone,

I just came to this bug.

Assume that I have a prolog file "fatal_error.pl", which contains

a(

[

b(c),

b(c),

b(c),

…

b(c)

]

).

If I consult the file

| ?- [fatal_error].

compiling /Dvlpt/trfmodels/fatal_error.pl for byte code...

/Dvlpt/trfmodels/fatal_error.pl compiled, 261 lines read - 26473 bytes written, 761 ms

(3 ms) yes

If there were less than 257 b(c) compound statements, I have no problem retrieving the knowledge:

| ?- a(R).

R = [b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c),b(c)]

Yes

If there are 257 b(c) compound statements or more, gprolog crashes:

GNU Prolog 1.4.4 (64 bits)

Compiled Jun 3 2014, 17:40:55 with gcc

By Daniel Diaz

Copyright (C) 1999-2013 Daniel Diaz

| ?- [fatal_error].

compiling /Dvlpt/trfmodels/fatal_error.pl for byte code...

/Dvlpt/trfmodels/fatal_error.pl compiled, 261 lines read - 26473 bytes written, 761 ms

(3 ms) yes

| ?- a(R).

cannot display cyclic term for R

(1 ms) yes

Fatal Error: Segmentation Violation (bad address: 0x803)

The same happens in 1.4.0, in 1.4.4 and the latest unstable version from 20140207.

Thank for looking at this, and thank you for an otherwise very good product that saves my life every day.

Alain Strebelle

Swift

Some details on my environment :

Hardware Overview:

Model Name: MacBook Pro

Model Identifier:
MacBookPro6,2

Processor Name:
Intel Core i5

Processor Speed:
2.53 GHz

Number Of Processors:
1

Total Number Of Cores:
2

L2 Cache (per core):
256 KB

L3 Cache: 3 MB

Memory: 4 GB

Processor Interconnect Speed:
4.8 GT/s

Boot ROM Version:
MBP61.0057.B0C

SMC Version (system):
1.58f17

Serial Number (system):
-------------

Hardware UUID:
------------------------------------

Sudden Motion Sensor:

State: Enabled

System Software Overview:

System Version:
Mac OS X 10.6.8 (10K549)

Kernel Version:
Darwin 10.8.0

Boot Volume: MBPI5HD

Boot Mode: Normal

Computer Name:
-----

User Name: ----------------------------

Secure Virtual Memory:
Enabled

64-bit Kernel and Extensions:
No

Time since boot:
7:55

_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog