Tried - the result of old.
Version: from CVS at Dec 20 2008 12:00 UTC.
Message in /tmp/owfs_fatal I received only once during the "kill owserver_pid":
ow_connect.c:322 mutex_destroy failed rc=16 [Device or resource busy]
Serg.
I can try it on Saturday-Sunday...
Serg.
I noticed Paul made some minor changes to the mutexes and this might fix
your problem.
I'm adding some wrapper functions to all mutexes which will make it possible
to log any error-codes from the mutex-calls. I guess the first failing
mutex-call will log a readable error, and the second error will generate a
segmentation fault before being able to log the error.
No pthread-calls handling mutexes _should_ return any errors if the code is
working, but it could be useful to make it possible to turn on logging for
those failing calls. It will of course generate some more stack-usage, but
it shouldn't be noticeable.
Compiling with --disable-debug should remove all extra wrapper functions.
I really need this feature with uClibc-0.9.29 which seems to have a broken
libpthread. It could be used on any system to make sure all mutexes are
working as they should...
I was thinking of something like this to turn on the debug-output.
./owserver --fatal_debug --fatal_debug_file /tmp/owfs_fatal
"--fatal_debug" will log all errors to stderr or syslog depending on
--error_print
"--fatal_debug_file /tmp/owfs_fatal" will also log all errors to a file
/tmp/owfs_fatal.pid
I have checked in the changes to the CVS, and I hope this will show if there
are more existing bugs with the mutexes.
/Christian
-----Original Message-----
From: Serg Oskin [mailto:s...@oskin.ru]
Sent: Thursday, December 18, 2008 4:44 PM
To: owfs-developers@lists.sourceforge.net
Subject: Re: [Owfs-developers] general protection
Unfortunately, I can not devote enough time, but I will strongly contribute
to solving this problem.
Hi All!
version 2.7p11
# dmesg
...
owserver[18546] general protection rip:2b88f97f76c0 rsp:53b29dc8 error:0
owserver[20757] general protection rip:2b13e1c026c0 rsp:4e8f1dc8 error:0
Sometimes this happens, starting with version 2.7p4.
# file core.15352
core.15352: ELF 64-bit LSB core file AMD x86-64, version 1 (SYSV),
SVR4-style, from 'owserver'
# gdb /usr/sbin/owserver core.15352
GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/libthread_db.so.1".
Reading symbols from /usr/lib64/libow-2.7.so.11...Reading symbols from
/usr/lib/debug/usr/lib64/libow-2.7.so.11.0.0.debug...done.
done.
Loaded symbols for /usr/lib64/libow-2.7.so.11
Reading symbols from /usr/lib64/libusb-0.1.so.4...done.
Loaded symbols for /usr/lib64/libusb-0.1.so.4
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libpthread.so.0...done.
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libgcc_s.so.1...done.
Loaded symbols for /lib64/libgcc_s.so.1
Core was generated by `/usr/sbin/owserver -p 30003 -d /dev/ttyS0 -t 30'.
Program terminated with signal 11, Segmentation fault.
#0 0x00002b88f97f76c0 in __pthread_mutex_unlock_usercnt () from
/lib64/libpthread.so.0
(gdb)
(gdb) bt
#0 0x00002b88f97f76c0 in __pthread_mutex_unlock_usercnt () from
/lib64/libpthread.so.0
#1 0x00002b88f911e506 in LockRelease (pn=0x53b2a058) at ow_locks.c:194
#2 0x00002b88f912504c in FS_r_given_bus (owq=0x53b2a040) at ow_read.c:238
#3 0x00002b88f912514f in FS_read_distribute (owq=0x53b2a040) at
ow_read.c:193
#4 0x00002b88f91255ef in FS_read_postparse (owq=0x53b2a040) at
ow_read.c:109
#5 0x000000000040278e in ReadHandler (hd=0x51325f00, cm=0x53b2a0e0,
owq=0x53b2a040) at read.c:86
#6 0x0000000000403025 in DataHandler (v=<value optimized out>) at
data.c:124
#7 0x00002b88f97f42f7 in start_thread () from /lib64/libpthread.so.0
#8 0x00002b88f9ad9e3d in clone () from /lib64/libc.so.6
(gdb)
# gdb /usr/sbin/owserver core.19785
GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/libthread_db.so.1".
Reading symbols from /usr/lib64/libow-2.7.so.11...Reading symbols from
/usr/lib/debug/usr/lib64/libow-2.7.so.11.0.0.debug...done.
done.
Loaded symbols for /usr/lib64/libow-2.7.so.11
Reading symbols from /usr/lib64/libusb-0.1.so.4...done.
Loaded symbols for /usr/lib64/libusb-0.1.so.4
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libpthread.so.0...done.
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libgcc_s.so.1...done.
Loaded symbols for /lib64/libgcc_s.so.1
Core was generated by `/usr/sbin/owserver -p 30003 -d /dev/ttyS0 -t 30'.
Program terminated with signal 11, Segmentation fault.
#0 0x00002b13e1c026c0 in __pthread_mutex_unlock_usercnt () from
/lib64/libpthread.so.0
(gdb) bt
#0 0x00002b13e1c026c0 in __pthread_mutex_unlock_usercnt () from
/lib64/libpthread.so.0
#1 0x00002b13e1529506 in LockRelease (pn=0x4e8f2058) at ow_locks.c:194
#2 0x00002b13e153004c in FS_r_given_bus (owq=0x4e8f2040) at ow_read.c:238
#3 0x00002b13e153014f in FS_read_distribute (owq=0x4e8f2040) at
ow_read.c:193
#4 0x00002b13e15305ef in FS_read_postparse (owq=0x4e8f2040) at
ow_read.c:109
#5 0x000000000040278e in ReadHandler (hd=0x72d2bf00, cm=0x4e8f20e0,
owq=0x4e8f2040) at read.c:86
#6 0x0000000000403025 in DataHandler (v=<value optimized out>) at
data.c:124
#7 0x00002b13e1bff2f7 in start_thread () from /lib64/libpthread.so.0
#8 0x00002b13e1ee4e3d in clone () from /lib64/libc.so.6
(gdb)
------------------------------------------------------------------------
----------------------------------------------------------------------------
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers
----------------------------------------------------------------------------
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers
# gdb /usr/sbin/owserver core.18415
GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db
library "/lib64/libthread_db.so.1".
Reading symbols from /usr/lib64/libow-2.7.so.11...Reading symbols from
/usr/lib/debug/usr/lib64/libow-2.7.so.11.0.0.debug...done.
done.
Loaded symbols for /usr/lib64/libow-2.7.so.11
Reading symbols from /usr/lib64/libusb-0.1.so.4...done.
Loaded symbols for /usr/lib64/libusb-0.1.so.4
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libpthread.so.0...done.
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libgcc_s.so.1...done.
Loaded symbols for /lib64/libgcc_s.so.1
Core was generated by `/usr/sbin/owserver -p 30003 -d /dev/ttyS0 -t 30
--fatal_debug --fatal_debug_fil'.
Program terminated with signal 11, Segmentation fault.
#0 0x00000030da6096c0 in __pthread_mutex_unlock_usercnt () from
/lib64/libpthread.so.0
(gdb) bt
#0 0x00000030da6096c0 in __pthread_mutex_unlock_usercnt () from
/lib64/libpthread.so.0
#1 0x00002adf5bfb536b in LockRelease (pn=0x4adec058) at ow_locks.c:207
#2 0x00002adf5bfbc46c in FS_r_given_bus (owq=0x4adec040) at ow_read.c:238
#3 0x00002adf5bfbc5e2 in FS_read_distribute (owq=0x4adec040) at ow_read.c:193
#4 0x00002adf5bfbcd04 in FS_read_postparse (owq=0x4adec040) at ow_read.c:109
#5 0x0000000000402aae in ReadHandler (hd=0x42bdef00, cm=0x4adec0e0,
owq=0x4adec040) at read.c:86
#6 0x000000000040339b in DataHandler (v=<value optimized out>) at data.c:125
#7 0x00000030da6062f7 in start_thread () from /lib64/libpthread.so.0
#8 0x00000030d8ed1e3d in clone () from /lib64/libc.so.6
(gdb)
==00:00:00:00.000 2275== Memcheck, a memory error detector.
==00:00:00:00.000 2275== Copyright (C) 2002-2006, and GNU GPL'd, by Julian
Seward et al.
==00:00:00:00.000 2275== Using LibVEX rev 1658, a library for dynamic binary
translation.
==00:00:00:00.000 2275== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks
LLP.
==00:00:00:00.000 2275== Using valgrind-3.2.1, a dynamic binary instrumentation
framework.
==00:00:00:00.000 2275== Copyright (C) 2000-2006, and GNU GPL'd, by Julian
Seward et al.
==00:00:00:00.000 2275==
==00:00:00:00.000 2275== My PID = 2275, parent PID = 2274. Prog and args are:
==00:00:00:00.000 2275== /usr/sbin/owserver
==00:00:00:00.000 2275== -p
==00:00:00:00.000 2275== 30003
==00:00:00:00.000 2275== -d
==00:00:00:00.000 2275== /dev/ttyS0
==00:00:00:00.000 2275== -t
==00:00:00:00.000 2275== 30
==00:00:00:00.000 2275== --foreground
==00:00:00:00.000 2275==
--00:00:00:00.000 2275--
--00:00:00:00.000 2275-- Command line
--00:00:00:00.000 2275-- /usr/sbin/owserver
--00:00:00:00.000 2275-- -p
--00:00:00:00.000 2275-- 30003
--00:00:00:00.000 2275-- -d
--00:00:00:00.000 2275-- /dev/ttyS0
--00:00:00:00.000 2275-- -t
--00:00:00:00.000 2275-- 30
--00:00:00:00.000 2275-- --foreground
--00:00:00:00.000 2275-- Startup, with flags:
--00:00:00:00.000 2275-- --time-stamp=yes
--00:00:00:00.000 2275-- --leak-check=full
--00:00:00:00.000 2275-- --leak-resolution=high
--00:00:00:00.000 2275-- --log-file=/tmp/owserver.log
--00:00:00:00.000 2275-- --trace-children=yes
--00:00:00:00.000 2275-- --undef-value-errors=yes
--00:00:00:00.000 2275-- --verbose
--00:00:00:00.000 2275-- Contents of /proc/version:
--00:00:00:00.000 2275-- Linux version 2.6.18-92.1.22.el5
(mockbu...@hs20-bc2-5.build.redhat.com) (gcc version 4.1.2 20071124 (Red Hat
4.1.2-42)) #1 SMP Fri Dec 5 09:28:22 EST 2008
--00:00:00:00.000 2275-- Arch and hwcaps: AMD64, amd64-sse2
--00:00:00:00.000 2275-- Valgrind library directory: /usr/lib64/valgrind
--00:00:00:00.001 2275-- Reading syms from /usr/sbin/owserver (0x400000)
--00:00:00:00.001 2275-- Reading debug info from
/usr/lib/debug/usr/sbin/owserver.debug...
--00:00:00:00.003 2275-- Reading syms from
/usr/lib64/valgrind/amd64-linux/memcheck (0x38000000)
--00:00:00:00.004 2275-- object doesn't have a dynamic symbol table
--00:00:00:00.095 2275-- Reading syms from /lib64/ld-2.5.so (0x30D8A00000)
--00:00:00:00.099 2275-- Reading suppressions file:
/usr/lib64/valgrind/default.supp
--00:00:00:00.225 2275-- Reading syms from
/usr/lib64/valgrind/amd64-linux/vgpreload_core.so (0x4802000)
--00:00:00:00.238 2275-- Reading syms from
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so (0x4A03000)
--00:00:00:00.252 2275-- REDIR: 0x30D8A14400 (index) redirected to 0x4A06550
(index)
--00:00:00:00.254 2275-- REDIR: 0x30D8A145B0 (strcmp) redirected to 0x4A067D0
(strcmp)
--00:00:00:00.256 2275-- REDIR: 0x30D8A145E0 (strlen) redirected to 0x4A06700
(strlen)
--00:00:00:00.268 2275-- Reading syms from /usr/lib64/libow-2.7.so.11.0.0
(0x4C09000)
--00:00:00:00.269 2275-- Reading debug info from
/usr/lib/debug/usr/lib64/libow-2.7.so.11.0.0.debug...
--00:00:00:00.298 2275-- Reading syms from /usr/lib64/libusb-0.1.so.4.4.4
(0x30D9E00000)
--00:00:00:00.299 2275-- object doesn't have a symbol table
--00:00:00:00.320 2275-- Reading syms from /lib64/libm-2.5.so (0x30D9600000)
--00:00:00:00.323 2275-- Reading syms from /lib64/libdl-2.5.so (0x30D9200000)
--00:00:00:00.324 2275-- Reading syms from /lib64/libpthread-2.5.so
(0x30DA600000)
--00:00:00:00.328 2275-- Reading syms from /lib64/libc-2.5.so (0x30D8E00000)
--00:00:00:00.466 2275-- REDIR: 0x30D8E79810 (memset) redirected to 0x4A06920
(memset)
--00:00:00:00.481 2275-- REDIR: 0x30D8E7A320 (memcpy) redirected to 0x4A06FF0
(memcpy)
--00:00:00:00.489 2275-- REDIR: 0x30D8E78960 (rindex) redirected to 0x4A06400
(rindex)
--00:00:00:00.525 2275-- REDIR: 0x30D8E72EA0 (calloc) redirected to 0x4A04AAC
(calloc)
--00:00:00:00.543 2275-- REDIR: 0x30D8E73230 (malloc) redirected to 0x4A05787
(malloc)
--00:00:00:00.544 2275-- REDIR: 0x30D8E74DF0 (free) redirected to 0x4A05397
(free)
--00:00:00:00.571 2275-- REDIR: 0x30D8E77FF0 (strcmp) redirected to 0x4A06790
(strcmp)
--00:00:00:00.613 2275-- REDIR: 0x30D8E79060 (memchr) redirected to 0x4A06850
(memchr)
--00:00:00:00.619 2275-- REDIR: 0x30D8E7AF80 (rawmemchr) redirected to
0x4A069E0 (rawmemchr)
--00:00:00:00.724 2275-- REDIR: 0xFFFFFFFFFF600400 (???) redirected to
0x380279E1 (???)
--00:00:00:00.726 2275-- REDIR: 0x30D8E78570 (strlen) redirected to 0x4A066C0
(strlen)
--00:00:00:00.737 2275-- REDIR: 0x30D8E77E40 (index) redirected to 0x4A064F0
(index)
--00:00:00:00.755 2275-- REDIR: 0x30D8E787F0 (strncmp) redirected to 0x4A06720
(strncmp)
--00:00:00:01.057 2275-- REDIR: 0xFFFFFFFFFF600000 (???) redirected to
0x380279D7 (???)
--00:00:00:03.839 2275-- REDIR: 0x30D8E78030 (strcpy) redirected to 0x4A06D90
(strcpy)
--00:00:00:03.957 2275-- Reading syms from /lib64/libgcc_s-4.1.2-20080102.so.1
(0x30DBA00000)
--00:00:00:03.958 2275-- object doesn't have a symbol table
--00:00:00:06.268 2275-- REDIR: 0x30D8E788B0 (strncpy) redirected to 0x4A07170
(strncpy)
--00:00:03:33.727 2275-- REDIR: 0x30D8E77C80 (strcat) redirected to 0x4A06A00
(strcat)
--00:00:03:33.736 2275-- REDIR: 0x30D8E74FD0 (realloc) redirected to 0x4A05838
(realloc)
--00:00:03:48.671 2275-- memcheck GC: 1024 nodes, 1024 survivors (100.0%)
--00:00:03:48.671 2275-- memcheck GC: increase table size to 2048
--00:00:10:55.567 2275-- memcheck GC: 2048 nodes, 2048 survivors (100.0%)
--00:00:10:55.567 2275-- memcheck GC: increase table size to 4096
--00:00:25:41.268 2275-- memcheck GC: 4096 nodes, 3400 survivors ( 83.0%)
--00:00:25:41.268 2275-- memcheck GC: increase table size to 8192
--00:01:18:37.069 2275-- memcheck GC: 8192 nodes, 7645 survivors ( 93.3%)
--00:01:18:37.069 2275-- memcheck GC: increase table size to 16384
--00:03:48:41.053 2275-- memcheck GC: 16384 nodes, 15142 survivors ( 92.4%)
--00:03:48:41.053 2275-- memcheck GC: increase table size to 32768
==00:04:16:08.080 2275== Thread 27:
==00:04:16:08.080 2275== Invalid read of size 8
==00:04:16:08.080 2275== at 0x4C56559: LockGet (ow_locks.c:195)
==00:04:16:08.080 2275== by 0x4C5D381: FS_r_given_bus (ow_read.c:231)
==00:04:16:08.080 2275== by 0x4C5D5E1: FS_read_distribute (ow_read.c:193)
==00:04:16:08.080 2275== by 0x4C5DD03: FS_read_postparse (ow_read.c:109)
==00:04:16:08.080 2275== by 0x402AAD: ReadHandler (read.c:86)
==00:04:16:08.080 2275== by 0x40339A: DataHandler (data.c:125)
==00:04:16:08.080 2275== by 0x30DA6062F6: start_thread (in
/lib64/libpthread-2.5.so)
==00:04:16:08.080 2275== by 0x30D8ED1E3C: clone (in /lib64/libc-2.5.so)
==00:04:16:08.080 2275== Address 0x5A0D750 is 0 bytes inside a block of size
32 free'd
==00:04:16:08.080 2275== at 0x4A0541E: free (vg_replace_malloc.c:233)
==00:04:16:08.080 2275== by 0x30D8ED02B6: tdelete (in /lib64/libc-2.5.so)
==00:04:16:08.080 2275== by 0x4C563EB: LockRelease (ow_locks.c:211)
==00:04:16:08.080 2275== by 0x4C5D46B: FS_r_given_bus (ow_read.c:238)
==00:04:16:08.080 2275== by 0x4C5D5E1: FS_read_distribute (ow_read.c:193)
==00:04:16:08.080 2275== by 0x4C5DD03: FS_read_postparse (ow_read.c:109)
==00:04:16:08.080 2275== by 0x402AAD: ReadHandler (read.c:86)
==00:04:16:08.080 2275== by 0x40339A: DataHandler (data.c:125)
==00:04:16:08.080 2275== by 0x30DA6062F6: start_thread (in
/lib64/libpthread-2.5.so)
==00:04:16:08.080 2275== by 0x30D8ED1E3C: clone (in /lib64/libc-2.5.so)
------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers