Closed
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
This only happens with POST requests to the same uri (GET request works as intended)
$serviceUsername = 'XXX'
$serviceUserPassword = Read-Host -AsSecureString
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $serviceUsername, $serviceUserPassword
$body = @{foo = "foo"}
$parameters = @{
Uri = "https://xxx.net"
METHOD = "POST"
Credential = $cred
Body = $body | ConvertTo-Json
ContentType = 'application/json'
}
$response = Invoke-WebRequest @parameters
---
pwsh(66802,0x70000453e000) malloc: *** error for object 0x600002bdef20: pointer being freed was not allocated
pwsh(66802,0x70000453e000) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6
This does not happen in version 7.3.12
Expected behavior
Web request returns as expected.
Actual behavior
Shell crashes.
Error details
Get-Error cannot be called as the shell crashes with the following error
pwsh(66802,0x70000453e000) malloc: *** error for object 0x600002bdef20: pointer being freed was not allocated
pwsh(66802,0x70000453e000) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6
### Environment data
```powershell
Name Value
---- -----
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:11:05 PDT 2024; root:xnu-10063.101.17~1/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response