[Klone-users] (no subject)
thomas fossati
tho at koanlogic.com
Fri Dec 21 11:42:38 EST 2007
Hi Radek,
On Dec 21, 2007, at 4:26 PM, Radek wrote:
> what's wrong on following code:
>
> -------[ component/user.kl1 ]--------
>
> [CUT]
>
> user_kl1.username = session_get(session, "username");
> user_kl1.logout = request_get_arg(request, "logout");
you should test user_kl1.logout as it could be 'NULL' in which case the
following strcmp() dies badly:
> if (strcmp(user_kl1.logout, "1") == 0) {
> session_del(session, "username"); // <-------- there program fails
> }
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x0003efce in exec_page (rq=0x100410, rs=0x100580, ses=0x804400) at
radek.kl1:24
24 if (strcmp(user_kl1.logout, "1") == 0) {
(gdb) bt
#0 0x0003efce in exec_page (rq=0x100410, rs=0x100580, ses=0x804400) at
radek.kl1:24
#1 0x0000ea81 in supemb_serve_dynamic (rq=0x100410, rs=0x100580,
e=0x5cdd4) at sup_emb.c:253
#2 0x0000ed76 in supemb_serve (rq=0x100410, rs=0x100580) at
sup_emb.c:298
#3 0x00013fd9 in broker_serve (b=0x1006c0, h=0x100a90, rq=0x100410,
rs=0x100580) at broker.c:72
#4 0x00011e3a in http_serve (h=0x100a90, fd=4) at http.c:568
#5 0x000131bc in http_backend_serve (be=0x100670, fd=4) at http.c:826
#6 0x00035381 in backend_serve (be=0x100670, fd=4) at backend.c:129
#7 0x000055bd in server_be_serve (s=0x100af0, be=0x100670, ad=4) at
server.c:653
#8 0x00005ff2 in server_dispatch (s=0x100af0, fd=3) at server.c:811
#9 0x00006b4c in server_loop (s=0x100af0) at server.c:976
#10 0x000093a8 in app_run () at main.c:142
#11 0x000099fe in main (argc=2, argv=0xbffff670) at entry.c:408
(gdb)
ciao, t.
More information about the klone-users
mailing list