runtime error: additional frames elided...

216 views
Skip to first unread message

DrGo

unread,
Oct 28, 2015, 10:30:42 PM10/28/15
to golang-nuts
can someone help me find out why I have been getting the following error

[similar output deleted]
main.printAll(0xc0826a4000, 0x283d, 0x30d7)
        D:/SW/Code/Go/src/github.com/DrGo/CCV/v1/main.go:53 +0xe1 fp=0xc0a2481888 sp=0xc0a2481680
main.printAll(0xc0826a4000, 0x283d, 0x30d7)
        D:/SW/Code/Go/src/github.com/DrGo/CCV/v1/main.go:53 +0xe1 fp=0xc0a2481a90 sp=0xc0a2481888
main.printAll(0xc0826a4000, 0x283d, 0x30d7)
        D:/SW/Code/Go/src/github.com/DrGo/CCV/v1/main.go:53 +0xe1 fp=0xc0a2481c98 sp=0xc0a2481a90
...additional frames elided...


the line that generate the error is a 
printAll(n.nodes...)

printAll is recursive, defined as

func printAll(nodes ...Node) {
for _, n := range nodes {
if len(n.nodes) > 0 {
printAll(n.nodes...)
} else {
fmt.Fprintf(os.Stderr, "text: %v\n", n.attr)
}
}
}


n is of type Node 

type Node struct {
text string
nodes []Node
....
}

is populated correctly eg when I fmt.Printf it I can all the nodes[] eg

"
Grant2013/62018/4Support for People and Patient-Orientation Research and Trials (SUPPORT) UnitsOperatingAwardedCo-investigatorCanadian Institutes of Health Research (CIHR)SPOR11000000Canadian dollarYes2013/62018/4
Ahmed Abou-SettaCo-investigator
Alanna HinrichsenCo-investigator
Colleen MetgeCo-investigator
Depeng JiangCo-investigator
Eric BohmCo-investigator
Frank KrupkaCo-investigator
Kristy WittmeierCo-investigator
Lisa LixCo-investigator
Ryan ZarychanskiCo-investigator
Terry KlassenPrincipal Investigator
"


Thanks,

Jesse McNelis

unread,
Oct 28, 2015, 11:00:03 PM10/28/15
to DrGo, golang-nuts
On Thu, Oct 29, 2015 at 1:30 PM, DrGo <salah....@gmail.com> wrote:
> can someone help me find out why I have been getting the following error
>
> [similar output deleted]
> main.printAll(0xc0826a4000, 0x283d, 0x30d7)
> D:/SW/Code/Go/src/github.com/DrGo/CCV/v1/main.go:53 +0xe1
> fp=0xc0a2481888 sp=0xc0a2481680
> main.printAll(0xc0826a4000, 0x283d, 0x30d7)
> D:/SW/Code/Go/src/github.com/DrGo/CCV/v1/main.go:53 +0xe1
> fp=0xc0a2481a90 sp=0xc0a2481888
> main.printAll(0xc0826a4000, 0x283d, 0x30d7)
> D:/SW/Code/Go/src/github.com/DrGo/CCV/v1/main.go:53 +0xe1
> fp=0xc0a2481c98 sp=0xc0a2481a90
> ...additional frames elided...
>


Looks like infinite recursion. The data structure you're recursing
over has a loop.
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
=====================
http://jessta.id.au
Reply all
Reply to author
Forward
0 new messages