Quantcast

segfault when trying to run mhvtl (from mhvtl-2015-04-14.tgz) and kernel 4.1

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

segfault when trying to run mhvtl (from mhvtl-2015-04-14.tgz) and kernel 4.1

cwseys
Hello,
   After compiling and installing mhvtl as found in mhvtl-2015-04-14.tgz running the init script gives a series of segfaults as vtltape and vtllibrary are executed.

# /etc/init.d/mhvtl start
vtltape -q 11  
/usr/bin/build_library_config: line 71:  3141 Segmentation fault      vtltape -q $a $OPTIONS $FIFO
vtltape -q 12  
/usr/bin/build_library_config: line 71:  3142 Segmentation fault      vtltape -q $a $OPTIONS $FIFO
vtllibrary -q 10  
/usr/bin/build_library_config: line 79:  3147 Segmentation fault      vtllibrary -q $a $OPTIONS $FIFO

Aug 24 14:10:15 thedoctor kernel: [249123.502938] vtltape[4274]: segfault at 14 ip 00007eff515e5e9a sp 00007fffee00cd80 error 4 in libvtlscsi.so[7eff515d5000+1b000]
Aug 24 14:10:15 thedoctor kernel: [249123.515569] vtltape[4275]: segfault at 14 ip 00007f126c4cce9a sp 00007ffe53bdda00 error 4 in libvtlscsi.so[7f126c4bc000+1b000]
Aug 24 14:10:15 thedoctor kernel: [249123.534851] vtllibrary[4277]: segfault at 60 ip 00007f4866382348 sp 00007ffea3588170 error 4 in libvtlscsi.so[7f4866379000+1b000]


With verbosity turned on:
#vtltape -v -d -q 11
[...  after reading devices.config ...]
vtltape: readline(): # Backoff: 400
vtltape: readline():

vtltape: readline():

vtltape: init_lu(): Adding default vers info: 0105
vtltape: ssc_personality_module_register(): LTO-5
vtltape: add_mode_page_rw_err_recovery(): Adding mode page Read/Write Error Recovery (01/00)
vtltape: alloc_mode_page(): Allocating 12 bytes for (01/00)
vtltape: lookup_pcode(): Looking for: Page/subpage (01/00)
vtltape: lookup_pcode(): Page/subpage code 0x01/0x00 not found
vtltape: add_mode_disconnect_reconnect(): Adding mode page Disconnect/Reconnect (02/00)
vtltape: alloc_mode_page(): Allocating 12 bytes for (02/00)
vtltape: lookup_pcode(): Looking for: Page/subpage (02/00)
vtltape: lookup_pcode(): Page/subpage code 0x02/0x00 not found
vtltape: add_mode_control(): Adding mode page Control (0a/00)
vtltape: alloc_mode_page(): Allocating 12 bytes for (0a/00)
vtltape: lookup_pcode(): Looking for: Page/subpage (0a/00)
vtltape: lookup_pcode(): Page/subpage code 0x0a/0x00 not found
vtltape: add_mode_control_extension(): Adding mode page Control Extension (0a/01)
vtltape: alloc_mode_page(): Allocating 28 bytes for (0a/01)
vtltape: lookup_pcode(): Looking for: Page/subpage (0a/01)
vtltape: lookup_pcode(): Page/subpage code 0x0a/0x01 not found
vtltape: add_mode_data_compression(): Adding mode page Data Compression (0f/00)
vtltape: alloc_mode_page(): Allocating 16 bytes for (0f/00)
vtltape: lookup_pcode(): Looking for: Page/subpage (0f/00)
vtltape: lookup_pcode(): Page/subpage code 0x0f/0x00 not found
vtltape: add_mode_device_configuration(): Adding mode page Device Configuration (10/00)
vtltape: alloc_mode_page(): Allocating 16 bytes for (10/00)
vtltape: lookup_pcode(): Looking for: Page/subpage (10/00)
vtltape: lookup_pcode(): Page/subpage code 0x10/0x00 not found
Segmentation fault

# vtllibrary -v -d -q 10
vtllibrary: readline(): # Backoff: 400
vtllibrary: readline():

vtllibrary: readline():

vtllibrary: init_lu(): Adding default vers info: 0105
vtllibrary: smc_personality_module_register(): mhVTL - STK L series emulation
Segmentation fault

I may have uploaded the device.conf file (? :) )
device.conf


Reverting back to kernel 3.16 also does not help - I wonder if the version of gcc makes a difference?  (I think it may have changed from 4.7 to 4.9 since I last recompiled?)

Any ideas?

Thanks,
C.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: segfault when trying to run mhvtl (from mhvtl-2015-04-14.tgz) and kernel 4.1

cwseys
I'm not sure of the problem yet, but debugging vtltape with gdb
shows that "ssc" is a null pointer at line 393 in mode.c :

#0  add_mode_device_configuration (lu=0x62fec0 <lunit>) at mode.c:393
(gdb) print ssc
$33 = (struct priv_lu_ssc *) 0x0

mode.c lines:
391             mp->pcodePointer[8] = 0x40;     /* Block Identifiers supported */
392             mp->pcodePointer[10] = 0x18;    /* Enable EOD & Sync at early warning */
393             mp->pcodePointer[14] = ssc->configCompressionFactor;

