-
Notifications
You must be signed in to change notification settings - Fork 471
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
Fix memory allocation #380
Comments
Thanks for reporting, this is our first "memory allocation" bug. We are going to try reproduce it with the same HTTP response. Thanks |
Yes, it happens without verbose as well. Is there any other testing/data I can do here to share with you to help with debugging this? |
18446744073709551613 is 2**64 - 3. Probably the size of some object is (erroneously) computed as -3 byte! The second response seems to trigger this bug, would it be possible maybe to « capture » the second HTTP response with a proxy (https://hurl.dev/docs/tutorial/debug-tips.html#using-a-proxy) Or, if it is possible of course, could we reproduce your local server setup ? |
@humphd @fabricereix Ok I can reproduce it with a simple setup: Flask file: from tests import app
from flask import Response
@app.route("/issue380")
def issue380():
headers = {
'Content-Type': 'text/html; charset=utf-8',
}
return Response('<h1>This is a fragment</h1>', headers=headers) Hurl file:
Execution: $ hurl tests/issue380.hurl
memory allocation of 18446744073709551613 bytes failed
Abort trap: 6 @humphd, we have all we need to find and fix this bug, it's not worth capturing the response or trying to reproduce your setup. Now, I'm really curious about it, it should not be too difficult to isolate it now we can reproduce it easily |
Great, I'm glad you can reproduce. I'll be interested to see what you discover as you debug. |
The bug is in the Hurl raw string body, when the raw string body is ending with a new line and we have to display an error: hurl/packages/hurl/src/cli/logger.rs Line 130 in c3718de
In this case, Anyway, as a patch, you could write your Hurl file like this: Before:
Patched:
Less clean, but this patch the bug in the raw string body.
Thank you for taking the time to write the issue, we're going to fix it asap on master |
Excellent. Your |
Note than relating to the whitespace in the asserts, Your Hurl file will become
|
The fix for the memory allocation has been merged into master (#382) and will be included in the 1.5.0. But we still have to work on the assert error messages for raw strings, which are not clear with newline content. |
I have a
.hurl
file that looks like this:When I run it with hurl, I get this:
Running it in
curl
works:The text was updated successfully, but these errors were encountered: