On 25/11/15 14:56, Jan Kandziora wrote:
> Am 25.11.2015 um 10:03 schrieb Stefano Miccoli:
>> Cannot check right now, but if I didn’t do something terribly wrong I
>> should be at the latest commit on master, so below e85572.
>>
>> It seems to me that actually e85572 introduced the bug:
>>
>> http://sourceforge.net/p/owfs/code/ci/e855721f4e02fd93b5345ba8e89462043973ba28/tree/module/owlib/src/c/ow_read.c?diff=706f0c578a6f77daf9fb3dca0af7fd608d5e0ca4
>>
>>   In fact you cannot read a directory, so at the very beginning of
>> FS_read_postparse you should have at least
>>
>> // ServerRead jumps in here, perhaps with non-file entry if
>> (pn->selected_filetype == NO_FILETYPE) { return -EISDIR; }
>>
> That's exactly the problem I was addressing with that commit. When you
> do it that simple way, there is *no way* you can export external sensors
> via owserver to owlib based clients. Which makes it kind of pointless to
> have this feature at all.
>
I can confirm this is the issue, was just about to post a new message 
when I recalled this discussion from yesterday.
When doing 'owread' on a dir entity (random device root for example):

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 802410400 (LWP 102160/owserver)]
0x00000008008ae509 in DeviceLockGet (pn=0x7fffdfdfc2d8) at 
ow_devicelock.c:71
71              if ( pn->selected_filetype->read == FS_r_external || 
pn->selected_filetype->write == FS_w_external ) {
(gdb) where
#0  0x00000008008ae509 in DeviceLockGet (pn=0x7fffdfdfc2d8) at 
ow_devicelock.c:71
#1  0x00000008008f471f in FS_r_given_bus (owq=0x7fffdfdfc2c0) at 
ow_read.c:243
#2  0x00000008008f3f6c in FS_read_postparse (owq=0x7fffdfdfc2c0) at 
ow_read.c:83
#3  0x0000000000403367 in ReadHandler (hd=0x7fffdfffdeb8, 
cm=0x7fffdfdfcf80, owq=0x7fffdfdfc2c0) at read.c:80
#4  0x0000000000404665 in DataHandler (v=0x7fffdfffdeb8) at data.c:145
#5  0x00000008013bb7c5 in pthread_create () from /lib/libthr.so.3
#6  0x00007fffdfbfd000 in ?? ()

Re-adding the -EISDIR check fixes the issue (but, I assume, restore the 
original external issue).
If we have no proper fix for the original external issue right now, I 
suggest re-adding this check until we do have a proper fix, so at least 
accidental reads on normal bus does not lead to crashes.

Johan

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to