Closed tom-tan closed 1 year ago
Hello, @tom-tan
Thanks for report, will check it soon
hello, @tom-tan!
Can confirm the problem. Looks like something wrong happens with stream copy
. Looking into it
btw, I get different message `
PASV < 227 Entering Passive Mode (130,14,250,13,195,113). RETR README.txt < 150 Opening BINARY mode data connection for README.txt (4535 bytes) < 226 Transfer complete CWD / core.exception.OutOfMemoryError@core/lifetime.d(126): Memory allocation failed `
hello, @tom-tan
I can't figure out what's going on. This code works for dmd both in debug and in release mode, and do not work for ldc2 only in debug mode... It's too weird for me :(
Some details: looks like receiveAsRange structure somehow become corrupted, but after few days of debugging I can't find where and how it could happen.
Thank you for investigating the problem.
I checked with several compilers and got different results :-( I got the results with Ubuntu 22.04 on docker 23.0.1 on WSL2 on Windows 11.
dmd 2.102.0
$ ./sample.d
...
> CWD /
< 250 CWD command successful
ldc 1.30.0
$ ./sample.d
...
> RETR README.txt
< 150 Opening BINARY mode data connection for README.txt (4535 bytes)
< 226 Transfer complete
Program exited with code -11
ldc 1.31.0
$ ./sample.d
...
< 226 Transfer complete
> CWD /
< 250 CWD command successful
core.exception.OutOfMemoryError@core/lifetime.d(126): Memory allocation failed
ldc 1.32.0
$ ./sample.d
...
< 226 Transfer complete
> CWD /
core.exception.OutOfMemoryError@core/lifetime.d(126): Memory allocation failed
Hello @tom-tan
can you please check same setup but with -b release?
I think that there can be some problem related to ldc optimisations
Thank you for your advice.
can you please check same setup but with -b release?
I checked and found that it works without errors with ldc 1.30.0, 1.31.0 and 1.32.0 with -b release
.
$ dub run -b release --single sample.d
...
< 226 Transfer complete
> CWD /
< 250 CWD command successful
@tom-tan I'll close it as I do not know where to move with this strange problem
How to reproduce
I reproduce it with ldc 1.30.0 on Ubuntu 22.04 (in Docker container).
sample.d:
And run the following command:
Expected behavior
README.txt
is downloaded without errors.Actual behavior
It causes segfault with the following messages:
I confirmed that a similar code with
useStreaming: false
works without errors.