[so] Tema5: Protectie ciudata
zvirid traian
so@cursuri.cs.pub.ro
Sat, 12 Feb 2005 02:44:47 -0800 (PST)
--0-1710250879-1108205087=:33254
Content-Type: text/plain; charset=us-ascii
int dif = (int)(info->si_addr - (void*)adr_v);
da un printf inainte si dupa ca sa fi sigur ca esti in handler
unde adr_v e adresa intoarsa de mmap.
Claudiu-Florin FILIMON <fili@mymail.ro> wrote:
Problema cam aiurea pe linux:
Mapez o zona de memorie anonima cu mmap si protectie NONE. Apoi setez un handler pe SIGSEGV cu sigaction.
Daca accesez zona de memorie imi intra in handler, imi completeaza corect signum si info->si_signo, dar info->si_addr este pe 0, orice i-as face.
Chestia asta imi cam baga niste bete in roate... Are cineva idee de la ce e?
Have FUN,
FeeL E!
---------------------------------
Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'
--0-1710250879-1108205087=:33254
Content-Type: text/html; charset=us-ascii
<DIV><FONT size=2>
<P> </P>
<P>int dif = (int)(info->si_addr - (void*)adr_v);</P>
<P>da un printf inainte si dupa ca sa fi sigur ca esti in handler</P>
<P>unde adr_v e adresa intoarsa de mmap.</FONT><BR><BR><B><I>Claudiu-Florin FILIMON <fili@mymail.ro></I></B> wrote:</P>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
<DIV><FONT face=Arial size=2>Problema cam aiurea pe linux:</FONT></DIV>
<DIV><FONT face=Arial size=2>Mapez o zona de memorie anonima cu mmap si protectie NONE. Apoi setez un handler pe SIGSEGV cu sigaction.</FONT></DIV>
<DIV><FONT face=Arial size=2>Daca accesez zona de memorie imi intra in handler, imi completeaza corect signum si info->si_signo, dar info->si_addr este pe 0, orice i-as face.</FONT></DIV>
<DIV><FONT face=Arial size=2>Chestia asta imi cam baga niste bete in roate... Are cineva idee de la ce e?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Have FUN,</FONT></DIV>
<DIV><FONT face=Arial size=2>FeeL E!</FONT></DIV></BLOCKQUOTE></DIV><p>
<hr size=1>Do you Yahoo!?<br>
Yahoo! Search presents - <a href="http://us.rd.yahoo.com/evt=30648/*http://movies.yahoo.com/movies/feature/jibjabinaugural.html">Jib Jab's 'Second Term'</a>
--0-1710250879-1108205087=:33254--