[Klone-users] Seg fault in request_get_[get | post]arg
Stefano Barbato
barbato at koanlogic.com
Fri May 16 12:38:39 EDT 2008
Hi Mickael,
please try 2.1.1rc0. As usual just update the top-level makefile and
run a 'make clean && make'.
---[ Makefile ]---
KLONE_VERSION = 2.1.1rc0
...etc...
------------------
bye,
stefano
On 16/mag/08, at 15:48, Mickael Auger wrote:
> Hi,
>
> I test with a standard linux and with classic KLone 2.1.0. My webapp
> folder is attached to this mail (which use "request_get_postarg"
> function).
>
> Instead of use "request_get_arg", I use "request_get_[get |
> post]arg" functions.
> My index.kl1 is:
> ================================================
> <html>
> <head>
> <title>KLone start page</title>
> </head>
> <body>
>
> <form method="POST" action="/">
> <input type="text" name="var1" value="" />
> <input type="submit" name="send" value="Send" />
> </form>
> <%
> if(request_get_postarg(request,"send")!=NULL)
> {
> if(request_get_postarg(request,"var1")==NULL)
> {
> io_printf(out,"problem, var1 has not send");
> }
> else
> {
> io_printf(out,"ok, var1=\"%s
> \"",request_get_postarg(request,"var1"));
> }
> }
> %>
> </body>
> </html>
> ================================================
>
> I choose iterative model (in kloned.conf) and I launch kloned with
> valgrind and the next segmentation fault appears:
> ================================================
> [mickael at klone_linux test_2.1.0]$ valgrind ./kloned -Fd
> ==7094== Memcheck, a memory error detector.
> ==7094== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
> al.
> ==7094== Using LibVEX rev 1804, a library for dynamic binary
> translation.
> ==7094== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
> ==7094== Using valgrind-3.3.0, a dynamic binary instrumentation
> framework.
> ==7094== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
> al.
> ==7094== For more details, rerun with: -v
> ==7094==
> server_list: app_http
> allow_root: yes
> log:
> type: syslog
> syslog:
> facility: LOG_LOCAL0
> app_http:
> model: iterative
> type: http
> addr:
> type: IPv4
> port: 8080
> dir_root: /www
> ==7094== Invalid read of size 1
> ==7094== at 0x42CD3F3: strcasecmp (in /lib/i686/libc-2.3.2.so)
> ==7094== by 0x8059687: vars_geti (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x80596DE: vars_get (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x8056D1E: request_get_postarg (in /home/all_user/
> ug_ma/test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/
> kloned/kloned)
> ==7094== by 0x805E865: exec_page (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x8051309: supemb_serve_dynamic (in /home/all_user/
> ug_ma/test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/
> kloned/kloned)
> ==7094== by 0x80513E7: supemb_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x8050B8E: broker_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x804FC69: http_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x805B914: backend_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x804C888: server_be_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x804CBC5: server_dispatch (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== Address 0x0 is not stack'd, malloc'd or (recently) free'd
> ==7094==
> ==7094== Process terminating with default action of signal 11
> (SIGSEGV)
> ==7094== Access not within mapped region at address 0x0
> ==7094== at 0x42CD3F3: strcasecmp (in /lib/i686/libc-2.3.2.so)
> ==7094== by 0x8059687: vars_geti (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x80596DE: vars_get (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x8056D1E: request_get_postarg (in /home/all_user/
> ug_ma/test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/
> kloned/kloned)
> ==7094== by 0x805E865: exec_page (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x8051309: supemb_serve_dynamic (in /home/all_user/
> ug_ma/test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/
> kloned/kloned)
> ==7094== by 0x80513E7: supemb_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x8050B8E: broker_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x804FC69: http_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x805B914: backend_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x804C888: server_be_serve (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094== by 0x804CBC5: server_dispatch (in /home/all_user/ug_ma/
> test_2.1.0/klone-2.1.0/build/target/klone-core-2.1.0/src/kloned/
> kloned)
> ==7094==
> ==7094== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 25
> from 1)
> ==7094== malloc/free: in use at exit: 37,441 bytes in 152 blocks.
> ==7094== malloc/free: 428 allocs, 276 frees, 359,775 bytes allocated.
> ==7094== For counts of detected errors, rerun with: -v
> ==7094== searching for pointers to 152 not-freed blocks.
> ==7094== checked 250,152 bytes.
> ==7094==
> ==7094== LEAK SUMMARY:
> ==7094== definitely lost: 0 bytes in 0 blocks.
> ==7094== possibly lost: 0 bytes in 0 blocks.
> ==7094== still reachable: 37,441 bytes in 152 blocks.
> ==7094== suppressed: 0 bytes in 0 blocks.
> ==7094== Rerun with --leak-check=full to see details of leaked memory.
> Segmentation fault
> ================================================
>
> With our backtraces (without request_get_? functions) we often saw
> the call of "var_get" function before an illegal instruction.
>
> I hope this help you.
> Good luck :)
>
> --
> Mickaël AUGER
> mickael.auger at gmail.com
> <webapp.zip>_______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
More information about the klone-users
mailing list