Skip to content

panic when creating a list using bool or NA values #26

@APILLSBURY

Description

@APILLSBURY

When sending a command to create a list I'm getting a panic: runtime error: index out of range with certain combinations of values. What I've observed is the following.

  1. Creating a list of strings, ints, and floats in any combination works.
    Ex: list(int=1,string='s',float=0.5)

  2. If the list has a bool or NA as the last value, the correct result is returned but there is a Warning: Error whilst constructing vector: Abruptly reached end of buffer outputted.
    Ex: list(int=1,string='s',float=0.5,bool=TRUE)
    Ex: list(var=NA)

  3. If the list contains a bool or NA value with anything else following it, a panic happens.
    Ex: list(int=1,string='s',float=0.5,bool=TRUE,anything='this causes a panic')
    Ex: list(var1=NA,var2=1)

Here is the full stack trace for the panic:

panic: runtime error: index out of range

goroutine 1 [running]:
roger/sexp.getLength(0xc820431484, 0x38, 0x38, 0x29, 0x1, 0x420460, 0x0, 0x0)
    roger/sexp/factory.go:25 +0x12f
roger/sexp.parseReturningOffset(0xc820431484, 0x38, 0x38, 0x29, 0x0, 0x0, 0x0, 0x0, 0x0)
    roger/sexp/factory.go:35 +0xa0
roger/sexp.parseVector(0x437840, 0xc820436960, 0xc820431484, 0x38, 0x38, 0x29, 0x38, 0x0, 0x0, 0x0, ...)
    roger/sexp/xt-vector.go:37 +0xba
roger/sexp.parseReturningOffset(0xc820431484, 0x38, 0x38, 0x20, 0x0, 0x0, 0x8591d, 0x0, 0x0)
    roger/sexp/factory.go:80 +0x752
roger/sexp.Parse(0xc820431484, 0x38, 0x38, 0x0, 0x0, 0x0, 0x0, 0x0)
    roger/sexp/factory.go:13 +0x61
roger.(*packet).GetResultObject(0xc820436930, 0x0, 0x0, 0x0, 0x0)
    roger/packet.go:77 +0x31e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions