Forum Topic - lighttpd 1.4.79 on QNX throws write() 8: Resource deadlock avoided : (4 Items)
   
lighttpd 1.4.79 on QNX throws write() 8: Resource deadlock avoided  
I was trying to deploy my JavaScript web application using lighttpd on my embedded system with QNX and noticed that my 1
 M of .chunk.js, which should be called and get rendered by index.html would only get transferred 307kB in network in 
devtools.
There was also an error message, "CONTENT_LENGTH_MISMATCH." As a result, my webpage would not get rendered properly and 
show a blank page. Refreshing constantly over 10 times would finally get me to the webpage. 
So, I checked the lighttpd_error.log and it says "write() 8: Resourced deadlock avoided." 
I tried different ways to resolve this issue, but no luck.
so, I reached out to lighttpd support and  gstrauss helped me resolve this issue.
He suggested two different ways:
1. disabling MMAP
2. recompile version 1.4.73 (QNX lighttpd upstream.)
Luckily, disable MMAP resolved this issue. 

What gstrauss wonders is why mmap() is returning EDEADLK and if there was some alignment restriction on QNX that 
lighttpd was not applying properly on QNX.
He also thinks that the behavior I've seen might come from the commit you made here: https://git.lighttpd.net/lighttpd/
lighttpd1.4/commit/7d2c009bb1310933d56f20b2c86fe8c24d3f5195
He will be adding this fix to the next lighttpd release. 

Here is the link to the chat on lighttpd support regarding this issue:
https://redmine.lighttpd.net/boards/2/topics/11987?r=12007
Re: lighttpd 1.4.79 on QNX throws write() 8: Resource deadlock avoided  
What version of QNX are you using? If this is 7.x, try turning on superlocking (-mL on the procnto command-line). The 
EDEADLK on mmap() can be the result of a circular dependency, where a page fault occurs on a message pass to a server, 
and the server is also the one that has to handle the page fault. There are ways to avoid this, but it can get quite 
subtle.
Note that 8.0 does not support recoverable page faults at all, so you should not see this behaviour. If you still do, 
then this may be a different issue.

--Elad
Re: lighttpd 1.4.79 on QNX throws write() 8: Resource deadlock avoided  
My QNX version is 7.0.4.
Unfortunately, the procnto command is not available on my system.
Re: lighttpd 1.4.79 on QNX throws write() 8: Resource deadlock avoided  
procnto is not a command - it's the kernel executable. Do you build your own image? If so, in the build file for the 
image file system (IFS) there is a line near the top that has procnto-smp-instr (or whatever variant of procnto-* your 
system uses). You add -mL and rebuild the image.
Any reason you need to use such an old version of QNX?

--Elad