(gdb) backtrace
#0  add_mode_device_configuration (lu=0x62fec0 <lunit>) at mode.c:393
#1  0x0000000000415e07 in init_ult3580_td5 (lu=0x62fec0 <lunit>) at ult3580_pm.c:671
#2  0x000000000040a97a in config_lu (lu=0x62fec0 <lunit>) at vtltape.c:2267
#3  0x000000000040c1ea in main (argc=0, argv=0x7fff085fb190) at vtltape.c:2931

Not very good at debugging.  Let me know commands, and I'll type them!  :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: segfault when trying to run mhvtl (from mhvtl-2015-04-14.tgz) and kernel 4.1

Mark Harvey
Administrator
cwseys wrote
I'm not sure of the problem yet, but debugging vtltape with gdb
shows that "ssc" is a null pointer at line 393 in mode.c :

#0  add_mode_device_configuration (lu=0x62fec0 <lunit>) at mode.c:393
(gdb) print ssc
$33 = (struct priv_lu_ssc *) 0x0

mode.c lines:
391             mp->pcodePointer[8] = 0x40;     /* Block Identifiers supported */
392             mp->pcodePointer[10] = 0x18;    /* Enable EOD & Sync at early warning */
393             mp->pcodePointer[14] = ssc->configCompressionFactor;

(gdb) backtrace
#0  add_mode_device_configuration (lu=0x62fec0 <lunit>) at mode.c:393
#1  0x0000000000415e07 in init_ult3580_td5 (lu=0x62fec0 <lunit>) at ult3580_pm.c:671
#2  0x000000000040a97a in config_lu (lu=0x62fec0 <lunit>) at vtltape.c:2267
#3  0x000000000040c1ea in main (argc=0, argv=0x7fff085fb190) at vtltape.c:2931

Not very good at debugging.  Let me know commands, and I'll type them!  :)
Not too bad either :)

Sorry it's taken me a while to look into this.

Strange behaviour.

I'll have a look at this shortly..

Can I ask you to confirm there is no 'stale' libvtlscsi.so that is being picked up somewhere ?
e.g.
# ldd `which vtltape`

Cheers
Mark
Regards from Australia
Mark Harvey
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: segfault when trying to run mhvtl (from mhvtl-2015-04-14.tgz) and kernel 4.1

cwseys
Hi Mark,
        You nailed it!  The Makefile was putting the new library files in
/usr/lib64, while there were old ones in /usr/lib/ .
        Compiles and runs on kernel 4.1!  Thanks!

        I changed the Makefiles (patches below) to check for preexisting
$(PREFIX)//lib64 and use that if it exists.  Otherwise place in $(PREFIX)/lib.  
The assumption is that other programs will have installed libs in the correct
library path before mhvtl is compiled.  :)

        The old Makefile did not work for me b/c Networker installed this
ld.so.conf.d file
# cat /etc/ld.so.conf.d/networker.conf
# NetWorker default configuration
/usr/lib/nsr
/usr/lib/nsr/lib64

and the Makefiles were detecting the lib64 part.

# diff -u mhvtl-1.5{.orig,}/usr/Makefile
--- mhvtl-1.5.orig/usr/Makefile 2015-08-27 13:51:58.732434551 -0500
+++ mhvtl-1.5/usr/Makefile      2015-08-27 13:53:18.560513410 -0500
@@ -30,17 +30,13 @@
 CONFIG_PATH = $(shell echo $(MHVTL_CONFIG_PATH) | sed -e s'/\//\\\//g')
 HOME_PATH = $(shell echo $(MHVTL_HOME_PATH) | sed -e s'/\//\\\//g')
 
-ifeq ($(shell uname -m),x86_64)
+# Set LIBDIR to where other libs already exist
+ifneq "$(wildcard $(PREFIX)/lib64/ )" ""
 LIBDIR ?= $(PREFIX)/lib64
 else
 LIBDIR ?= $(PREFIX)/lib
 endif
 
-# Ubuntu / mint seem to have stopped using /lib64/
-ifeq ($(shell grep lib64 /etc/ld.so.conf /etc/ld.so.conf.d/* | wc -l),0)
-LIBDIR = $(PREFIX)/lib
-endif


# diff -u mhvtl-1.5{.orig,}/man/Makefile
--- mhvtl-1.5.orig/man/Makefile 2014-09-10 01:10:04.000000000 -0500
+++ mhvtl-1.5/man/Makefile      2015-08-27 14:00:55.184953386 -0500
@@ -21,15 +21,11 @@
 VERSION ?= $(VER)
 EXTRAVERSION =  $(if $(shell git show-ref 2>/dev/null),-git-$(shell git show-
ref --head --abbrev|head -1|awk '{print $$1}'))
 
-ifeq ($(shell uname -m),x86_64)
-LIBDIR=lib64
+# Set LIBDIR to where other libs already exist
+ifneq "$(wildcard $(PREFIX)/lib64/ )" ""
+LIBDIR ?= $(PREFIX)/lib64
 else
-LIBDIR=lib
-endif
-
-# Ubuntu / mint seem to have stopped using /lib64/
-ifeq ($(shell grep lib64 /etc/ld.so.conf.d/* | wc -l),0)
-LIBDIR=lib
+LIBDIR ?= $(PREFIX)/lib
 endif
 
 MONTH = $(shell date +%B)

The other program I'm now using is 'checkinstall' - it creates a debian
package from 'make install' and removes the files when the package is
installed.  (No lingering libraries.)

Thanks again!
Chad.
Loading...