[SERVER-5804] stackchecker broke test on Linux 32-bit Created: 09/May/12  Updated: 10/Dec/14  Resolved: 30/Apr/14

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

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 32-bit debug


Operating System: ALL
Participants:

 Description   

http://buildbot.mongodb.org/builders/Linux%2032-bit%20debug/builds/1690

$ gdb ./test
 
(etc...)
Wed May  9 16:07:47 [testsuite] going to run suite: background_job
 
Program received signal SIGSEGV, Segmentation fault.
0x08d2adba in mongo::StackChecker::check(char const*) ()



 Comments   
Comment by Eric Milkie [ 10/May/12 ]

I see the bug. We don't actually do "StackChecker sc; sc.init();" unless sizeof(void*) == 8. See Client::initThread() in client.cpp. Otherwise, the global "checker" pointer never gets set to "this", it stays 0.

Fix is to only call StackChecker::check() with sizeof(void*)=8. Or, put the check at the top of check() function itself.

Comment by Tad Marshall [ 10/May/12 ]

It's incidental to this discussion, but just FYI, a 256 KB StackChecker makes ^C generate a stack overflow in Windows debug builds in Windows XP and Windows Server 2003 (and 2003 R2) ... this happens to both 32-bit and 64-bit versions of mongod.exe. That's why I dropped it from 256 KB to 192 KB months ago. Back then I guess we weren't using so much stack space and 192 KB was enough.

Comment by Dwight Merriman [ 10/May/12 ]

looking at the output in bb unclear what's up. wonder if i broke something or if it is concincidental and the change makes something else manifest?

one option is to turn off stackchecker for 32 bit linux. we really just want stackchecker to have a rough idea of how much stack space we use. it's informational and thus a bit discretionary.

http://buildbot.mongodb.org/builders/Linux%2032-bit%20debug/builds/1695/steps/test/logs/stdio

or did I do something really dumb (can you read the commit, it's pretty short?)

Comment by Eric Milkie [ 10/May/12 ]

So to be clear –
right now at head of master:
64-bit debug Windows is broken
64-bit debug Linux works
32-bit debug Linux works

With your code change –
64-bit debug Windows works
64-bit debug Linux works
32-bit debug Linux crashes

I'm going to try 32-bit Windows debug right now to see if it breaks with current head of master or it breaks with your code change.
I don't have any easily available 32-bit Linux boxes (I ran test directly on the buildslave to determine how it was crashing)

Comment by Dwight Merriman [ 10/May/12 ]

why does this break 32 bit?

64 bit debug is broken ALWAYS on my machine without this

Comment by auto [ 10/May/12 ]

Author:

{u'login': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: Revert "increase StackChecker maximum to 256KB. used for _DEBUG builds"

This reverts commit 4cc8a4b19400d98ad1564c57010db68b4dc4b6f4.
Broke Linux 32-bit debug builds – "test" is segfaulting in StackChecker
SERVER-5804
Branch: master
https://github.com/mongodb/mongo/commit/c8396e3ec32f3716a20de2d0c9a13b5b2d466d69

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