Bug 60909 - Java.IO.FileNotFoundException: /proc/stat: open failed: EACCES (Permission denied)
Summary: Java.IO.FileNotFoundException: /proc/stat: open failed: EACCES (Permission de...
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 8.0 (15.4)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-11-29 11:29 UTC by Saravanan
Modified: 2017-11-30 17:01 UTC (History)
2 users (show)

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


Attachments
Sample Project (38.39 KB, application/x-zip-compressed)
2017-11-29 11:29 UTC, Saravanan
Details
Error logs (178.88 KB, text/plain)
2017-11-29 11:31 UTC, Saravanan
Details


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 Developer Community or GitHub 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 ANSWERED

Description Saravanan 2017-11-29 11:29:45 UTC
Created attachment 25860 [details]
Sample Project

I have migrated to Xamarin Android 8.0. Trying to access below (RandomAccessFile) statement but getting "Java.IO.FileNotFoundException: /proc/stat: open failed: EACCES (Permission denied" error. The same functionality is working in Android lower version tablets (Android 5, 6,..).

RandomAccessFile reader = new RandomAccessFile("/proc/stat", "r");

Sample project attached. 
Reproduce step: Launch the application on Android 8.0 (Used Pixel C) tablet and click on button.


System Info:

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Professional

Visual Basic 2015   00322-50050-56982-AA785
Microsoft Visual Basic 2015

Visual C# 2015   00322-50050-56982-AA785
Microsoft Visual C# 2015

Visual C++ 2015   00322-50050-56982-AA785
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   7.18.00214.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JetBrains ReSharper Ultimate 2016.2    Build 106.0.20160818.163633
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Team Foundation Server 2015 Power Tools   14.0
Power Tools that extend the Team Foundation Server integration with Visual Studio.

Microsoft Visual Studio Process Editor   1.0
Process Editor for Microsoft Visual Studio Team Foundation Server

Mono Debugging for Visual Studio   4.7.4-pre (c2d89eb)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   4.7.10.38 (34c1b6c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   8.0.2.1 (c2a33d8)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   11.3.0.47 (51128b8)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Saravanan 2017-11-29 11:31:22 UTC
Created attachment 25861 [details]
Error logs

Error log attached
Comment 2 Marek Habersack 2017-11-30 17:01:57 UTC
These restrictions are part of more strict security in the newer Android versions. There's nothing Xamarin.Android can do to work around this restriction as it's enforced by the OS kernel. Android has been restricting access to various bits of information from the Linux kernel for a while now. You might try to obtain the same information from sysfs (which should be mounted on /sys) or find appropriate Java API to obtain the information using privileged services.