Skip to content
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

The Hashlink profiler causes an exception in Process.stdout.readLine #650

Closed
LostBranch5502 opened this issue Feb 3, 2024 · 0 comments
Closed

Comments

@LostBranch5502
Copy link
Contributor

Running the Hashlink profiler results in an exception if the program being profiled calls sys.io.Process.stdout.readLine.

Versions

  • Haxe: 4.3.3
  • Hashlink 1.13.0
  • Operating System: Ubuntu Linux 20.04.6 LTS (64-bit)

Reproducing

The issue should appear with the following test program:

import sys.io.Process;

class Main
{
    static public function main():Void
    {
        //var result = new Process("echo", ["Text from the Process."]).exitCode(); // This line works also with the profiler
        var result = new Process("echo", ["Text from the Process."]).stdout.readLine(); // This line works only without the profiler
        trace('$result');
    }
}

The program works with or without the profiler if Process.stdout.readLine is not called. The program also works when calling Process.stdout.readLine, but only if the profiler is not used. If Process.stdout.readLine is called and the program is being run with the profiler (hl --profile 1000 test.hl), the following exception happens:

Uncaught exception: Eof
Called from haxe.io.Input.readLine(.../haxe-4.3.3-linux64/haxe_20231117191750_de28889/std/haxe/io/Input.hx:189)
Called from $Main.main(Main.hx:7)
Called from .init(?:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant