[med-svn] [Git][med-team/ncbi-vdb][upstream] New upstream version 2.10.3+dfsg
Andreas Tille
gitlab at salsa.debian.org
Mon Feb 24 20:53:26 GMT 2020
Andreas Tille pushed to branch upstream at Debian Med / ncbi-vdb
Commits:
cc86d731 by Andreas Tille at 2020-02-24T21:48:47+01:00
New upstream version 2.10.3+dfsg
- - - - -
10 changed files:
- CHANGES.md
- build/Makefile.vers
- libs/blast/blast-mgr.c
- libs/kdb/libkdb.vers.h
- libs/klib/release-vers.h
- libs/ncbi-vdb/libncbi-vdb.vers
- libs/sraxf/format-spot-name.c
- libs/vdb/libvdb.vers.h
- test/sraxf/Makefile
- + test/sraxf/test-format_spot_name.cpp
Changes:
=====================================
CHANGES.md
=====================================
@@ -1,6 +1,12 @@
# NCBI External Developer Release:
+## NCBI VDB 2.10.3
+**February 18, 2020**
+
+ **sraxf**: fixed a problem resulting in a segmentation fault
+
+
## NCBI VDB 2.10.2
**January 15, 2020**
=====================================
build/Makefile.vers
=====================================
@@ -23,4 +23,4 @@
# ===========================================================================
# NCBI-VDB and library version
-VERSION = 2.10.2
+VERSION = 2.10.3
=====================================
libs/blast/blast-mgr.c
=====================================
@@ -50,7 +50,7 @@
#include <stdio.h> /* fprintf */
#include <string.h> /* memset */
-#define TOOLKIT "sratoolkit2_10_2"
+#define TOOLKIT "sratoolkit2_10_3"
/******************************************************************************/
=====================================
libs/kdb/libkdb.vers.h
=====================================
@@ -24,4 +24,4 @@
*
*/
-#define LIBKDB_VERS 0x02070022
+#define LIBKDB_VERS 0x02070023
=====================================
libs/klib/release-vers.h
=====================================
@@ -28,7 +28,7 @@
/* Version of current SRA Toolkit Release */
-#define RELEASE_VERS 0x020A0002
+#define RELEASE_VERS 0x020A0003
/* Type of Version of current SRA Toolkit Release is one of:
=====================================
libs/ncbi-vdb/libncbi-vdb.vers
=====================================
@@ -1 +1 @@
-2.10.2
+2.10.3
=====================================
libs/sraxf/format-spot-name.c
=====================================
@@ -46,8 +46,10 @@
* "name_fmt" [ DATA ] - name format string ( see format explanation below )
*
* "X" [ DATA ] - X coordinate for spot
+ * it's expected to be empty: VDB-4097
*
* "Y" [ DATA ] - Y coordinate for spot
+ * it's expected to be empty: VDB-4097
*
* "spot_name" [ DATA, OPTIONAL ] - potential source of unformatted names
*
@@ -91,13 +93,21 @@ rc_t CC format_spot_name ( void *self,
char sname[1024]; /** name on stack **/
const char *name_fmt = ((char*)argv[0].u.data.base) + argv[0].u.data.first_elem;
uint32_t i, j, x, y;
+ bool have_x = false, have_y = false;
const uint32_t fmt_size = argv [ 0 ] . u . data . elem_count;
/* the coordinates to substitute */
- x = ( ( const int32_t* ) argv [ 1 ] . u . data . base )
- [ argv [ 1 ] . u . data . first_elem ];
- y = ( ( const int32_t* ) argv [ 2 ] . u . data . base )
- [ argv [ 2 ] . u . data . first_elem ];
+ have_x = argv [ 1 ] . u . data . elem_count > 0
+ && argv [ 1 ] . u . data . base != NULL;
+ have_y = argv [ 2 ] . u . data . elem_count > 0
+ && argv [ 2 ] . u . data . base != NULL;
+
+ if ( have_x )
+ x = ( ( const int32_t* ) argv [ 1 ] . u . data . base )
+ [ argv [ 1 ] . u . data . first_elem ];
+ if ( have_y )
+ y = ( ( const int32_t* ) argv [ 2 ] . u . data . base )
+ [ argv [ 2 ] . u . data . first_elem ];
for ( i=j=0; i < fmt_size -1;){
if( name_fmt [ i ] == '$' ){
@@ -105,7 +115,7 @@ rc_t CC format_spot_name ( void *self,
case 'x': case 'X':
if( j > sizeof(sname) - 11){
return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
- } else {
+ } else if( have_x ){
i+=2;
if( i < fmt_size -1 && name_fmt [ i ] == '%' && isdigit(name_fmt [ i+1 ])) {
x += 24*1024*(name_fmt [ i+1 ]-'0');
@@ -113,11 +123,14 @@ rc_t CC format_spot_name ( void *self,
}
j+=sprintf(sname+j,"%d",x);
}
+ else
+ return RC ( rcXF, rcFunction, rcDecoding,
+ rcData, rcNotFound );
break;
case 'y': case 'Y':
if( j > sizeof(sname) - 11){
return RC ( rcXF, rcFunction, rcDecoding, rcBuffer, rcInsufficient );
- } else {
+ } else if( have_y ){
i+=2;
if( i < fmt_size -1 && name_fmt [ i ] == '%' && isdigit(name_fmt [ i+1 ])) {
y += 24*1024*(name_fmt [ i+1 ]-'0');
@@ -125,6 +138,9 @@ rc_t CC format_spot_name ( void *self,
}
j+=sprintf(sname+j,"%d",y);
}
+ else
+ return RC ( rcXF, rcFunction, rcDecoding,
+ rcData, rcNotFound );
break;
case 'q': case 'Q':
if( j > sizeof(sname) - 5) {
=====================================
libs/vdb/libvdb.vers.h
=====================================
@@ -24,4 +24,4 @@
*
*/
-#define LIBVDB_VERS 0x02070022
+#define LIBVDB_VERS 0x02070023
=====================================
test/sraxf/Makefile
=====================================
@@ -29,6 +29,7 @@ TOP ?= $(abspath ../..)
MODULE = test/sraxf
TEST_TOOLS = \
+ test-format_spot_name \
test-fix_read_seg \
test_syn_quality \
@@ -60,6 +61,20 @@ $(TEST_BINDIR)/test-fix_read_seg: $(SRATEST_OBJ)
$(LP) --exe -o $@ $^ $(SRATEST_LIB)
+#----------------------------------------------------------------
+# test-format_spot_name
+#
+
+TFSN_SRC = \
+ test-format_spot_name
+
+TFSN_OBJ = \
+ $(addsuffix .$(OBJX),$(TFSN_SRC))
+
+$(TEST_BINDIR)/test-format_spot_name: $(TFSN_OBJ)
+ $(LP) --exe -o $@ $^ $(SRATEST_LIB)
+
+
#----------------------------------------------------------------
# test_syn_quality
#
=====================================
test/sraxf/test-format_spot_name.cpp
=====================================
@@ -0,0 +1,94 @@
+/*===========================================================================
+ *
+ * PUBLIC DOMAIN NOTICE
+ * National Center for Biotechnology Information
+ *
+ * This software/database is a "United States Government Work" under the
+ * terms of the United States Copyright Act. It was written as part of
+ * the author's official duties as a United States Government employee and
+ * thus cannot be copyrighted. This software/database is freely available
+ * to the public for use. The National Library of Medicine and the U.S.
+ * Government have not placed any restriction on its use or reproduction.
+ *
+ * Although all reasonable efforts have been taken to ensure the accuracy
+ * and reliability of the software and data, the NLM and the U.S.
+ * Government do not and cannot warrant the performance or results that
+ * may be obtained by using this software or data. The NLM and the U.S.
+ * Government disclaim all warranties, express or implied, including
+ * warranties of performance, merchantability or fitness for any particular
+ * purpose.
+ *
+ * Please cite the author in any work or product based on this material.
+ *
+ * ===========================================================================
+ * to add debug arguments to to command line use: "-app_args='-+VFS -s'"
+ * ========================================================================== */
+
+#include <kapp/args.h> /* Args */
+#include <kfg/kfg-priv.h> /* KConfigMakeEmpty */
+#include <ktst/unit_test.hpp> /* TEST_SUITE_WITH_ARGS_HANDLER */
+
+#include <vdb/cursor.h> /* VCursorRelease */
+#include <vdb/database.h> /* VDatabaseRelease */
+#include <vdb/manager.h> /* VDBManagerRelease */
+#include <vdb/table.h> /* VTableRelease */
+
+static rc_t argsHandler(int argc, char* argv[]) {
+
+ Args* args = NULL;
+ rc_t rc = ArgsMakeAndHandle(&args, argc, argv, 0, NULL, 0);
+ ArgsWhack(args);
+ return rc;
+}
+
+TEST_SUITE_WITH_ARGS_HANDLER(FormatSpotNameSuite, argsHandler)
+
+TEST_CASE(TestFormatSpotName) { // VDB-4097
+ const VDBManager *mgr = NULL;
+ REQUIRE_RC(VDBManagerMakeRead(&mgr, NULL));
+
+ const VDatabase *db = NULL;
+ REQUIRE_RC(VDBManagerOpenDBRead(mgr, &db, NULL, "SRR9203980"));
+
+ const VTable *tbl = NULL;
+ REQUIRE_RC(VDatabaseOpenTableRead(db, &tbl, "SEQUENCE"));
+
+ const VCursor *curs;
+ REQUIRE_RC(VTableCreateCachedCursorRead(tbl, &curs, 256 * 1024 * 1024));
+ uint32_t idx = 0;
+ REQUIRE_RC(VCursorAddColumn(curs, &idx, "NAME"));
+ REQUIRE_RC(VCursorOpen(curs));
+ REQUIRE_RC(VCursorOpenRow(curs));
+
+ const void *base = NULL;
+ uint32_t boff = 0;
+ uint32_t row_len = 0;
+ REQUIRE_RC(VCursorCellData(curs, idx, NULL, &base, &boff, &row_len));
+
+ REQUIRE_RC(VCursorRelease(curs));
+
+ REQUIRE_RC(VTableRelease(tbl));
+
+ REQUIRE_RC(VDatabaseRelease(db));
+
+ REQUIRE_RC(VDBManagerRelease(mgr));
+}
+
+const char UsageDefaultName[] = "test-format-spot-name";
+rc_t CC UsageSummary(const char * progname) { return 0; }
+rc_t CC Usage(const Args * args) { return 0; }
+
+extern "C" {
+
+ ver_t CC KAppVersion(void) { return 0; }
+
+ int KMain(int argc, char *argv[]) {
+ KConfigDisableUserSettings(); // ignore ~/.ncbi/user-settings.mkfg
+
+ rc_t rc = FormatSpotNameSuite(argc, argv);
+ return rc;
+ }
+
+}
+
+/******************************************************************************/
View it on GitLab: https://salsa.debian.org/med-team/ncbi-vdb/-/commit/cc86d731480cc73edfded05b5c1b14812e0410fb
--
View it on GitLab: https://salsa.debian.org/med-team/ncbi-vdb/-/commit/cc86d731480cc73edfded05b5c1b14812e0410fb
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200224/d44b000c/attachment-0001.html>
More information about the debian-med-commit
mailing list