Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertion on mmap() when load_and_map_main_image() #19

Open
cocus opened this issue May 13, 2020 · 1 comment
Open

assertion on mmap() when load_and_map_main_image() #19

cocus opened this issue May 13, 2020 · 1 comment

Comments

@cocus
Copy link

cocus commented May 13, 2020

image
This happens on line 360 of loader.cpp. The struct gets a proper pointer in memory, and fd "should be OK" (although it's fd=3, which it's a low number, but whatever). The fstat() call at line 343 returned the proper byte length of the file tho.
I'm using msvc v142, and Windows SDK 10.1.19041.1. Building for x64 Debug.

@smx-smx
Copy link

smx-smx commented Jul 9, 2022

There is an issue with the linenoise-ng library, which is built with static msvcrt (MT) and doesn't respect the vcpkg build type (static/dynamic)
Static msvcrt means the library effectively has its own copy of file descriptors, which are isolated from efi-dxe-emulator.

I couldn't build this project at all due to this conflict, as Visual Studio notified me about this discrepancy and stopped the build. Changing the emulator flags to use MT rather than MD will bypass the error, but then you run in the assertion you reported.

I therefore made a fork of linenoise-ng and changed CMakeLists to use MD rather than MT. I then instructed vcpkg to use my fork instead of the original.

Then everything worked correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants