Stefano Miccoli | 28 Aug 13:00 2014

bug in owlib/src/c/ow_net_server.c

Hi,

commit 2e36ac0ecefb45ff4b741a9afe4d33a40025e346
Author: Paul Alfille <paul.alfille <at> gmail.com>
Date:   Tue Aug 26 15:23:36 2014 -0400

    Coverity changes
    
    Not sure if these are really issues, but making changes for Coverity
    scanning error.


The above commit introduces a Coverity induced bug!

in file module/owlib/src/c/ow_net_server.c memory cleanup belongs to the child thread (routine ProcessAcceptSocket) and not to the calling routine (ProcessListenSocket).

In fact pthread_create returns before processing in ProcessAcceptSocket is ended, so struct asd must not be freed in the calling routine.

A patch that undoes the modification is enclosed.

Stefano

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Owfs-developers mailing list
Owfs-developers <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Stefano Miccoli | 24 Aug 14:38 2014

patch: owserver crash due to unintialized Mutex.aliasfind_mutex

Hi,

my owserver (current development git version) crashes on OSX when one tries to read
/settings/alias/list. (This does not happens on Linux).

I found out that this is due to an uninitialized member in the global struct Mutex, see
module/owlib/src/include/ow_mutexes.h On the hunt for similar errors I found other struct Mutex
members that are not initialized and/or not used.

The attached patch fixes this problem.

Actions are

1) init Mutex.aliaslist_mutex
2) delete reference to unused Mutex.simul_mutex, Mutex.aliasfind_mutex
3) correct a fprintf call from  fprintf(stderr, buf) to fprintf(stderr, "%s", buf). This latter
correction may seem unnecessary, but the CLANG compiler flags fprintf(stderr, buf) as a security
problem, and I think that although the injection of malicious code into 'buf' is very unlikely, it is
always better to stay on the safe side.

Regards, 

Stefano


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Owfs-developers mailing list
Owfs-developers <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Jan Kandziora | 23 Aug 22:34 2014
Picon
Picon

Problems with multiple owservers when network components fail

Hi all,

I have problems with the network timeout in a system with multiple
owservers.

The x86 master and three Raspberry Pi are each one equipped
with a self-made (sources identical) Linux distribution running
owfs-2.9p0. They all have DS9490 host adaptors and all run owservers to
access it. On the master, there is a Tcl application which accesses the
owservers through owtcl. The system runs smoothly as long all components
are there and functional.

But hardware may fail and that isn't handled gracefully enough by owfs
by now. When I pull a network cable to one of the raspis and do

% ow get alarm

on the master or even scan a single bus

% ow get bus.1/alarm

which happens to be "away", that command takes at least some seconds,
but sometimes up to a minute to return. I tried tweaking the
settings/timeout/network parameter, but it doesn't seem to do anything.

I'd wish that owfs would return *an error* and do it *much sooner*
(<<one second) so I can react to that failure on the application level
before watchdogs on the other hardware on the still working buses trigger.

Question: How to tweak the owserver handling so I get a shorter timeout
and an error message from owfs about the network failure?

Kind regards

	Jan

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
Colin Law | 23 Aug 14:45 2014
Picon

OWFS on TP-Link TL-WR703N

Hi

I have seen suggestions that a cheap wifi 1-wire hub can be made using
a TL-WR703N and a USB/1-wire adaptor. using openWRT and owserver.

I can't find any reports by anyone that has actually done this
however.  Has anybody here had a go or got a reference to someone that
has?

Colin

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
Hans-Frieder Vogt | 23 Aug 00:24 2014
Picon
Picon

[RESOLVED, PATCH] off-by-one bug in ownet/ow_server.c

with 2.9p5, suddenly the ownetexample program does not work any more. I get 
the error message
OWNET_dirprocess error: -5)

The reaseon for this error is an off by one error, that was introduced 
somewhere between 2.9p0 (worked) and 2.9p5.
The patch below restores the correct function of the ownet library.

Kind regards,
Hans-Frieder

