Skip to content

Commit

Permalink
Version 2.8.1 Fixed out-of-bound memory access issue for large inputs. (
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaGrebnov authored Apr 6, 2024
1 parent 0293905 commit 38f39d2
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Changes in 2.8.1 (April 5, 2024)
- Fixed out-of-bound memory access issue for large inputs (libsais64).

Changes in 2.8.0 (March 3, 2024)
- Implemented permuted longest common prefix array (PLCP) construction of an integer array.
- Fixed compilation error when compiling the library with OpenMP enabled.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)

project(libsais VERSION 2.8.0 LANGUAGES C DESCRIPTION "libsais is a library for linear time suffix array, longest common prefix array and burrows wheeler transform construction based on induced sorting algorithm.")
project(libsais VERSION 2.8.1 LANGUAGES C DESCRIPTION "libsais is a library for linear time suffix array, longest common prefix array and burrows wheeler transform construction based on induced sorting algorithm.")

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ The libsais provides simple C99 API to construct suffix array and Burrows-Wheele
The libsais is released under the [Apache License Version 2.0](LICENSE "Apache license")

## Changes
* April 5, 2024 (2.8.1)
* Fixed out-of-bound memory access issue for large inputs (libsais64).
* March 3, 2024 (2.8.0)
* Implemented permuted longest common prefix array (PLCP) construction of an integer array.
* Fixed compilation error when compiling the library with OpenMP enabled.
Expand Down Expand Up @@ -180,4 +182,4 @@ The libsais reuses space allocated for suffix array during construction. Sometim
| abac | 200000 | 0.002 sec ( 84.36 MB/s) | 0.003 sec ( 73.63 MB/s) | **+14.56%**| 0.002 sec ( 105.08 MB/s) | 0.002 sec ( 86.64 MB/s) | **+21.27%**|
| test3 | 2097088 | 0.034 sec ( 61.54 MB/s) | 0.037 sec ( 56.45 MB/s) | **+9.03%**| 0.028 sec ( 75.76 MB/s) | 0.032 sec ( 64.93 MB/s) | **+16.68%**|

> * All other files from [Benchmarks](#benchmarks) above do not suffer from this fallbacks.
> * All other files from [Benchmarks](#benchmarks) above do not suffer from this fallbacks.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.0
2.8.1
4 changes: 2 additions & 2 deletions include/libsais.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information.

#define LIBSAIS_VERSION_MAJOR 2
#define LIBSAIS_VERSION_MINOR 8
#define LIBSAIS_VERSION_PATCH 0
#define LIBSAIS_VERSION_STRING "2.8.0"
#define LIBSAIS_VERSION_PATCH 1
#define LIBSAIS_VERSION_STRING "2.8.1"

#ifdef _WIN32
#ifdef LIBSAIS_SHARED
Expand Down
4 changes: 2 additions & 2 deletions include/libsais16.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information.

#define LIBSAIS16_VERSION_MAJOR 2
#define LIBSAIS16_VERSION_MINOR 8
#define LIBSAIS16_VERSION_PATCH 0
#define LIBSAIS16_VERSION_STRING "2.8.0"
#define LIBSAIS16_VERSION_PATCH 1
#define LIBSAIS16_VERSION_STRING "2.8.1"

#ifdef _WIN32
#ifdef LIBSAIS_SHARED
Expand Down
4 changes: 2 additions & 2 deletions include/libsais64.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information.

#define LIBSAIS64_VERSION_MAJOR 2
#define LIBSAIS64_VERSION_MINOR 8
#define LIBSAIS64_VERSION_PATCH 0
#define LIBSAIS64_VERSION_STRING "2.8.0"
#define LIBSAIS64_VERSION_PATCH 1
#define LIBSAIS64_VERSION_STRING "2.8.1"

#ifdef _WIN32
#ifdef LIBSAIS_SHARED
Expand Down
2 changes: 1 addition & 1 deletion src/libsais64.c
Original file line number Diff line number Diff line change
Expand Up @@ -6304,7 +6304,7 @@ static sa_sint_t libsais64_main_32s_recursion(sa_sint_t * RESTRICT T, sa_sint_t
sa_sint_t new_fs = (fs + fs + n + n) <= INT32_MAX ? (fs + fs + n) : INT32_MAX - n;
if ((new_fs / k >= 4) || (new_fs >= fs))
{
libsais64_convert_inplace_64u_to_32u((uint32_t *)T, 0, n);
libsais64_convert_inplace_64u_to_32u((uint32_t *)(void *)T, 0, n);

#if defined(LIBSAIS_OPENMP)
sa_sint_t index = libsais_int_omp((int32_t *)T, (int32_t *)SA, (int32_t)n, (int32_t)k, (int32_t)new_fs, (int32_t)threads);
Expand Down

0 comments on commit 38f39d2

Please sign in to comment.