OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:36 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Null pointers and pointer safety
PostPosted: Wed May 31, 2017 8:47 pm 
Offline
Member
Member

Joined: Mon Jul 25, 2016 6:54 pm
Posts: 223
Location: Adelaide, Australia
goku420: I was more thinking of a static analysis situation where you're trying to find out before starting a program if it will fault or not. In that case you'd have to have to do some type of state machine analysis to determine if the variable will be valid in all cases when the code actually runs.


Top
 Profile  
 
 Post subject: Re: Null pointers and pointer safety
PostPosted: Wed May 31, 2017 9:09 pm 
Offline
Member
Member

Joined: Wed Jul 10, 2013 9:11 am
Posts: 51
StudlyCaps wrote:
goku420: I was more thinking of a static analysis situation where you're trying to find out before starting a program if it will fault or not. In that case you'd have to have to do some type of state machine analysis to determine if the variable will be valid in all cases when the code actually runs.


This would only work for degenerate cases like null pointer dereferences, otherwise like you said it is essentially the halting problem. However, the behavior of your page fault handler ultimately doesn't matter since the danger in invalid pointers comes from type punning, violating strict aliasing, out of bounds, etc. The latter three cases are easily caught by static analyzers.


Top
 Profile  
 
 Post subject: Re: Null pointers and pointer safety
PostPosted: Wed May 31, 2017 11:02 pm 
Offline
Member
Member

Joined: Mon Jul 25, 2016 6:54 pm
Posts: 223
Location: Adelaide, Australia
You misunderstand me I think. I'm deliberately giving an example of something that won't work (or that isn't practical)! Someone earlier in the thread proposed that all binaries could be statically analysed by the OS and that programs which have unsafe pointer use can just not be run, making the system more stable. I was giving a counter example to say, in this case, that isn't feasible.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group