SQLite Forum

sqlite-src-3320300 fails test shell1-1.7.1 on Solaris 10 sparcv9
Login

sqlite-src-3320300 fails test shell1-1.7.1 on Solaris 10 sparcv9

(1) By Dennis Clarke (blastwave) on 2020-07-30 22:18:46 [link] [source]

On this server : 

alpha$ uname -a 
SunOS alpha 5.10 Generic_150400-65 sun4u sparc SUNW,SPARC-Enterprise

alpha$ psrinfo -pv
The physical processor has 6 virtual processors (2-7)
  SPARC64-VII+ (portid 1024 impl 0x7 ver 0xa1 clock 2860 MHz)

With a few env vars of interest : 

alpha$ echo $CC
/opt/developerstudio12.6/bin/c99

alpha$ echo $CFLAGS
-Xc -m64 -xarch=sparc -g -xs -xO0 -errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -xmemalign=8s -xnolibmil -xcode=pic32 -xregs=no%appl -xlibmieee -mc -ftrap=%none -xbuiltin=%none -xunroll=1 -Qy -xdebugformat=dwarf -xunroll=1
alpha$ 

Note -Xc there for strict C99 compliance.

alpha$ echo $CPPFLAGS
-I/opt/bw/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE

To deal with sched_yield in a few tests : 

alpha$ echo $LIBS
-lrt

I also want a particular RUNPATH/RPATH in the output ELF files : 

alpha$ echo $LD_OPTIONS 
-64 -R/opt/bw/lib -L/opt/bw/lib
alpha$ echo $LD_RUN_PATH
LD_RUN_PATH=/opt/bw/lib

Where the configure was fine : 

