Skip to content

JIT Bug when set DefaultMaxInlineDepth=2 #764

@liuq19

Description

@liuq19

Describe the bug

The bug when unmarshaling into a named pointer type with DefaultMaxInlineDepth=2

To Reproduce

test TestIssue379

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

--- FAIL: TestIssue379 (0.24s)
    issue379_test.go:119: 
        	Error Trace:	/home/runner/work/sonic/sonic/issue_test/issue379_test.go:119
        	Error:      	Not equal: 
        	            	expected: &map[string]issue_test.MyPtr{"map":(issue_test.MyPtr)(0xc0003dca00)}
        	            	actual  : &map[string]issue_test.MyPtr{"map":(issue_test.MyPtr)(0xc0003dc1e0)}
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,3 @@
        	            	  (string) (len=3) "map": (*issue_test.Foo)({
        	            	-  Name: (string) (len=5) "MyPtr"
        	            	+  Name: (string) (len=11) "Unmarshaler"
        	            	  })
        	Test:       	TestIssue379
std: <nil>, obj: &issue_test.Issue670JSONMarshaler{D:162[99](https://github.com/bytedance/sonic/actions/runs/13557498069/job/37894516768#step:5:100)36000, E:1}sonic error: <nil>, obj: &issue_test.Issue670JSONMarshaler{D:1629936000, E:1}std: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into issue_test.Date, obj: &issue_test.Issue670JSONMarshaler{D:0, E:1}sonic error: Mismatch type *issue_test.Date with value  "at index 7: mismatched type with value\n\n\t{\"D\":11,\"E\":1}\n\t.......^......\n", obj: &issue_test.Issue670JSONMarshaler{D:0, E:1}std: <nil>, obj: &issue_test.Issue670JSONMarshaler{D:0, E:1}sonic error: <nil>, obj: &issue_test.Issue670JSONMarshaler{D:0, E:1}{"D":"1740623084","E":0}
std: json: cannot unmarshal number 2021-08-26 into Go struct field Issue670TextMarshaler.D of type int, obj: &issue_test.Issue670TextMarshaler{D:0, E:1}sonic error: "Syntax error at index 10: invalid char\n\n\t{\"D\":\"2021-08-26\",\"E\":1}\n\t..........^.............\n", obj: &issue_test.Issue670TextMarshaler{D:2021, E:0}std: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into int, obj: &issue_test.Issue670TextMarshaler{D:0, E:1}sonic error: "Syntax error at index 8: invalid char\n\n\t{\"D\":11,\"E\":1}\n\t........^.....\n", obj: &issue_test.Issue670TextMarshaler{D:0, E:0}std: <nil>, obj: &issue_test.Issue670TextMarshaler{D:0, E:1}sonic error: <nil>, obj: &issue_test.Issue670TextMarshaler{D:0, E:1}Mismatch type int64 with value string "at index 22: mismatched type with value\n\n\t\"a\": null, \"b\": \"123\"}, \"c\": 123\n\t................^...............\n"
Error: Mismatch type int64 with value string "at index 25: mismatched type with value\n\n\t\"Alice\", \"age\": \"30\"}\n\t................^....\n"
(*issue_test.SingleMapFieldOuterContainer)(0xc0004d2280)({
 X: (*issue_test.SingleMapFieldOuter)(0xc0004d24c8)({
  Y: (*issue_test.SingleMapField)(0xc0004d24d8)({
   Z: (*int)(0xc00019c2b8)(1)
  })
 })
})
{"X":{"Y":{"Z":1}}}
"Syntax error at index 5: float number is infinity\n\n\t9e370\n\t^\n" json: cannot unmarshal number 9e370 into Go value of type float64
[{"StartTime":1740623086}]
([]uint8) (len=26 cap=32) {

Sonic version:

sonic 1.12.10

Environment:

only in amd64 (JIT implemention)

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

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