Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - System hangs with "initSocket -247" message on the console: (3 Items)
   
System hangs with "initSocket -247" message on the console  
hello all

I have a x86 platform running qnx 6.5.0:

$ uname -a
QNX myLSU 6.5.0 2012/06/20-13:50:45EDT x86pc x86

and io-pkt-v6-hc variant of io-pkt.

I need to mount/unmount several times a custom "devnp_" network driver into io-pkt (not a real hardware device driver, 
it will register a set of virtual interfaces for intercepting/injecting software-produced packets).
This has always worked fine (and still it does) under 6.4.1 qnx version.

Under qnx 6.5.0, I often get a system hang when mounting the devnp_ module into io-pkt: platform becomes unreachable via
 networking (ping does not get responses), and the local USB keyboard/console is not responding. Local monitor reports 
one or more messages saying:

initSocket -247

I noticed that often the same message appears on the console when I want to shutdown the system (shutdown -b), probably 
when the io-pkt process is killed.

The hang is not systematic, but it seems to me that it happens more often with io-pkt-v6-hc than with io-pkt-v4, and 
also more often with my devnp_ module left symbol-unstripped than when I strips symbols out of it ! (does it make any 
sense??)

So, my first question is: what does "initSocket -247" means and what should I start investigating on?

Is there some incompatibilities in network drivers binaries compiled under 6.4.1 devel env, when mounted against qnx 6.5
.0 io-pkt targets?

thanks
Davide
Re: System hangs with "initSocket -247" message on the console  
I think the "initSocket -247" message is coming from slinger - do you have slinger running and do you try to restart it 
if it fails? Errno 247 is EAFNOSUPPORT. Unfortunately slinger does a number of operations in initSocket() so we cannot 
tell which has gone wrong. I suspect though that this is just a secondary affect of the problem within io-pkt itself 
caused by the driver.

We try to maintain forwards compatibility on the driver API and I don't recall any changes that would break a 6.4.1 
devnp driver from working on a 6.5.0 io-pkt. It may be that there was always an underlying problem in the driver and a 
change in the timing or similar may be causing the issue to get hit more frequently, this could also explain the 
variance with respect to io-pkt version and driver stripped or with symbols.

With io-pkt running at priority 21 by default, if it starts spinning on the CPU then the rest of the system can appear 
unresponsive. You can try lowering the thread priorities on io-pkt with -P for the main thread and -p tcpip rx_prio= for
 the receive threads, but note that the driver may register interrupt threads at any priority that is not affected by 
these parameters.

One area we have seen in a lot of drivers is that if callout_init() gets called again (e.g. from the driver's init 
function which gets called multiple times) after a callout has been started with callout_msec() then that can cause io-
pkt to spin. I would set up any callouts through callout_init() in the attach function and then leave it alone apart 
from scheduling with callout_msec() and stopping it with callout_stop().
Re: System hangs with "initSocket -247" message on the console  
thanks a lot, Nick!

yours are very useful infos, I'll give a deeper view to my driver code.
I also suspect there is a potential problem which has not been triggered until now due to different timings.

I'm back in the office today after my holidays, so I'll need some time to jump again into this investigation... however 
I'll be back here for any other doubt, if any.

thanks again
Davide