www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16783] New: std.net.curl application throws an exception

https://issues.dlang.org/show_bug.cgi?id=16783

          Issue ID: 16783
           Summary: std.net.curl application throws an exception
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: farukerdemoncel gmail.com

I try to compile this program from std.net.curl

import std.net.curl, std.stdio;

void main()
{
    auto range1 = byLineAsync("www.google.com");
    auto range2 = byLineAsync("www.wikipedia.org");
    foreach (line; byLineAsync("dlang.org"))
        writeln(line);

    foreach (line; range1) writeln(line);
    foreach (line; range2) writeln(line);
}

I compile this program like this.

    $ dmd internet.d -ofinternet

or

    dmd -I/usr/include/dmd/phobos -L-l:libcurl.so.4.2.0 internet.d -ofinternet

The program compiles fine but it throws an exception.

std.concurrency.PriorityMessageException std/concurrency.d(273): Priority
message
----------------
 ??:?
_D3std11concurrency10MessageBox160__T3getTDFS3std11concurrency3TidS3std3net4curl21__T11CurlMessageTAyaZ11CurlMessageZbTDFS3std11concurrency3TidS3std3net4curl19__T11CurlMessageTbZ11CurlMessageZbZ3getMFDFS3std11concurrency3TidS3std3net4curl21__T11CurlMessageTAyaZ11CurlMessageZbDFS3std11concurrency3TidS3std3net4curl19__T11CurlMessageTbZ11CurlMessageZbZ3ptyMFKS3std11concurrency36__T4ListTS3std11concurrency7MessageZ4ListZb
[0x81d03f4]
??:? bool std.concurrency.MessageBox.get!(bool delegate(std.concurrency.Tid,
std.net.curl.CurlMessage!(immutable(char)[]).CurlMessage), bool
delegate(std.concurrency.Tid,
std.net.curl.CurlMessage!(bool).CurlMessage)).get(bool
delegate(std.concurrency.Tid,
std.net.curl.CurlMessage!(immutable(char)[]).CurlMessage), bool
delegate(std.concurrency.Tid, std.net.curl.CurlMessage!(bool).CurlMessage))
[0x81cfeed]
??:? void std.concurrency.receive!(bool delegate(std.concurrency.Tid,
std.net.curl.CurlMessage!(immutable(char)[]).CurlMessage), bool
delegate(std.concurrency.Tid,
std.net.curl.CurlMessage!(bool).CurlMessage)).receive(bool
delegate(std.concurrency.Tid,
std.net.curl.CurlMessage!(immutable(char)[]).CurlMessage), bool
delegate(std.concurrency.Tid, std.net.curl.CurlMessage!(bool).CurlMessage))
[0x81cfd08]
??:? void
std.net.curl.AsyncLineInputRange!(char).AsyncLineInputRange.__mixin5.tryEnsureUnits()
[0x81ccb87]
??:?  property bool
std.net.curl.AsyncLineInputRange!(char).AsyncLineInputRange.__mixin5.empty()
[0x81cc7db]
??:? _Dmain [0x81b47b8]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x81d9292]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x81d91dc]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).runAll() [0x81d924e]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x81d91dc]
??:? _d_run_main [0x81d916e]
??:? main [0x81d3393]
??:? __libc_start_main [0x129532]

Sometimes it prints the web page's html content as expected but again it throws
this exception.

Steps to Reproduce:
1) Run Ubuntu 12.04 from memory stick.
2) Fresh install dmd
3) Try to compile and run program.

$ dmd -v
DMD32 D Compiler v2.072.0

Ubuntu 12.04 LTS

--
Nov 25 2016