if (info->si_code != SEGV_ACCERR)<br> return;<br>Am observat ca SEGV_ACCERR are valoarea 2. Ce inseamna cand info->si_code are valoarea 1? Mi se intampla la testul 4 dupa ce a facut un _read si apoi incearca un write_read.<br>
La mine cicleaza aici, am analizat cu gdb-ul static void segv_handler (int signum, siginfo_t *info, void *context):<br><br><div class="nH"><div style="height: 200px;" class="nH ko"><div class="Z8Dgfe"><div id=":1ez" class="kf">
<div class="km"><div class="kk"><span dir="ltr" id=":1ey">received signal SIGSEGV, Segmentation fault.<br>0x08049134 in write_read (page_id=0, expected=-1, offset=220) at test.c:182<br>182 * (int *) ((char *) start + page_id * p_sz + offset) = mval;<br>
(gdb)<br>segv_handler (signum=11, info=0xbfe96ffc, context=0xbfe9707c) at test.c:73<br>73 {<br>(gdb)<br>74 if (signum != SIGSEGV)<br>(gdb)<br>76 if (info->si_signo != SIGSEGV)<br>(gdb)<br>
78 if (info->si_code != SEGV_ACCERR)<br>(gdb)<br>84 }<br>(gdb)<br><br>Program received signal SIGSEGV, Segmentation fault.<br>0x08049134 in write_read (page_id=0, expected=-1, offset=220) at test.c:182<br>
182 * (int *) ((char *) start + page_id * p_sz + offset) = mval;<br>(gdb)<br>segv_handler (signum=11, info=0xbfe96ffc, context=0xbfe9707c) at test.c:73<br>73 {<br>(gdb)<br>74 if (signum != SIGSEGV)<br>
(gdb)<br>76 if (info->si_signo != SIGSEGV)<br>(gdb)<br>78 if (info->si_code != SEGV_ACCERR)<br>(gdb)<br>84 }<br></span><span dir="ltr" id=":1fo">(gdb) print info->si_code<br>$3 = 1<br>
(gdb)</span><br></div></div></div><div id=":1f0" class="kd"> </div></div></div></div><div class="nH"><div class="jp"><div class="jU"><div style="overflow: auto;" class="nH"><br></div></div></div></div><br>