[tor-bugs] #9084 [Tor bundles/installation]: TBB 3.0a1 crashes on startup on WinXP (missing entry points for _vsnprintf_s in msvcrt.dll)

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jul 9 09:20:15 UTC 2013

#9084: TBB 3.0a1 crashes on startup on WinXP (missing entry points for
_vsnprintf_s in msvcrt.dll)
 Reporter:  dope457                              |          Owner:  erinn           
     Type:  defect                               |         Status:  new             
 Priority:  major                                |      Milestone:  Tor: unspecified
Component:  Tor bundles/installation             |        Version:  Tor: unspecified
 Keywords:  tbb-3.0, tbb-crash, MikePerry201307  |         Parent:                  
   Points:                                       |   Actualpoints:                  
Changes (by James_A):

 * cc: jmaxhaven@… (added)


 Excuse me coming in here, but it seems to me that this bug is stalled due
 to a misunderstanding.

 On Windows XP Firefox fails to start, because the function _vsnprintf_s()
 is not present in msvcrt.dll. _vsnprintf_s() and all the *_s() functions
 are present in the Visual Studio runtimes, because they are a Microsoft
 addition as "security enhanced" versions of the functions without the _s
 suffix. As far as I can tell they have also been backported to msvcrt.dll
 on Vista/7 only. This is a Windows system file and you may not take the
 file from Vista/7 and copy it to XP (it won't work even if you did).

 Accordingly, the way forward looks like one of the following:
 (1) Compile with Visual Studio 2010 or VS 2012
 (2) Target only Vista/7 upwards (effectively a WONTFIX for XP)
 (3) Write your own *_s() functions. Required are 5 variations of
 *printf_s(), _wcslwr_s(), _wfopen_s(), fopen_s(), rand_s() and
 _controlfp_s() (10 in all). The first 9 are called from xul.dll and the
 10th from gkmedias.dll. I have walked all the 3.0a1 package (.exe and .dll
 files) through Dependency Walker to find what is missing. This option
 looks like a major effort, except that others have already done it e.g.
 the WINE project, for which the source code is available under GNU Lesser
 GPL 2.1.
 (4) Reconfigure MinGW to link to the equivalent of the Visual Studio
 runtimes e.g. msvcr90.dll (which is the runtime for VS 2008). I don't know
 if this works, not having tried it myself, but others have suggested that
 the options:
  gcc foo.c -nostdlib -lmsvcr90 -lgcc ...
 might work.

 Incidentally, undef-ing MINGW_HAS_SECURE_API (as done in Chromium V8) will
 not work unless you follow option (3) because V8 provides its own *_s()
 functions in the file platform-win32.cc.

Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9084#comment:11>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online

More information about the tor-bugs mailing list