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

Tags:
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:
Status:
RESOLVED INVALID

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

                var name = "log.txt";
                File.WriteAllText(name,"");

                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: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bcb)[0x7fb0046edbcb]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fb0047760b7]
/lib/x86_64-linux-gnu/libc.so.6(+0xdb3fb)[0x7fb0047583fb]
/usr/lib/libMonoPosixHelper.so(Mono_Posix_Syscall_open+0x29)[0x7fb00185e9e9]
[0x417551da]
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!