Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Apr 2020 15:44:29 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 245767] ports-mgmt/pkg: 1.14.2 critical SQLITE error is ignored
Message-ID:  <bug-245767-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D245767

            Bug ID: 245767
           Summary: ports-mgmt/pkg: 1.14.2 critical SQLITE error is
                    ignored
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Ports Framework
          Assignee: portmgr@FreeBSD.org
          Reporter: sobomax@FreeBSD.org
                CC: ports-bugs@FreeBSD.org

Created attachment 213606
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D213606&action=
=3Dedit
Patch to fix the issue.

One of our build envs has run out of disk space, and we've noticed that err=
or
is not raised by the pkg failure, resulting in quite a mess.

[2020-04-18T04:49:42.516Z] + rm /tmp/rrd_create.sh /tmp/rrd.conf
[2020-04-18T04:49:42.516Z] + rm -f /tmp/sh.qPrEwG
[2020-04-18T04:49:42.770Z] pkg-static: sqlite error while executing COMMIT
TRANSACTION
  in file pkgdb.c:1292: database or disk is full
[2020-04-18T04:49:43.046Z] =3D=3D=3D>  Building package for ssp-5.3.2019082=
1165853_3
[2020-04-18T04:50:30.208Z] =3D=3D=3D>  Cleaning for ssp-5.3.20190821165853_3

Further investigation shows the following call stack:

#0  0x000000000046f66f in run_transaction (sqlite=3D0x8017fc008, query=3D0x=
8ebb87
"COMMIT TRANSACTION", savepoint=3D0x0) at pkgdb.c:1298
#1  0x000000000046f732 in pkgdb_transaction_commit_sqlite (sqlite=3D0x8017f=
c008,
savepoint=3D0x0) at pkgdb.c:1320
#2  0x000000000047200c in pkgdb_register_finale (db=3D0x8010a66e0, retcode=
=3D0,
savepoint=3D0x0) at pkgdb.c:2383
#3  0x0000000000469d45 in pkg_add_port (db=3D0x8010a66e0, pkg=3D0x801079000,
input_path=3D0x7fffffffe7ef "/tmp/media/ssp_port/work/stage", reloc=3D0x0,
testing=3Dfalse) at pkg_ports.c:1365
#4  0x00000000004167e6 in exec_register (argc=3D7, argv=3D0x7fffffffe428) at
register.c:195
#5  0x000000000041145c in main (argc=3D7, argv=3D0x7fffffffe428) at main.c:=
886

The culprit seems in the pkg_add_port(), the return value of
pkgdb_register_finale() is not checked, resulting in error condition being
essentially lost.

(gdb) up
#3  0x0000000000469d45 in pkg_add_port (db=3D0x8010a66e0, pkg=3D0x801079000,
input_path=3D0x7fffffffe7ef "/tmp/media/ssp_port/work/stage", reloc=3D0x0,
testing=3Dfalse) at pkg_ports.c:1365
1365            pkgdb_register_finale(db, rc, NULL);
(gdb) l
1360                            utstring_free(message);
1361                    }
1362            }
1363
1364    cleanup:
1365            pkgdb_register_finale(db, rc, NULL);
1366
1367            return (rc);
1368    }
(gdb) print rc
$2 =3D 0

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-245767-7788>