Hi,
We spotted that, if the following conditions are met, then a malformed HTTP
request will make a Naviserver assert fail (4.99.15).
- Naviserver is compiled with --enable-symbols
- At least 1 writerthread is running
- A malformed HTTP request is made to a fastpath file which is bigger
than writersize
I have 2 questions.
1. Is there a way of compiling Naviserver with debug symbols included, but
with NDEBUG flag set as to not abort when an assert fails?
2. Is the failing assert showing us something interesting?
A test case which demonstrates the assert failure from a fresh Naviserver
build on Debian 8.7 (kernel 3.16.0-4-amd64) is the following:
*SERVER*
hg clone https://bitbucket.org/naviserver/naviserver
cd naviserver
./autogen.sh --enable-rpath *--enable-symbols* --enable-threads
make
make install
chown -R nsd /usr/local/ns/logs/
cd /usr/local/ns/pages
wget www.qcode.co.uk
Edit:
/usr/local/ns/conf/nsd-config.tcl
In the ns/server/default/module/nssock section add:
ns_param writerthreads 1
ns_param writersize 1
Run:
/usr/local/ns/bin/nsd -c -u nsd -t /usr/local/ns/conf/nsd-config.tcl
*CLIENT*
echo "GET /index.html" > index.txt
cat index.txt | nc <server-ip> 8080
*SERVER*
[13/Feb/2017:18:06:40][22169.7fb8a27fc700][-driver:nssock:0-] Notice:
pre-HTTP/1.0 request <GET /index.html>
nsd: driver.c:4872: NsWriterQueue: Assertion `wrSockPtr->headerString ==
((void *)0)' failed.
Aborted
The assert that's failing, driver.c:4872 is:
assert(wrSockPtr->headerString == NULL);
https://bitbucket.org/naviserver/naviserver/src/443eb0b47a9fa0eb55d1bdd9f3a90ff92db55aa1/nsd/driver.c?at=default&fileviewer=file-view-default#driver.c-4873
(In the debugger, headerString is showing as "")
Thanks for any help.
Regards,
--
David
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel