[so] [tema3]test4

Marius Viorel Grigoras grigorasmariusviorel at gmail.com
Fri May 1 18:40:24 EEST 2009


if (info->si_code != SEGV_ACCERR)
        return;
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.
La mine cicleaza aici, am analizat cu gdb-ul static void segv_handler (int
signum, siginfo_t *info, void *context):

received signal SIGSEGV, Segmentation fault.
0x08049134 in write_read (page_id=0, expected=-1, offset=220) at test.c:182
182             * (int *) ((char *) start + page_id * p_sz + offset) = mval;
(gdb)
segv_handler (signum=11, info=0xbfe96ffc, context=0xbfe9707c) at test.c:73
73      {
(gdb)
74              if (signum != SIGSEGV)
(gdb)
76              if (info->si_signo != SIGSEGV)
(gdb)
78              if (info->si_code != SEGV_ACCERR)
(gdb)
84      }
(gdb)

Program received signal SIGSEGV, Segmentation fault.
0x08049134 in write_read (page_id=0, expected=-1, offset=220) at test.c:182
182             * (int *) ((char *) start + page_id * p_sz + offset) = mval;
(gdb)
segv_handler (signum=11, info=0xbfe96ffc, context=0xbfe9707c) at test.c:73
73      {
(gdb)
74              if (signum != SIGSEGV)
(gdb)
76              if (info->si_signo != SIGSEGV)
(gdb)
78              if (info->si_code != SEGV_ACCERR)
(gdb)
84      }
(gdb) print info->si_code
$3 = 1
(gdb)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20090501/02f5763d/attachment-0001.htm>


More information about the so mailing list