Re: [sqlite] sqlite 3.31.1 crashes in SVN on OpenBSD/sparc64

2020-03-11 Thread Stefan Sperling
On Wed, Mar 11, 2020 at 08:20:01AM -0400, Richard Hipp wrote:
> On 3/11/20, Stefan Sperling  wrote:
> >
> > Does this help?
> >
> 
> Studying the trace output makes me think this is the same problem that
> came up on the s390 hardware and was fixed here:
> https://www.sqlite.org/src/info/04885763c4cd00cb

Yes, this fixes it. Thank you!

I will get this patch merged into the OpenBSD port of sqlite.
I suppose once the next sqlite release comes around we will be able to
drop the patch again since it will already be included in the release.

Thanks a lot for your help :)
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite 3.31.1 crashes in SVN on OpenBSD/sparc64

2020-03-11 Thread Richard Hipp
On 3/11/20, Stefan Sperling  wrote:
>
> Does this help?
>

Studying the trace output makes me think this is the same problem that
came up on the s390 hardware and was fixed here:
https://www.sqlite.org/src/info/04885763c4cd00cb

Stefan:  Can you verify that the patch above fixes the problem?  If
you want, you can click on the "Tarball" link to get a complete
tarball of check-in 04885763c4cd00cb (which, by coincidence was the
first check-in *after* the 3.31.1 release), unpack the tarball, then
do "./configure && make sqlite3.c" to generate the "sqlitle3.c" and
"sqlite3.h" files.  Or, you can update the "sqlite3.c" file you are
currently using manually entering the 3-line patch shown.

Please let us know what you find.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite 3.31.1 crashes in SVN on OpenBSD/sparc64

2020-03-11 Thread Richard Hipp
On 3/11/20, Stefan Sperling  wrote:
>
> Does this help?
>

It does help some.  But I need a good copy of the database schema,
which I don't have.

Please bring up the database file in the "sqlite3" command-line shell,
then enter the command ".fullschema".  Save off the results and send
them to me, please.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite 3.31.1 crashes in SVN on OpenBSD/sparc64

2020-03-11 Thread Stefan Sperling
On Tue, Mar 10, 2020 at 06:42:18PM +0100, Stefan Sperling wrote:
> On Tue, Mar 10, 2020 at 01:21:34PM -0400, Richard Hipp wrote:
> > Set a breakpoint on the sqlite3VdbeExec() function that fires when the
> > statement that is crashing is first executed.  (You can determine that
> > it is the correct statement by looking at the value of p->zSql.)  Then
> > do:
> > 
> >  set p->db->flags = p->db->flags | ((0x060)<<32)
> > 
> > That will turn on bytecode listing and tracing, and might provide
> > further clues.  Please record and send in the trace.
> 
> I will look into this. Thanks!

Does this help?

$ egdb --args svn up<
GNU gdb (GDB) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc64-unknown-openbsd6.6".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from svn...done.
(gdb) br sqlite3.c:83210 if p->zSql && strncmp(p->zSql, "INSERT OR REPLACE 
INTO", 22) == 0
No source file named sqlite3.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (sqlite3.c:83210 if p->zSql && strncmp(p->zSql, "INSERT OR REPLACE 
INTO", 22) == 0) pending.
(gdb) run
Starting program: /usr/local/bin/svn up
Updating '.':

Breakpoint 1, sqlite3Step (p=0xd69cb26608) at sqlite3.c:83210
83210   rc = sqlite3VdbeExec(p);
(gdb) set p->db->flags = p->db->flags | (((unsigned long long)0x060)<<32)
(gdb) p /x p->db->flags
$1 = 0x60e004a0e0
(gdb) c
Continuing.
SQL: [INSERT OR REPLACE INTO nodes (   wc_id, local_relpath, op_depth, 
parent_relpath, repos_id, repos_path,   revision, presence, depth, kind, 
changed_revision, changed_date,   changed_author, checksum, properties, 
translated_size, last_mod_time,   dav_cache, symlink_target, file_external, 
moved_to, moved_here,   inherited_props) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, 
?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18, ?19, ?20, ?21, 
?22, ?23) ]
VDBE Program Listing:
   0 Init 0  1400   00 Start at 140
   1 OpenWrite0   160 2300 root=16 iDb=0; NODES
   2 OpenWrite1   290 k(4)  00 root=29 iDb=0; I_NODES_MOVED
   3 OpenWrite2   270 k(5,) 00 root=27 iDb=0; I_NODES_PARENT
   4 OpenWrite3   170 k(3,,,)   00 root=17 iDb=0; 
sqlite_autoindex_NODES_1
   5 Variable 120 ?100 r[2]=parameter(1,?1)
   6 Variable 230 ?200 r[3]=parameter(2,?2)
   7 Variable 340 ?300 r[4]=parameter(3,?3)
   8 Variable 450 ?400 r[5]=parameter(4,?4)
   9 Variable 560 ?500 r[6]=parameter(5,?5)
  10 Variable 670 ?600 r[7]=parameter(6,?6)
  11 Variable 780 ?700 r[8]=parameter(7,?7)
  12 Variable 890 ?800 r[9]=parameter(8,?8)
  13 Variable22   100 ?22   00 r[10]=parameter(22,?22)
  14 Variable21   110 ?21   00 r[11]=parameter(21,?21)
  15 Variable10   120 ?10   00 r[12]=parameter(10,?10)
  16 Variable15   130 ?15   00 r[13]=parameter(15,?15)
  17 Variable 9   140 ?900 r[14]=parameter(9,?9)
  18 Variable14   150 ?14   00 r[15]=parameter(14,?14)
  19 Variable19   160 ?19   00 r[16]=parameter(19,?19)
  20 Variable11   170 ?11   00 r[17]=parameter(11,?11)
  21 Variable12   180 ?12   00 r[18]=parameter(12,?12)
  22 Variable13   190 ?13   00 r[19]=parameter(13,?13)
  23 Variable16   200 ?16   00 r[20]=parameter(16,?16)
  24 Variable17   210 ?17   00 r[21]=parameter(17,?17)
  25 Variable18   220 ?18   00 r[22]=parameter(18,?18)
  26 Variable20   230 ?20   00 r[23]=parameter(20,?20)
  27 Variable23   240 ?23   00 r[24]=parameter(23,?23)
  28 NewRowid 010   00 r[1]=rowid
  29 HaltIfNull129922 NODES.wc_id   01 if r[2]=null halt
  30 HaltIfNull129923 NODES.local_relpath 01 if r[3]=null halt
  31 HaltIfNull129924 NODES.op_depth 01 if r[4]=null halt
  32 HaltIfNull129929 NODES.presence 01 if r[9]=null halt
  33 HaltIfNull12992   12 

Re: [sqlite] sqlite 3.31.1 crashes in SVN on OpenBSD/sparc64

2020-03-10 Thread Dominique Pellé
Stefan Sperling wrote:

> > Does valgrind give any clues?
>
> Valgrind does not run on the OpenBSD/sparc64 platform, unfortunately.

Would the address sanitizer (i.e. gcc -fsanitize=address, or
clang -fsanitize=address) work on OpenBSD/sparc64?

Regards
Dominique
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite 3.31.1 crashes in SVN on OpenBSD/sparc64

2020-03-10 Thread Stefan Sperling
On Tue, Mar 10, 2020 at 01:21:34PM -0400, Richard Hipp wrote:
> On 3/10/20, Stefan Sperling  wrote:
> > The query being executed is "STMT_INSERT_NODE":
> > -- STMT_INSERT_NODE
> > INSERT OR REPLACE INTO nodes (
> >   wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
> >   revision, presence, depth, kind, changed_revision, changed_date,
> >   changed_author, checksum, properties, translated_size, last_mod_time,
> >   dav_cache, symlink_target, file_external, moved_to, moved_here,
> >   inherited_props)
> > VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
> > ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23)
> 
> It would be great if you could send us the database schema - or even
> the whole database if it isn't too big.
>
> Probably if I have the schema I will be able to repro the problem.

The schema is public:
https://svn.apache.org/repos/asf/subversion/branches/1.13.x/subversion/libsvn_wc/wc-metadata.sql

> Is this only happening on Sparc, and not on x64 or ARM or PPC, etc?

It looks like it is specific to sparc64 so far.
I cannot reproduce it on amd64 with the same software versions.
I do not have access to arm/ppc machines at present.

> Does valgrind give any clues?

Valgrind does not run on the OpenBSD/sparc64 platform, unfortunately.

> Something else that might be helpful, if you have time:
> 
> Set a breakpoint on the sqlite3VdbeExec() function that fires when the
> statement that is crashing is first executed.  (You can determine that
> it is the correct statement by looking at the value of p->zSql.)  Then
> do:
> 
>  set p->db->flags = p->db->flags | ((0x060)<<32)
> 
> That will turn on bytecode listing and tracing, and might provide
> further clues.  Please record and send in the trace.

I will look into this. Thanks!
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite 3.31.1 crashes in SVN on OpenBSD/sparc64

2020-03-10 Thread Richard Hipp
On 3/10/20, Stefan Sperling  wrote:
> The query being executed is "STMT_INSERT_NODE":
> -- STMT_INSERT_NODE
> INSERT OR REPLACE INTO nodes (
>   wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
>   revision, presence, depth, kind, changed_revision, changed_date,
>   changed_author, checksum, properties, translated_size, last_mod_time,
>   dav_cache, symlink_target, file_external, moved_to, moved_here,
>   inherited_props)
> VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
> ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23)

It would be great if you could send us the database schema - or even
the whole database if it isn't too big.  You can send to my private
email if you like.

Probably if I have the schema I will be able to repro the problem.

Is this only happening on Sparc, and not on x64 or ARM or PPC, etc?

Does valgrind give any clues?

Something else that might be helpful, if you have time:

Set a breakpoint on the sqlite3VdbeExec() function that fires when the
statement that is crashing is first executed.  (You can determine that
it is the correct statement by looking at the value of p->zSql.)  Then
do:

 set p->db->flags = p->db->flags | ((0x060)<<32)

That will turn on bytecode listing and tracing, and might provide
further clues.  Please record and send in the trace.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users