Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash by ACOS #7046

Closed
suyZhong opened this issue Nov 23, 2023 · 0 comments · Fixed by dolthub/go-mysql-server#2160
Closed

Crash by ACOS #7046

suyZhong opened this issue Nov 23, 2023 · 0 comments · Fixed by dolthub/go-mysql-server#2160

Comments

@suyZhong
Copy link

The following test case crashed go-mysql-server.

SELECT 1 % ACOS(-2);

Here's my error trace:

panic: Cannot create a Decimal from NaN

goroutine 563 [running]:
github.com/shopspring/decimal.newFromFloat(0xc000b42f20?, 0x4385a28?, 0x101000001?)
        /home/suyang/go/pkg/mod/github.com/shopspring/decimal@v1.2.0/decimal.go:233 +0x387
github.com/shopspring/decimal.NewFromFloat(0xc000b42f00?)
        /home/suyang/go/pkg/mod/github.com/shopspring/decimal@v1.2.0/decimal.go:209 +0x4c
github.com/dolthub/go-mysql-server/sql/expression.GetPrecisionAndScale({0x22c1600?, 0xc000c02168?})
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/expression/div.go:555 +0x1a5
github.com/dolthub/go-mysql-server/sql/expression.convertToDecimalValue({0x22c1600?, 0xc000c02168?}, 0x1?)
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/expression/div.go:401 +0x85
github.com/dolthub/go-mysql-server/sql/expression.(*Mod).convertLeftRight(0xc000b73f80, 0x24e0980?, {0x22c1740, 0x4385a28}, {0x22c1600, 0xc000c02168})
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/expression/mod.go:156 +0x269
github.com/dolthub/go-mysql-server/sql/expression.(*Mod).Eval(0x7f8b983050d8?, 0x7f8be029a108?, {0xc000bd3f40?, 0x1?, 0x1?})
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/expression/mod.go:119 +0x50
github.com/dolthub/go-mysql-server/sql/expression.(*Alias).Eval(0x412605?, 0x0?, {0xc000bd3f40?, 0xc000bd3f40?, 0xc000c0e060?})
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/expression/alias.go:130 +0x22
github.com/dolthub/go-mysql-server/sql/rowexec.ProjectRow(0xc000a696c0?, {0xc00096f940, 0x1, 0xc000625600?}, {0xc000bd3f40, 0x1, 0x1})
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/rowexec/rel_iters.go:543 +0x2a5
github.com/dolthub/go-mysql-server/sql/rowexec.(*projectIter).Next(0xc000b7a3f0, 0xc000625650?)
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/rowexec/rel_iters.go:517 +0x65
github.com/dolthub/go-mysql-server/sql/rowexec.transactionCommittingIter.Next(...)
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/rowexec/transaction_iters.go:78
github.com/dolthub/go-mysql-server/sql/plan.(*trackedRowIter).Next(0xc000a69700, 0xc0002f9580?)
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/sql/plan/process.go:347 +0x24
github.com/dolthub/go-mysql-server/server.(*Handler).doQuery.func2()
        /home/suyang/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.17.1-0.20231122195631-a1c4e378b710/server/handler.go:286 +0x125
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/suyang/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 558
        /home/suyang/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:72 +0x96

I originally find this by building dolt from source version 9ceca1f. It could also be reproduced in 1.26.1. Not sure if the issue #7038 related to this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants