candiduslynx commented on code in PR #35970:
URL: https://github.com/apache/arrow/pull/35970#discussion_r1221847214
##########
go/arrow/memory/checked_allocator.go:
##########
@@ -160,14 +160,24 @@ func (a *CheckedAllocator) AssertSize(t TestingT, sz int)
{
break
}
callersMsg.WriteString("\t")
- callersMsg.WriteString(frame.Function)
- callersMsg.WriteString(fmt.Sprintf(" line %d",
frame.Line))
+ if fn := frame.Func; fn != nil {
+ callersMsg.WriteString(fmt.Sprintf("%s+%x",
fn.Name(), frame.PC-fn.Entry()))
+ } else {
+ callersMsg.WriteString(fmt.Sprintf("%s, line
%d", frame.Function, frame.Line))
+ }
+ callersMsg.WriteString("\n\t\t")
+ callersMsg.WriteString(frame.File + ":" +
strconv.Itoa(frame.Line))
callersMsg.WriteString("\n")
if !more {
break
}
}
- t.Errorf("LEAK of %d bytes FROM %s line %d\n%v", info.sz,
f.Name(), info.line, callersMsg.String())
+ file, line := f.FileLine(info.pc)
+ t.Errorf("LEAK of %d bytes FROM\n\t%s+%x\n\t\t%s:%d\n%v",
+ info.sz, f.Name(), info.pc-f.Entry(),
+ file, line,
Review Comment:
this gives a proper fill filename, so the leak is easier to find (IntelliJ
IDEA even allows clicking on a link to line)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]