4

I have a C++ binary that is 190 MB in size. When I put this binary into dbx and try to create a breakpoint, dbx hangs. While dbx is hung, I have observed its memory quickly grow to over 10 GB. TotalView allows me to set breakpoints; however, all the data it displays is bogus. I have successfully debugged many other smaller binaries, so my hunch is the large size of this binary is the problem.

Binary: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped.
Compiler: CC: Sun C++ 5.9 SunOS_sparc 2007/05/03.
Dbx: 7.6 SunOS_sparc 2007/05/03.
TotalView: 8.2.0-0
Operating System: Solaris 10

How I am using Dbx:

dbx mybinary
stop at Something.cc:170

Dbx never returns from this command and I have to eventually kill Dbx from a seperate terminal.

I have tried a few things without success:
1. Switched to linking in most of the libraries dynamically, which reduced the binary size to 19 MB.
2. Tried on Solaris x86.
3. Compiled the software as 64 bit.

Does anyone know what could cause this to happen and how to resolve the issue?

Hitman
  • 123
  • 10
  • Which version of the compilers and which version of dbx? dbx -V CC -V Just to verify: dbx hangs and starts to grow in response to you typing the "stop" command? So you don't even have to run the program in the debugger? – Chris Quenelle Feb 10 '12 at 05:10
  • I answered your question by clarifing my original post. – Hitman Feb 10 '12 at 16:42
  • One good thing to try is to download the latest version of Solaris Studio and try that. http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.html The version you're using is 4.5 years old. – Chris Quenelle Feb 14 '12 at 23:04
  • We like to be on the leading edge of yesterday's technology. I will give Solaris Studio 12.3 a try. The process for me to get the newer version is actually incredibly long and arduous, so it will probably be a while before I can post the outcome. – Hitman Feb 20 '12 at 21:27
  • Often, people who are stuck on old releases also have support contracts. If you have an up-to-date support contract you should be able to download the latest patches for the Sun Studio release you're using (Sun Studio 12) – Chris Quenelle Feb 21 '12 at 22:13
  • I downloaded a newer version of DBX that is packaged with Solaris Studio 12.3 (7.9 2011/11/16). This version is working much better. – Hitman May 14 '13 at 16:46

1 Answers1

2

Try debugging with a different debugger to determine whether or not your code is causing the issue. My favorite debugger on Solaris is mdb:

mdb ./yourapplicationname
> your_c_fn_name::bp
> ::run

Remember to use mangled function names, if you are coding in C++. You pipe nm output to grep to find out what your mangled function name is:

nm ./yourapplicationname | grep yourc++fnname

If mdb has the same issue with dbx, then I would suggest that you take a look at your code. If, however, mdb gets to the bp without issues then you can either work with mdb (which cannot, as far as I know, work with source files) or you can keep tweaking your application to make dbx happy.

Mustafa Ozturk
  • 812
  • 4
  • 19
  • Thanks @Mustafa. Tried mdb and the breakpoint worked. Mdb is a step up from using prints to debug; however, my team and I would find more value in a debugger that worked with source files. Thus, I would greatly appreciate any information on getting dbx or TotalView working. – Hitman Feb 13 '12 at 22:28
  • I don't think dbxtool is available in Sun Studio 12. Also, it is a GUI layer that uses the dbx engine underneath. so it's likely that the same bug would happen under dbxtool. – Chris Quenelle Feb 14 '12 at 23:06
  • Dbxtool is not installed on my system. @Chris I think you are right about it just being GUI wrapper around dbx. – Hitman Feb 20 '12 at 21:19