Skip to content

stack overflow during consult/1 #329

@Jean-Luc-Picard-2021

Description

@Jean-Luc-Picard-2021

I don't know exactly where it happens, but it happens:

tests$ ~/go/bin/1pl
Top level for ichiban/prolog v1.2.1
This is for testing purposes only!
See https://github.com/ichiban/prolog for more details.
Type Ctrl-C or 'halt.' to exit.

?- ['suite.p'].
runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc05b402360 stack=[0xc05b402000, 0xc07b402000]
fatal error: stack overflow
runtime stack: runtime.throw({0x588e80?, 0xc0000bbe68?})
/usr/local/go/src/runtime/panic.go:1023 +0x5c fp=0xc0000bbe18 sp=0xc0000bbde8 pc=0x437a5c
runtime.newstack()
/usr/local/go/src/runtime/stack.go:1103 +0x5bd fp=0xc0000bbfc8 sp=0xc0000bbe18 pc=0x45305d
runtime.morestack()
/usr/local/go/src/runtime/asm_amd64.s:616 +0x7a fp=0xc0000bbfd0 sp=0xc0000bbfc8 pc=0x469b3a
goroutine 10 gp=0xc0001a2000 m=9 mp=0xc000081008 [running]:
runtime.deductAssistCredit(0x10?)
/usr/local/go/src/runtime/malloc.go:1337 +0x70 fp=0xc05b402370 sp=0xc05b402368 pc=0x40e3f0
runtime.mallocgc(0x10, 0x55dd60, 0x1)
/usr/local/go/src/runtime/malloc.go:1025 +0xcc fp=0xc05b4023f8 sp=0xc05b402370 pc=0x40db4c
runtime.newobject(0x0?)
/usr/local/go/src/runtime/malloc.go:1390 +0x25 fp=0xc05b402420 sp=0xc05b4023f8 pc=0x40e4c5
regexp.(*Regexp).replaceAll(0xc00010e1e0, {0x0, 0x0, 0x0}, {0xc0a616f104, 0x6}, 0x2, 0xc05b402548)
/usr/local/go/src/regexp/regexp.go:621 +0x76 fp=0xc05b402508 sp=0xc05b402420 pc=0x4cb0f6
regexp.(*Regexp).ReplaceAllStringFunc(0xc05b402a10?, {0xc0a616f104?, 0x4887ba?}, 0x69dac0?)
Etc...

Possibly it does loop somewhere? Or there is a memory leak,
like something gets allocated but not deallocated? Even worse
the memory leak is in some go system utility?

I don't know, the stack trace also shows Lexer and Parser,
I have only copied the first few lines.

The test folder was this one:

tests.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions