[SERVER-20423] metrics.interim file has garbage after the bson object Created: 15/Sep/15  Updated: 28/Sep/15  Resolved: 28/Sep/15

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Bruce Lucas (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Duplicate Votes: 0
Labels: FTDC
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-20417 metrics.interim file doesn't contain ... Closed
Related
is related to SERVER-20417 metrics.interim file doesn't contain ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform A (10/09/15)
Participants:

 Description   

This causes tools that process bson files such as bsondump and support tooling to fail due to malformed bson file, best case with a sanity check error, worst case with a crash.

> bsondump /ssd/db/r0/diagnostic.data/metrics.interim
2015-09-15T15:07:11.098-0400	1 objects found
2015-09-15T15:07:11.098-0400	invalid BSONSize: 138771735 bytes

> bsondump /ssd/db/r0/diagnostic.data/metrics.interim
panic: runtime error: slice bounds out of range
 
goroutine 1 [running]:
github.com/mongodb/mongo-tools/common/db.(*BSONSource).LoadNextInto(0xc20800a160, 0xc2080ae000, 0x1000000, 0x1000000, 0xc208038008)
	/srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/common/db/bson_stream.go:98 +0x689
github.com/mongodb/mongo-tools/common/db.(*DecodedBSONSource).Next(0xc208054040, 0x594680, 0xc20800a040, 0x8)
	/srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/common/db/bson_stream.go:56 +0x59
github.com/mongodb/mongo-tools/bsondump.(*BSONDump).JSON(0xc208054080, 0x0, 0x0, 0x0)
	/srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/bsondump/bsondump.go:87 +0x281
main.main()
	/srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/bsondump/main/bsondump.go:74 +0x8c2
 
goroutine 5 [syscall]:
os/signal.loop()
	/usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
	/usr/local/go/src/os/signal/signal_unix.go:27 +0x35
 
goroutine 6 [chan receive]:
github.com/mongodb/mongo-tools/common/signals.Handle()
	/srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/common/signals/signals_unix.go:16 +0x209
created by main.main
	/srv/10gen/mci-exec/mci/src/src/mongo-tools-repo/bsondump/main/bsondump.go:14 +0x34



 Comments   
Comment by Bruce Lucas (Inactive) [ 28/Sep/15 ]

This was resolved by the fix for SERVER-20417.

Comment by Bruce Lucas (Inactive) [ 15/Sep/15 ]

It also means that the reader of this file must know there is exactly 1 bson document in it so it knows not to read the garbage, so we lose flexibility in changing the content: we can never change the design so that this file contains more than one document and maintain backward compatibility.

Generated at Thu Feb 08 03:54:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.