vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.75k stars 2.16k forks source link

crash on http.get with invalid site #8105

Closed Ivo-Balbaert closed 1 year ago

Ivo-Balbaert commented 3 years ago

V version: OS:

OS: windows, Microsoft Windows 10 Home v19042 64-bit Processor: 12 cpus, 64bit, little endian, Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz CC version: N/A

getwd: c:\v vmodules: C:\Users\ivoba.vmodules vroot: C:\v vexe: C:\v\v.exe vexe mtime: 2021-01-14 09:46:12 is vroot writable: true is vmodules writable: true V full version: V 0.2.1 aa87816

Git version: git version 2.29.2.windows.2 Git vroot status: 0.2-457-gaa878161 .git/config present: true thirdparty/tcc status: thirdparty-windows-amd64 8836aa8f

What did you do? Tried to run the Docs example (in: Handling optionals)

import net.http

if resp := http.get('https://x1y2z3.com') {
    println(resp.text) // resp is a http.Response, not an optional
} else {
    println(err)
}

What did you expect to see? An HTML error like 404 Page not found

What did you see instead?

Unhandled Exception 0xC0000005 C:/Users/ivoba/AppData/Local/Temp/v/if_unwrapping.17279033976113031601.tmp.c:7506: at print_backtrace_skipping_top_frames_tcc: Backtrace C:/Users/ivoba/AppData/Local/Temp/v/if_unwrapping.17279033976113031601.tmp.c:7474: by print_backtrace_skipping_top_frames C:/Users/ivoba/AppData/Local/Temp/v/if_unwrapping.17279033976113031601.tmp.c:7529: by unhandled_exception_handler 7ffc89aa83dc : by ??? 7ffc89a75f86 : at ???: RUNTIME ERROR: invalid memory access

ntrel commented 3 years ago

I updated your example. BTW please wrap code next time ;-)

```v
code
```
medvednikov commented 3 years ago

I get correct error handling cannot connect the endpoint

So looks like a windows only issue.

M90K7 commented 3 years ago

windows 10 pro Same issue when address is filter but access with VPN proxy right.

danieldaeschle commented 3 years ago

On windows I also get this:

➜  v git:(master) ✗ v -cc msvc run main.v
Error 10057 sending data to server (1)
Error performing handshake
ArtemkaKun commented 1 year ago

I decided to close this issue since there is no more crush anymore. Wrong error message was addressed in #16968