Bug 53300 - shared violation on path /dev/usb/lp0
Summary: shared violation on path /dev/usb/lp0
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-03-14 08:42 UTC by Roman
Modified: 2017-03-14 08:42 UTC (History)
2 users (show)

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


Attachments

Description Roman 2017-03-14 08:42:59 UTC
Hello, developers. Why does mono become a worse and a worse last time?

First problem:

I have application which works with printer on usb interface. I use a FileStream for port managing. And during one application session I can open port just one time and next time I get error shared violation on path /dev/usb/lp0. If application close and run again port open one time too and next time I again get error shared violation on path /dev/usb/lp0.
I've tried to use different FileStream constructor overrides and problem was resolved FileStream(parameters2.PortName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite) although on 2.10 version mono a FileStream(parameters2.PortName, FileMode.Open) was enough for normal working. I close port as 

usbPort.Close();
usbPort.Dispose();
usbPort = null;

I assume that port must be opened in exclusive mode, none sharing.


Second problem:

I have two applications. First is monogame second is winforms. So I run monogame using code option for window "fullscreen = true" without hiding mouse cursor, above monogame I run winforms application as screensaver using next options:

this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

Sometimes when winforms was closed I see black screen with mouse cursor instead monogame application. Also under monogame must be a terminal emulator but I can't see it even using Alt+TAB. Only black screen and mouse cursor are on my display. If I run a killall mono in a new terminal emulator that old terminal emulator and desktop achieve. I repeat that it happens not every time it happens sometimes. 
I used 2.10 mono version since 2012 and I never notice such bugs there.

Note You need to log in before you can comment on or make changes to this bug.