[SERVER-13476] Cpu profiler doesn't produce a valid trace if mongod is shutdown (or a signal is sent) Created: 03/Apr/14  Updated: 14/Apr/16  Resolved: 24/Mar/16

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 2.6.0-rc3
Fix Version/s: 3.3.4

Type: Bug Priority: Major - P3
Reporter: Davide Italiano Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 12 (04/01/16)
Participants:

 Description   

Steps to reproduce:

$ ./mongo
> use admin
switched to db admin
> db.runCommand({_cpuProfilerStart: {profileFilename: './foo.prof'}});
{ "ok" : 1 }

Then, send a signal, e.g. SIGTERM to mongod, and quit the shell.
Try to analyze the results with google-pprof.
Output:

pprof ./mongod foo.prof 
Using local file ./mongod.
Using local file foo.prof.
substr outside of string at /usr/bin/pprof line 3524.
Use of uninitialized value in string eq at /usr/bin/pprof line 3524.
substr outside of string at /usr/bin/pprof line 3526.
Use of uninitialized value in string eq at /usr/bin/pprof line 3526.
foo.prof: header size >= 2**16



 Comments   
Comment by Githook User [ 24/Mar/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-13476 Make the gperftools cpu profiler work again
Branch: master
https://github.com/mongodb/mongo/commit/10b650835a78fbf7ebe9cf26926cc45556efd178

Comment by Andrew Morrow (Inactive) [ 24/Mar/16 ]

I can reproduce this locally. My question is whether this is worth fixing, or whether we should just remove the gperftools cpu-profiler support entirely. schwerinmartin.bligh any opinions?

Comment by Andrew Morrow (Inactive) [ 07/Mar/16 ]

ian.whalen Sounds reasonable, I'll give it a look

Comment by Ian Whalen (Inactive) [ 07/Mar/16 ]

acm we thought this should go to you since you're looking into a new atShutdown system.

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