[SERVER-20313] Remove SpiderMonkey Windows exported functions Created: 08/Sep/15  Updated: 15/Oct/15  Resolved: 08/Oct/15

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.1.7
Fix Version/s: 3.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: Windows
Sprint: Platform 9 (09/18/15), Platform A (10/09/15)
Participants:

 Description   

Mongod.exe is now exporting 618 functions. It should not, and the dllexport statements on these functions should be removed. The only function that should be exported is index_collator_extension which is in WiredTiger.

File Type: EXECUTABLE IMAGE
 
  Section contains the following exports for mongod.exe
 
    00000000 characteristics
    55EEF19B time date stamp Tue Sep 08 10:32:59 2015
        0.00 version
           1 ordinal base
         619 number of functions
         619 number of names
 
    ordinal hint RVA      name
 
          1    0 0003E842 ??0?$SecurityWrapper@VCrossCompartmentWrapper@js@@@js@@QEAA@AEBV01@@Z = @ILT+251965(??0?$SecurityWrapper@VCrossCompartmentWrapper@js@@@js@@QEAA@AEBV01@@Z)
          2    1 0009A624 ??0?$SecurityWrapper@VCrossCompartmentWrapper@js@@@js@@QEAA@I_N@Z = @ILT+628255(??0?$SecurityWrapper@VCrossCompartmentWrapper@js@@@js@@QEAA@I_N@Z)
          3    2 00002E55 ??0?$SecurityWrapper@VWrapper@js@@@js@@QEAA@AEBV01@@Z = @ILT+7760(??0?$SecurityWrapper@VWrapper@js@@@js@@QEAA@AEBV01@@Z)
          4    3 0006C896 ??0?$SecurityWrapper@VWrapper@js@@@js@@QEAA@I_N@Z = @ILT+440465(??0?$SecurityWrapper@VWrapper@js@@@js@@QEAA@I_N@Z)
          5    4 0007D7AE ??0AutoCTypesActivityCallback@js@@QEAA@PEAUJSContext@@W4CTypesActivityType@1@1@Z = @ILT+509865(??0AutoCTypesActivityCallback@js@@QEAA@PEAUJSContext@@W4CTypesActivityType@1@1@Z)
        ...
        609  260 00025E91 acosh = @ILT+151180(acosh)
        610  261 00090B79 atanh = @ILT+588660(atanh)
        611  262 0007021B cbrt = @ILT+455190(cbrt)
        612  263 00091489 expm1 = @ILT+590980(expm1)
        613  264 03B56788 gMozillaPoisonBase = gMozillaPoisonBase
        614  265 03B56790 gMozillaPoisonSize = gMozillaPoisonSize
        615  266 03B56780 gMozillaPoisonValue = gMozillaPoisonValue
        616  267 000515EB index_collator_extension = @ILT+329190(index_collator_extension)
        617  268 000C362D log1p = @ILT+796200(log1p)
        618  269 0000617C log2 = @ILT+20855(log2)
        619  26A 000463E4 mozPoisonValueInit = @ILT+283615(mozPoisonValueInit)



 Comments   
Comment by Githook User [ 08/Oct/15 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-20313: Remove SpiderMonkey Windows exported functions
Branch: master
https://github.com/mongodb/mongo/commit/83557249df14f8d685aa4a76a407738fe84bdb1b

Comment by Mark Benvenuto [ 14/Sep/15 ]

This is much harder then thought. SpiderMonkey is not designed to be a pure static lib. The code is scattered with MOZ_EXPORT (and its synonyms) on various classes. This means it will leak all these symbols by design. If we want to fix this, we will have to change the definition of MOZ_EXPORT in the SpiderMonkey source to stop exporting symbols.

src/third_party/mozjs-38/include/mozilla/Types.h

#if defined(WIN32)
#  define MOZ_EXPORT   __declspec(dllexport)
#else /* Unix */
#  ifdef HAVE_VISIBILITY_ATTRIBUTE
#    define MOZ_EXPORT       __attribute__((visibility("default")))
#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#    define MOZ_EXPORT      __global
#  else
#    define MOZ_EXPORT /* nothing */
#  endif
#endif

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