Bug 55528 - UnixStream async write crash application
Summary: UnixStream async write crash application
Alias: None
Product: Class Libraries
Classification: Mono
Component: Mono.POSIX ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-04-24 15:53 UTC by congzhangzh
Modified: 2017-04-24 16:06 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description congzhangzh 2017-04-24 15:53:37 UTC
the follow code crash system:

                var name = "log.txt";

                int fd = Syscall.open(name,
                    OpenFlags.O_RDWR | //| OpenFlags.O_CREAT |
                    OpenFlags.O_APPEND | OpenFlags.O_LARGEFILE |
                    OpenFlags.O_ASYNC);//, FilePermissions.S_IRWXU);

                using (UnixStream fs = new UnixStream (fd))
                    var datas = UTF8.GetBytes("hello");
                    fs.Write(datas, 0, datas.Length); //not crash
                    await fs.WriteAsync(datas, 0, datas.Length); //crash here

                    datas = UTF8.GetBytes("world");
                    await fs.WriteAsync(datas, 0, datas.Length);

if I run rider ide from terminal, I get the follow line in the console:

*** invalid open call: O_CREAT or O_TMPFILE without mode ***: /usr/bin/mono terminated
======= Backtrace: =========
Comment 1 congzhangzh 2017-04-24 15:57:07 UTC
ReadAsync work well!
the fd is open already, why will system try to open again!