Skip to content

SIGSEGV when doing concat("a", "f") #105

@sixcorners

Description

@sixcorners

I don't really know what I'm doing. I'm using xq from ubuntu.

$ xq --version
xq version 0.0.0 (unknown, 000000)
$ echo | xq -x 'concat("a", "f")'
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x54e61e]

goroutine 6 [running]:
github.com/antchfx/xpath.(*functionQuery).Clone(0xc0000122b8)
	github.com/antchfx/xpath/query.go:611 +0x1e
github.com/antchfx/xpath.(*Expr).Select(...)
	github.com/antchfx/xpath/xpath.go:130
github.com/antchfx/xmlquery.QuerySelectorAll(0xc000036a00, 0xc00007ea60)
	github.com/antchfx/xmlquery/query.go:114 +0x85
github.com/antchfx/xmlquery.QueryAll(0xc000036a00, {0x7ffc0cbf9190?, 0x0?})
	github.com/antchfx/xmlquery/query.go:98 +0x4a
github.com/antchfx/xmlquery.Find(...)
	github.com/antchfx/xmlquery/query.go:74
github.com/sibprogrammer/xq/internal/utils.XPathQuery({0x8408e0?, 0xc00006a050?}, {0x8409a0, 0xc000092360}, {0x7ffc0cbf9190, 0x10}, 0x0)
	github.com/sibprogrammer/xq/internal/utils/utils.go:157 +0xff
github.com/sibprogrammer/xq/cmd.init.func1.1()
	github.com/sibprogrammer/xq/cmd/root.go:53 +0xa5
created by github.com/sibprogrammer/xq/cmd.init.func1 in goroutine 1
	github.com/sibprogrammer/xq/cmd/root.go:49 +0x2a7

This command reproduces it but I gave it real xml when I first found this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions