Menu

#14 Fixtures not found in large DLL

open-invalid
nobody
7
2010-10-15
2010-10-14
Andy Dent
No

I'm happily using cfix and VisualAssert on a number of projects but it's not finding fixtures on an 88MB DLL I've had to build which has 4193 functions. The fixtures are clearly shown using Dumpbin, as seen below. I'm not sure if this represents a (fairly reasonable) limitation on the size of PE that cfix can scan. Unfortunately, I can't factor out small chunks of code for testing. We encourage people to test individual classes as much as possible but also have some that are stuck in the "big ball of mud" and will not be refactored for some time. I'm the unlucky bunny who drew the task of building a test framework that could link to most of the code base.

There are no errors from cfix32 or VisualAssert:

Andy>cfix32 -d ggtests_dll.dll
cfix version 1.7.0.3773 (fre)
(C) 2008-2010 - Johannes Passing - http://www.cfix-testing.org/
The specified module could not be found.

Partial DumpBin output:
00000000 characteristics
4CB6A7E4 time date stamp Thu Oct 14 14:49:08 2010
0.00 version
1 ordinal base
4193 number of functions
4193 number of names

ordinal hint RVA name
...
4102 1005 0230EAF7 __CPLAssert@12 = @ILT+383730(__CPLAssert@12)
4103 1006 02334149 ___CfixFixturePeJustToSeeIfInvoked@0 = @ILT+536900(___CfixFixturePeJustToSeeIfInvoked@0)
4104 1007 023A822E ___CfixFixturePemsc_memory_tests@0 = @ILT+1012265(___CfixFixturePemsc_memory_tests@0)
...

Summary

20B000 .data
28000 .idata
C2F000 .rdata
3B1000 .reloc
1000 .rsrc
4702000 .text
22B0000 .textbss
2000 CONST

Discussion

  • Andy Dent

    Andy Dent - 2010-10-14

    In case it helps with the answer, here are most of the compiler and linker command lines.

    TEST DLL COMPILER COMMAND LINE
    /Od
    /I "..\..\common\GG_functions"
    /I "c:\thirdparty\cfix\1_1_0_3780\include"
    ...
    /I "..\include"
    /I ".."
    /I "c:\thirdparty\acQuire\4.0.6\include"
    /D "WIN32"
    /D "_DEBUG"
    /D "_WINDOWS"
    /D "_USRDLL"
    /D "DEVELOPMENT"
    /D "SSI_NO_INLINE"
    /D "SMG_NO_INLINE"
    /D "BOOST_ALL_DYN_LINK"
    /D "_CRT_SECURE_NO_WARNINGS"
    /D "_SCL_SECURE_NO_WARNINGS"
    /D "_AFXDLL"
    /D "FORC"
    /D "JDK_MAJOR_VERSION=1"
    /D "JDK_MINOR_VERSION=6"
    /D "JDK_MICRO_VERSION=0"
    /D "JDK_UPDATE_VERSION="
    /D "JDK_VERSION=1.6.0"
    /D "JDK_FULL_VERSION=1.6.0"
    /D "HAVE_BOOST_UNORDERED_COLLECTIONS"
    /D "_WIN32"
    /D "_X86_=1"
    /D "NT_i386"
    /D "STRICT"
    /D "NOMINMAX"
    /D "_USE_MATH_DEFINES"
    /D "_WINDLL"
    /GF
    /Gm
    /EHa
    /RTC1
    /RTCc
    /MDd
    /Yu
    /Fp"..\..\develop\nt_i386_vc90\obj\GG_tests_dll\GG_tests_dll.pch"
    /Fo"..\..\develop\nt_i386_vc90\obj\GG_tests_dll\\"
    /Fd"..\..\develop\nt_i386_vc90\obj\GG_tests_dll\vc90.pdb"
    /W3
    /nologo
    /c
    /ZI
    /TP
    /errorReport:prompt
    /we4700
    /Zm250

    LINKER COMMAND LINE

    /OUT:"..\..\develop\NT_i386_vc90\Model\GG_tests_dll.dll"
    /INCREMENTAL
    /NOLOGO
    /LIBPATH:"c:\thirdparty\boost_1_40_0\lib"
    ...
    /LIBPATH:"c:\thirdparty\cfix\1_1_0_3780\lib\i386"
    /DLL
    /MANIFEST
    /MANIFESTFILE:"..\..\develop\nt_i386_vc90\obj\GG_tests_dll\GG_tests_dll.dll.intermediate.manifest"
    /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
    /NODEFAULTLIB:"libboost_thread-vc90-mt-gd-1_39"
    /NODEFAULTLIB:"libboost_date_time-vc90-mt-gd-1_39"
    /NODEFAULTLIB:"libboost_program_options-vc90-mt-gd-1_39"
    /NODEFAULTLIB:"libboost_filesystem-vc90-mt-gd-1_39"
    /NODEFAULTLIB:"libboost_system-vc90-mt-gd-1_39"
    /NODEFAULTLIB:"libboost_regex-vc90-mt-gd-1_39"
    /NODEFAULTLIB:"libboost_serialization-vc90-mt-gd-1_39"
    /NODEFAULTLIB:"libboost_wserialization-vc90-mt-gd-1_39"
    /NODEFAULTLIB:"libboost_thread-vc90-mt-1_39"
    /NODEFAULTLIB:"libboost_date_time-vc90-mt-1_39"
    /NODEFAULTLIB:"libboost_program_options-vc90-mt-1_39"
    /NODEFAULTLIB:"libboost_filesystem-vc90-mt-1_39"
    /NODEFAULTLIB:"libboost_system-vc90-mt-1_39"
    /NODEFAULTLIB:"libboost_regex-vc90-mt-1_39"
    /NODEFAULTLIB:"libboost_serialization-vc90-mt-1_39"
    /NODEFAULTLIB:"libboost_wserialization-vc90-mt-1_39"
    /NODEFAULTLIB:"MSVCRT"
    /NODEFAULTLIB:"LIBC"
    /NODEFAULTLIB:"LIBCMT"
    /NODEFAULTLIB:"LIBCD"
    /DEBUG
    /PDB:"something sensible here hidden for security"
    /SUBSYSTEM:WINDOWS
    /LARGEADDRESSAWARE
    /DYNAMICBASE
    /NXCOMPAT
    /MACHINE:X86
    /ERRORREPORT:PROMPT

     
  • Andy Dent

    Andy Dent - 2010-10-14
    • priority: 5 --> 7
     
  • Johannes Passing

    Hi Andy,

    that is a large DLL indeed, but I do not think that size is a problem here: In my tests, VA happily scanned both DLLs larger than 150 MB and DLLs containing more than 5500 fixtures/exports. There should not be any hard-coded limits here.

    However, the error "The specified module could not be found." could also refer to a dependent module not being found -- I would therefore suggest you to run Sysinternals Process Monitor to see if maybe one of the DLLs your test-DLL depends on could not be found or loaded.

    I hope this helps.

    Regards, Johannes

     
  • Andy Dent

    Andy Dent - 2010-10-15

    You're correct, this is not a bug. The issue was an OCX file that was one directory level higher than the DLLs. Once copied to be adjacent to the DLL it can be parsed by both cfix32 and Visual Assert. Thanks for the fast response. Sadly I'm not able to debug tests due possibly to the long startup time, with Visual Assert, but at least I can now run them.

     
  • Andy Dent

    Andy Dent - 2010-10-15
    • status: open --> open-invalid
     

Log in to post a comment.

MongoDB Logo MongoDB