Hi Christian, welcome back!

I noticed the error too, and have a fix.

1. the locking should be BUSLOCK, not device lock.
2. A per-bus flag that increments with, say, RESET errors, will trigger a
reconnect after a certain threshold.
3. The flag will be set to 0 if reconnect is successful, or if a RESET can be
done.
4. The reconnect will be tried at a higher level, say at the start of reads,
writes, and directory listings. 
5. The potential race conditions can be avoided

Paul Alfille

-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Christian
Magnusson
Sent: Sun 3/19/2006 7:13 AM
To: [email protected]
Subject: [Owfs-developers] Bug when no adapter
 
 

I just noticed that a bug was introduced lately when owserver doesn't find
any usb adapter at startup. This could eventually happen when adapter was
found and later was reconnected due to some error.

BUS_selectection_error() is called, and reconnect is initiated.

A segmentation fault occurs in LockGet() since pn->ft is NULL when code
tries to reconnect.

 

I think the problem is located in ow_bus.c:BUS_reconnect_low() which tries
to lock a non-working adapter, and then call the DS9490_detect function (not
DS9490_reconnect). This may trig a new reconnect and we are in a dangerous
loop if now using some lock mechanism which I used for the USB adapter from
the beginning.

 

owserver -foreground -error_level=9 -error_print=2 -s 3009 -u &

owfs -s 3009 /tmp/1wire

 

cat /tmp/1wire/bus.0/system/adapter/*  (this works)

ls -l /tmp/1wire/   (segmentation fault in owserver)

 

 

I'm not really sure if I have time to fix it myself right now, but did you
have any better generic idea for redetection of all adapters? Is it needed
for all adapter types?

 

/Christian

 

 


<<winmail.dat>>

Reply via email to