--- owfs-2.9p5.orig/module.orig/ownet/c/src/c/ow_server.c	2014-04-26 
17:48:46.000000000 +0200
+++ owfs-2.9p5/module/ownet/c/src/c/ow_server.c	2014-08-23 00:01:52.900939548 
+0200
 <at>  <at>  -509,7 +509,7  <at>  <at>  static int WriteToServer(int file_descri
 		io[nio].iov_base = (char *) sp->path ; // gives a spurious compiler 
error -- constant is OK HERE!
 #endif
 		io[nio].iov_len = strlen(sp->path) + 1;
-		payload =  io[nio].iov_len +1;
+		payload =  io[nio].iov_len;
 		nio++;
 		LEVEL_DEBUG("ToServer path=%s\n", sp->path);
 	}

Hans-Frieder Vogt                       e-mail: hfvogt <at> gmx .dot. net

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
Johan Ström | 16 Aug 11:46 2014
Picon

owfs 2.9p5 now in FreeBSD ports tree

Hi,

I'd like to announce that my efforts to get OWFS into the FreeBSD ports 
tree has been successful!
With the help of commiter John Marino we now have 
http://www.freshports.org/comms/owfs, FreeBSD users should thus be able 
to install owfs using their package manager.

Regards
Johan

------------------------------------------------------------------------------
Gregg Levine | 15 Aug 01:08 2014
Picon

Using the RasPi for OWFS

Hello!
I've gone ahead and glommed the ones that the repositories have for
OWFS for the Raspberry Pi.

The problem is that I've got an FTDI based adapter plugged in which
was found at ttyUSB0, but the service isn't. It is indeed running, and
I configured the supplied one for that adapter and attempted to bring
up owhttpd. Each time I get nothing on the Chrome screen on the
laptop.

Any suggestions on where to go from there?

-----
Gregg C Levine gregg.drwho8 <at> gmail.com
"This signature fought the Time Wars, time and again."

------------------------------------------------------------------------------
Gregg Levine | 14 Aug 07:20 2014
Picon

Interesting problem in 2.9p5 for the Raspberry Pi

Hello!
I extracted the contents and then realized that I needed to install
the development things for the fuse layers. Before that I went along
and followed the usual steps. I noticed the lacking of those items
when I tried to build the owfs entry. Now with the fuse developer
layers installed this happens for building owfs:
root <at> raspberrypi:/usr/src/owfs/owfs-2.9p5/module/owfs# make
Making all in src
make[1]: Entering directory `/usr/src/owfs/owfs-2.9p5/module/owfs/src'
Making all in c
make[2]: Entering directory `/usr/src/owfs/owfs-2.9p5/module/owfs/src/c'
gcc -DHAVE_CONFIG_H -I. -I../../../../src/include    -I../include
-I../../../owlib/src/include -L../../../owlib/src/c -fexceptions -Wall
-W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wredundant-decls -D_FILE_OFFSET_BITS=64
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1
-D_POSIX_C_SOURCE=200112L  -pthread -g -O2 -D_XOPEN_SOURCE=500
-D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -MT
owfs.o -MD -MP -MF .deps/owfs.Tpo -c -o owfs.o owfs.c
mv -f .deps/owfs.Tpo .deps/owfs.Po
gcc -DHAVE_CONFIG_H -I. -I../../../../src/include    -I../include
-I../../../owlib/src/include -L../../../owlib/src/c -fexceptions -Wall
-W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wredundant-decls -D_FILE_OFFSET_BITS=64
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1
-D_POSIX_C_SOURCE=200112L  -pthread -g -O2 -D_XOPEN_SOURCE=500
-D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -MT
owfs_callback.o -MD -MP -MF .deps/owfs_callback.Tpo -c -o
owfs_callback.o owfs_callback.c
mv -f .deps/owfs_callback.Tpo .deps/owfs_callback.Po
gcc -DHAVE_CONFIG_H -I. -I../../../../src/include    -I../include
-I../../../owlib/src/include -L../../../owlib/src/c -fexceptions -Wall
-W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wredundant-decls -D_FILE_OFFSET_BITS=64
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1
-D_POSIX_C_SOURCE=200112L  -pthread -g -O2 -D_XOPEN_SOURCE=500
-D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -MT
fuse_line.o -MD -MP -MF .deps/fuse_line.Tpo -c -o fuse_line.o
fuse_line.c
mv -f .deps/fuse_line.Tpo .deps/fuse_line.Po
/bin/bash ../../../../libtool  --tag=CC   --mode=link gcc -I../include
  -I../../../owlib/src/include -L../../../owlib/src/c -fexceptions
-Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wredundant-decls -D_FILE_OFFSET_BITS=64
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1
-D_POSIX_C_SOURCE=200112L  -pthread -g -O2 -D_XOPEN_SOURCE=500
-D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L   -o owfs
owfs.o owfs_callback.o fuse_line.o -low      -lm -ldl
libtool: link: gcc -I../include -I../../../owlib/src/include
-fexceptions -Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual
-Wcast-align -Wstrict-prototypes -Wredundant-decls
-D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1
-D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -pthread -g -O2
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1
-D_POSIX_C_SOURCE=200112L -o .libs/owfs owfs.o owfs_callback.o
fuse_line.o  -L../../../owlib/src/c
/usr/src/owfs/owfs-2.9p5/module/owlib/src/c/.libs/libow.so -lm -ldl
-pthread
owfs.c:134: error: undefined reference to 'fuse_main_compat2'
collect2: ld returned 1 exit status
make[2]: *** [owfs] Error 1
make[2]: Leaving directory `/usr/src/owfs/owfs-2.9p5/module/owfs/src/c'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/owfs/owfs-2.9p5/module/owfs/src'
make: *** [all-recursive] Error 1
root <at> raspberrypi:/usr/src/owfs/owfs-2.9p5/module/owfs#

I've never seen it happen before. Nor have I had the chance to build
this version for X86. That's next.....
-----
Gregg C Levine gregg.drwho8 <at> gmail.com
"This signature fought the Time Wars, time and again."

------------------------------------------------------------------------------
Gregg Levine | 14 Aug 06:22 2014
Picon

Building 2.9p5 on Raspberry Pi

Hello!
It must be because of the way the Raspberry Pi works, but building
2.9p5 on the Raspberry Pi takes longer, then say on the X86 platform.

I bring it up because the version on the Debian for Raspberry Pi
collection is several versions older. Is anyone here responsible for
building OWFS for the Raspberry Pi and submitting it to them for the
repository?

It would be a boon to have the release updated if only to make our
activities easier. never mind the audience out there who are not list
members but who do use OWFS on the Raspberry Pi.
-----
Gregg C Levine gregg.drwho8 <at> gmail.com
"This signature fought the Time Wars, time and again."

------------------------------------------------------------------------------
Gregg Levine | 13 Aug 18:11 2014
Picon

Using a USB to Serial adapter with a RasPi and OWFS

Hello!
Normally when trying out ideas regarding OWFS on my Raspberry Pi model
B I use an adapter based on the FT232 chipset. I get the same results
as when I'm using the same adapter.

This is connected to a DS9097U9 adapter.

However instead of using that adapter I want to to try out a Keystone
branded adapter instead, its a model USA-19 as it happens.

Is anyone using this combination?
----
Paul be careful of the rain and the puddles where you are. It made a
mess of things where I am.
-----
Gregg C Levine gregg.drwho8 <at> gmail.com
"This signature fought the Time Wars, time and again."

------------------------------------------------------------------------------
Stefano Miccoli | 12 Aug 16:07 2014

unable to build owfs under debian/wheezy after commit 93c18664 (systemd)

Hi:

after commit 93c18664 owfs-code is broken on on my debian wheezy system (debian version 7.6).

Linking fails with the following message:

/home/admin/dev/owfs-code/module/owlib/src/c/.libs/libow.so: undefined reference to `mq_getattr'

I was able to solve this by adding

AC_CHECK_LIB([rt],[mq_getattr])

in configure.ac but please double check if this solution is valid, since I do not understand very well the whole systemd thing.

Other problems: I do not understand the src/scripts/systemd/Makefile.am logic: it simply mimics (in an incomplete and error prone way) the standard autoconf/automake semantics. An empty Makefile.am will do the same job provided that 

src/scripts/systemd/owfs.service
src/scripts/systemd/owftpd.service
src/scripts/systemd/owhttpd.service
src/scripts/systemd/owserver.service
src/scripts/systemd/owserver.socket

are listed among the AC_CONFIG_FILES in configure.ac.

Finally I noticed that src/include/config.h.in is included in the git source tree, but this is not correct, since this file is built by autoheader during bootstrap.

The suggested corrections are included in the attached patch file.

Stefano

------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
Owfs-developers <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Gmane