Addresses are converted in blocks(asan, automap, stack, ...), with the start and end addresses modified using (address & 0xffffff) | ((address >> 28) << 24).
Following addresses are only specified to frame accuracy with the last 4 hex digits chopped off.
null, loader, image and arena blocks have not been modified.
asan [0x00007fff, 0x10007fff] ⇒ [0x00007fff, 0x01007fff] Not currently supported.
automap [0x10008004, 0x1fe7fffb] ⇒ [0x01008004, 0x01e7fffb]
_mmi [0x1fe7fffc, 0x1ffffffb] ⇒ [0x01e7fffc, 0x01fffffb] Listed as memtrack outside of the memtrack files.
fixedmap [0x30000004, 0x40000003] ⇒ [0x03000004, 0x04000003]
nsync [0x6fc00004, 0x6fcffffb] ⇒ [0x06c00004, 0x06cffffb]
zipos [0x6fd00004, 0x6fdffffb] ⇒ [0x06d00004, 0x06dffffb] I don't think this is used currently on the vista branch.
g_fds [0x6fe00004, 0x6feffffb] ⇒ [0x06e00004, 0x06effffb]
winargs [0x6ffffffe, 0x6fffffff] ⇒ [0x06fffffe, 0x06ffffff] Not entirely confident on if this is accurate.
stack [0x70000000, 0x70000003] ⇒ [0x07000000, 0x07000003] Not entirely confident on if this is accurate.
This map is documented in memtrack64-8tib.txt with the original 128tib version renamed to memtrack64-128tib.txt.
Modified windows 8.1 check macro name to match existing windows 10 one.
Modified IsShadowFrame to correctly identify the asan block on old windows. Required as the asan block on 128tib virtual memory systems is larger than 2^43 - 1 and so all blocks were reporting as asan.
Revert the changes that 827f25f made to libc/calls/readv-metal.c regarding internal functions having underlines due to 6f7d0cb being missing at the time.
Use the versions of libc/intrin/lockfileex.c and libc/intrin/unlockfileex.c from 3f49889 to account for strace changes.
Revert d86916e and use the versions of libc/calls/getgroups.c, libc/calls/setgroups.c, libc/runtime/getlogin.c and libc/runtime/getlogin_r.c from 4c40c50 to again account for strace changes.
Fix include statements and internal underlined function calls in libc/stdio/cocmd.c, libc/testlib/extract.c and test/libc/stdio/system_test.c.
Fix missing closing paren in nsync memory size macro in memtrack.internal.h.
This makes breaking changes to add underscores to many non-standard
function names provided by the c library. MODE=tiny is now tinier and
we now use smaller locks that are better for tiny apps in this mode.
Some headers have been renamed to be in the same folder as the build
package, so it'll be easier to know which build dependency is needed.
Certain old misguided interfaces have been removed. Intel intrinsics
headers are now listed in libc/isystem (but not in the amalgamation)
to help further improve open source compatibility. Header complexity
has also been reduced. Lastly, more shell scripts are now available.
Compared to 6f7d0cb1c3, some tiny corrections were made in libc/intrin/g_fds.c and libc/zipos/open.c including double semi colons and incorrect indentation for existing vista changes that were manually pulled from this commit previously.
* Introduce testlib_extract() helper
* Have execve() escape double quotes in cmd.exe's preferred style
This makes it possible for us to use system() and popen() with paths
that redirect to filenames that contain spaces, e.g.
system("echo.com hello >\"hello there.txt\"")
It's difficult to solve this problem, because WIN32 only allows passing
one single argument when launching programs and each program is allowed
to tokenize that however it wants. Most software follows the convention
of cmd.exe which is poorly documented and positively byzantine.
In the future we're going to solve this by not using cmd.exe at all and
instead embedding the cocmd.com interpreter into the system() function.
In the meantime, our documentation has been updated to help recalibrate
any expectation the user might hold regarding the security of using the
Windows command interpreter.
Fixes#644
* Introduce double quote support in cocmd.com shell
* Add some tests for execve()
* Embed cocmd.com interpreter for system() / open()
This change lets you use system() in an easier and portable way. The
problem with the call in the past has always been that bourne and
cmd.com on Windows have less than nothing in common, so pretty much the
only command system() could be used for across platforms was maybe echo.
cmd.exe is also a security liability due to its escaping rules.
Since cocmd.com implements 85% of what we need from bourne, in a really
tiny way, it makes perfect sense to be embedded in these functionss. We
get a huge performance boost too.
Fixes#644
* Support whitespace after cocmd output redirection
Co-authored-by: Justine Tunney <jtunney@gmail.com>
* Add sys_ prefix to unwrapped system calls
* This change also implements getlogin() and getlogin_r().
* Add getgroups and setgroups (#619)
* Fix getgroups / setgroups tests across platforms. See #619
* Change accept type to struct sockaddr * (#630)
* vista: use old strace path
* Fixes virtual memory support for Windows Vista/7/8
Fixes file desciptor and zipos virtual memory sizes given that old versions of windows limit their user virtual memory space to 8tb.
Includes some changes from b69f3d2488 and 6f7d0cb1c3 in preparation for potentially using them on old windows and because it avoids duplicating addresses everywhere.
* Optimise windows version checking
Added GetNtMinorVersion() and IsAtleastWindows8p1() macros which get nt version info from the peb.
* Planned nsync memory region for old windows
Added nsync regon start and size macros that can switch to smaller values on old windows, just like previous fds and zipos change.
You can now run bare metal on bare metal!
* Fix handling of int 0x15 eax = 0xe820 memory map
* Fix some issues in initial page table creation
* hello4.com now works outside emulators
* Ensure area for identity page tables are zeroed first
* Simplify logic for creating page table entries, this partly
reverts 577c0f6226
* Add degenerate MBR partition entry, to ease testing
Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
The organization of the source files is now much more rational.
Old experiments that didn't work out are now deleted. Naming of
things like files is now more intuitive.
This change fixes#496 where ASAN spotted a race condition that could
happen in multithreaded programs, with more than OPEN_MAX descriptors
when using ZipOS or Windows NT, which require tracking open file info
and this change fixes that table so it never relocates, thus allowing
us to continue to enjoy the benefits of avoiding locks while reading.
This change tunes the default stack size for the outside world to 8mb
while at the same time, reducing Cosmopolitan's default stack size to
64kb. You can override the stack size using STATIC_STACK_SIZE(). Your
build scripts should point to o//ape/public/ape.lds
This change also fixes the definition of SOMAXCONN and removes AF_RDS
since it's not polyfilled and Python 3.11 complained.
- You can now use _gc(malloc()) in multithreaded programs
- This change fixes a bug where fork() on NT disabled TLS
- Fixed TLS code morphing on XNU/NT, for R8-R15 registers