Skip to content

The simple_compression in examples fails with SIGSEGV,using a special set of use caces #3670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zh-wen opened this issue Jun 7, 2023 · 1 comment
Assignees

Comments

@zh-wen
Copy link

zh-wen commented Jun 7, 2023

The simple_compression demo in examples fails with SIGSEGV,using a special set of use caces.

To Reproduce

  1. enter examples directory, ~/zstd-1.5.5/examples
  2. generate data
#include <stdio.h>
#include "common.h"

int main()
{
    char cBuff[8192];
    int i = 0;
    for ( i = 0; i < 8192; i++)
    {
        cBuff[i] = (char)i % 16;
    }
    size_t cSize = 8192;
    saveFile_orDie("./test_data", cBuff, cSize);
    return 0;
}
  1. Run simple_compression in examples.
    ./simple_compression test_data

Expected behavior
will coredump

stack
#0 0x000000000046dda3 in FSE_buildCTable_wksp ()
#1 0x000000000041461b in ZSTD_buildCTable ()
#2 0x0000000000406fa3 in ZSTD_buildSequencesStatistics ()
#3 0x0000000000407aae in ZSTD_entropyCompressSeqStore.clone.1 ()
#4 0x000000000040b882 in ZSTD_compressBlock_internal ()
#5 0x000000000040bc51 in ZSTD_compressContinue_internal ()
#6 0x0000000000411258 in ZSTD_compressEnd_public ()
#7 0x0000000000412886 in ZSTD_compress ()
#8 0x0000000000401007 in compress_orDie ()
#9 0x00000000004011f0 in main ()

Environment

  • OS: CentOS Linux release 6.2 (Final)
  • Version:libc-2.12.so
  • Compiler: gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-4)
  • Build system:Makefile
  • zstd versions tested: 1.5.4 and 1.5.5
  • Flags: default

Additional context
zstd 1.5.2 version can run normally

@Cyan4973 Cyan4973 self-assigned this Jun 13, 2023
@Cyan4973
Copy link
Contributor

Cyan4973 commented Jun 13, 2023

I tested the proposed data sample (generated using the provided source code),
and on my local platform, simple_compression doesn't fail nor segfault :

 ./simple_compression test_data
                test_data :   8192 ->     125 - test_data.zst

edit :
I tested on a 2nd (completely different) platform,
observed the same result : simple_compression is successful, no segfault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants