[SERVER-58126] Windows DLL loading mechanism is incompatible with symlinking binaries during resmoke.py setup-multiversion Created: 28/Jun/21  Updated: 29/Oct/23  Resolved: 04/Aug/21

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

Type: Task Priority: Major - P3
Reporter: Daniel Moody Assignee: Robert Guo (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2021-06-28-11-21-30-734.png     PNG File no-dll-5.0.png     PNG File symlink-4.4.png     PNG File symlink-5.0.png    
Issue Links:
Backports
Depends
Gantt Dependency
Problem/Incident
Related
is related to SERVER-59870 Append to Windows bin paths file in s... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0, v4.4, v4.2, v4.0
Sprint: STM 2021-07-26, STM 2021-08-09
Participants:
Linked BF Score: 200
Story Points: 2

 Description   

The multiversion resmoke test downloads the older version of the server, and create a common directory in which it creates symlinks to each of the old versions. It then runs the old versions out of that common directory.

 

The renaming causes the DLL's to not be loaded because the executable is looking for a specific name. Instead the DLL is loaded from the system path, because the renamed version of the DLL does not match.

 

I discovered this when working on BUILD-11371, see attached screenshot. I reran the old version command line from the test, and checked the DLL modules loaded using Visual Studio debugger, and found that changing the name of the symlink allows the correct dll to be loaded.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 04/Aug/21 ]

Author:

{'name': 'Robert Guo', 'email': 'robert.guo@mongodb.com'}

Message: SERVER-58126 Avoid symlinking downloaded binaries on Windows
Branch: master
https://github.com/mongodb/mongo/commit/e74e88defab5d9081e4e3d81bd2457b04c32af48

Comment by Robert Guo (Inactive) [ 02/Aug/21 ]

Found a fix. Will merge after patch build comes back green.

Comment by Robert Guo (Inactive) [ 02/Aug/21 ]

Took a look on Friday. Setting PATH (both Cygwin and Win32 style) did not work for subprocess.check_output for that rogue call to the multiversion shell binary outside of resmoke.py 

Will try a different approach today.

Comment by Robert Guo (Inactive) [ 22/Jul/21 ]

I'm also going to rename this ticket. Per more recent discussion on the CR, the root cause is that Windows is looking for the DLLs in the symlinked dir, not in the install dir.

Comment by Robert Guo (Inactive) [ 22/Jul/21 ]

Attached a few screenshots confirming the correct DLL is loaded.

Generated at Thu Feb 08 05:43:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.