alpha$ ./configure --prefix=/opt/bw \
> --enable-shared --enable-static --enable-tempstore=yes \
> --enable-debug --enable-all --without-gnu-ld \
> --with-tcl=/opt/bw/lib 
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking for gcc... /opt/developerstudio12.6/bin/c99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /opt/developerstudio12.6/bin/c99 accepts -g... yes
checking for /opt/developerstudio12.6/bin/c99 option to accept ISO C89... none needed
checking for a sed that does not truncate output... /opt/bw/bin/sed
checking for grep that handles long lines and -e... /usr/xpg4/bin/grep
checking for egrep... /usr/xpg4/bin/grep -E
checking for fgrep... /usr/xpg4/bin/grep -F
checking for non-GNU ld... /usr/ccs/bin/sparcv9/ld
checking if the linker (/usr/ccs/bin/sparcv9/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/xpg4/bin/nm -p
checking the name lister (/usr/xpg4/bin/nm -p) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/ccs/bin/sparcv9/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for ar... /usr/ccs/bin/ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/xpg4/bin/nm -p output from /opt/developerstudio12.6/bin/c99 object... ok
checking how to run the C preprocessor... /opt/developerstudio12.6/bin/c99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking for /opt/developerstudio12.6/bin/c99 option to produce PIC... -KPIC -DPIC
checking if /opt/developerstudio12.6/bin/c99 PIC flag -KPIC -DPIC works... yes
checking if /opt/developerstudio12.6/bin/c99 static flag -Bstatic works... no
checking if /opt/developerstudio12.6/bin/c99 supports -c -o file.o... yes
checking if /opt/developerstudio12.6/bin/c99 supports -c -o file.o... (cached) yes
checking whether the /opt/developerstudio12.6/bin/c99 linker (/usr/ccs/bin/sparcv9/ld -64) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... ./install-sh -c
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for intptr_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uintptr_t... yes
checking for sys/types.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for fdatasync... yes
checking for gmtime_r... yes
checking for isnan... yes
checking for localtime_r... yes
checking for localtime_s... no
checking for malloc_usable_size... no
checking for strchrnul... no
checking for usleep... yes
checking for utime... yes
checking for pread... yes
checking for pread64... no
checking for pwrite... yes
checking for pwrite64... no
checking for tclsh8.7... no
checking for tclsh8.6... tclsh8.6
configure: Version set to 3.32
configure: Release set to 3.32.3
configure: Version number set to 3032003
checking whether to support threadsafe operation... yes
checking for library containing pthread_create... none required
checking for library containing pthread_mutexattr_init... none required
checking whether to support shared library linked as release mode or not... no
checking whether to use an in-ram database for temporary tables... yes
checking if executables have the .exe suffix... unknown
checking for Tcl configuration... found /opt/bw/lib/tclConfig.sh
checking for existence of /opt/bw/lib/tclConfig.sh... loading
checking for library containing readline... no
checking for library containing tgetent... -lcurses
checking for readline in -lreadline... yes
checking readline.h usability... no
checking readline.h presence... no
checking for readline.h... no
checking for /usr/include/readline.h... no
checking for /usr/include/readline/readline.h... no
checking for /usr/local/include/readline.h... no
checking for /usr/local/include/readline/readline.h... yes
checking for library containing fdatasync... none required
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing deflate... -lz
checking for library containing dlopen... none required
checking whether to support MEMSYS5... no
checking whether to support MEMSYS3... no
checking for library containing log... -lm
checking for library containing log... (cached) -lm
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sqlite3.pc
config.status: creating config.h
config.status: executing libtool commands
alpha$ 

Compile went fine and smooth however there was a single test fail : 

.
.
.
Time: zipfile.test 1190 ms
Time: zipfile2.test 67 ms
SQLite 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd
1 errors out of 295712 tests on alpha SunOS 64-bit big-endian
!Failures on these tests: shell1-1.7.1
All memory allocations freed - no leaks
Maximum memory usage: 9277616 bytes
Current memory usage: 0 bytes
Number of malloc()  : -1 calls
gmake: *** [Makefile:1264: tcltest] Error 1

alpha$ 


What can I do to dig into this further such that we can resolve it ? 


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

PS: I was happy with the maillist.

(2) By Richard Hipp (drh) on 2020-07-30 22:39:07 in reply to 1 [source]

!Failures on these tests: shell1-1.7.1

That particular test (seen here) is checking the --interactive command-line option for the sqlite3 command-line shell. It is not a test of the underlying SQLite library, but rather a test of the interface to the command-line program.

So this isn't an important test and can be safely ignored, if that is what you are concerned about.

If you want to track down the problem, you can run:

     ./testfixture test/shell1.test

Look at the expected and actual output. Maybe post the information here. And we'll try to figure out what is going on with Solaris.

(3) By Dennis Clarke (blastwave) on 2020-07-30 23:46:40 in reply to 2 [link] [source]

Excellent.  Thank you.  I really was not too concerned but I am going to
see what is happening there regardless. I can use the XPG4 sh which is
very spartan but also very standards compliant. Perhaps the old bash
that was left in Solaris 10 or my own bash 5.0.18.  Whatever it takes.

alpha$ ./testfixture test/shell1.test
shell1-1.1.1... Ok
.
.
.
shell1-1.7.1...
! shell1-1.7.1 expected: [0 1 1]
! shell1-1.7.1 got:      [1 1 1]
shell1-1.8.1... Ok
.
.
.
shell1-7.1.7... Ok
SQLite 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd
1 errors out of 177 tests on alpha SunOS 64-bit big-endian
!Failures on these tests: shell1-1.7.1
All memory allocations freed - no leaks
Memory used:          now          0  max     171944  max-size      87200
Allocation count:     now          0  max        430
Page-cache used:      now          0  max          0  max-size       4104
Page-cache overflow:  now          0  max       8200
Maximum memory usage: 171944 bytes
Current memory usage: 0 bytes
Number of malloc()  : -1 calls
alpha$ 

Awesome. 

Dennis

(4) By Richard Hipp (drh) on 2020-07-31 00:11:05 in reply to 3 [link] [source]

It appears that the sqlite3 executable is exiting with a non-zero result code. Dunno why that is. What does this command show:

   if ./sqlite3 --interactive test.db .quit; then echo yes; else echo no; fi

It says "yes" on my Ubuntu workstation, as it should. The test result above seems to suggest that Solaris will answer "no".

(5) By Dennis Clarke (blastwave) on 2020-07-31 00:52:04 in reply to 4 [link] [source]

Here we get a 'yes' also :

alpha$ cd /opt/bw/build/sqlite-src-3320300_sunos5.10_sparcv9.004
alpha$ 
alpha$ if ./sqlite3 --interactive test.db .quit; then echo yes; else echo no; fi
yes
alpha$ 


Let's use the now installed binary ( same thing of course ) 

alpha$ ls -lap /opt/bw/bin/sqlite3*
-rwxr-xr-x   1 root     root     5543032 Jul 31 00:10 /opt/bw/bin/sqlite3
-rwxr-xr-x   1 root     root       30301 Jul 30 01:42 /opt/bw/bin/sqlite3_analyzer

I will go to my home dir and then : 

alpha$ cd 
alpha$ which sqlite3 
/opt/bw/bin/sqlite3

alpha$ sqlite3 --version 
3.32.3 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd

alpha$ if sqlite3 --interactive test.db .quit; then echo yes; else echo no; fi
yes
alpha$ 

So that's a solid 'yes'.

Because I am curious about this interactive mode : 

alpha$ sqlite3 --interactive test.db
SQLite version 3.32.3 2020-06-18 14:00:33
Enter ".help" for usage hints.
Segmentation Fault (core dumped)
alpha$ 
alpha$ tn
1596156484
alpha$ 
alpha$ ls -l time_1596156440-pid_8932-uid_16411-gid_20002-fid_sqlite3.core 
-rw-------   1 dclarke  devl     8020078 Jul 31 00:47 time_1596156440-pid_8932-uid_16411-gid_20002-fid_sqlite3.core
alpha$ 
alpha$ dbx /opt/bw/bin/sqlite3 time_1596156440-pid_8932-uid_16411-gid_20002-fid_sqlite3.core
Reading sqlite3
core file header read successfully
Reading ld.so.1
Reading libreadline.so.8
Reading libcurses.so.2
Reading libm.so.2
Reading libz.so.1.2.11
Reading librt.so.1
Reading libc.so.1
Reading libaio.so.1
Reading libmd.so.1
Reading libc_psr.so.1
program terminated by signal SEGV (no mapping at the fault address)
0xffffffff7eb11fa4: tgetent+0x0024:     ldx      [%i0 + 3344], %o0
Current function is _rl_init_terminal_io
  483         tgetent_ret = tgetent (term_buffer, term);
(dbx) where                                                                                                                      
  [1] tgetent(0x0, 0xffffffff7ffff799, 0x116078, 0x0, 0xffffffff7ec28000, 0xffffffff7ec30528), at 0xffffffff7eb11fa4 
=>[2] _rl_init_terminal_io(terminal_name = 0xffffffff7ffff799 "xterm"), line 483 in "terminal.c"
  [3] readline_initialize_everything(), line 1200 in "readline.c"
  [4] rl_initialize(), line 1100 in "readline.c"
  [5] readline(prompt = 0x10043e5a0 "sqlite> "), line 369 in "readline.c"
  [6] one_input_line(in = (nil), zPrior = (nil), isContinuation = 0), line 725 in "shell.c"
  [7] process_input(p = 0xffffffff7fffe9a0), line 18700 in "shell.c"
  [8] main(argc = 3, argv = 0xffffffff7ffff408), line 19521 in "shell.c"
(dbx) quit
alpha$ 

So that is somewhat bizarre.  
Looks like somewhere downstream of readline_initialize_everything() bad things happen.

Dennis