Project

General

Profile

Actions

Feature #4550

closed

pthreads: set minimum stack size

Added by Victor Julien over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:
Needs backport to 5.0, Needs backport to 6.0

Description

By default musl sets a really small stack size. If possible, we should set a bigger stack.

https://wiki.musl-libc.org/functional-differences-from-glibc.html


Related issues 4 (0 open4 closed)

Related to Suricata - Bug #4542: SIGSEGV in BodyBase64Buffer at output-json-http.c:439ClosedActions
Related to Suricata - Bug #3091: Suricata crashes with payload-buffer-size more than 1014kbClosedCommunity TicketActions
Copied to Suricata - Feature #4643: pthreads: set minimum stack sizeClosedShivani BhardwajActions
Copied to Suricata - Feature #4644: pthreads: set minimum stack sizeClosedJeff LucovskyActions
Actions #1

Updated by Victor Julien over 3 years ago

  • Related to Bug #4542: SIGSEGV in BodyBase64Buffer at output-json-http.c:439 added
Actions #2

Updated by Victor Julien over 3 years ago

  • Subject changed from set minimum stack size to pthreads: set minimum stack size
Actions #3

Updated by Jeff Lucovsky about 3 years ago

  • Copied to Feature #4643: pthreads: set minimum stack size added
Actions #4

Updated by Jeff Lucovsky about 3 years ago

  • Copied to Feature #4644: pthreads: set minimum stack size added
Actions #5

Updated by Victor Julien about 3 years ago

  • Target version changed from 7.0.0-beta1 to 8.0.0-beta1
Actions #6

Updated by Victor Julien about 3 years ago

  • Status changed from New to Assigned
  • Assignee changed from OISF Dev to Jeff Lucovsky
  • Target version changed from 8.0.0-beta1 to 7.0.0-beta1
Actions #7

Updated by Victor Julien about 3 years ago

Easy way to check this is to use a Alpine docker image.

Actions #8

Updated by Jeff Lucovsky about 3 years ago

The following information was obtained from an Alpine docker image running Suricata-master

The stack size is 8388608 which is the same as a libc-backed Suricata on my ubuntu linux system.

bash-5.1$ ldd $(which suricata)
        /lib/ld-musl-x86_64.so.1 (0x7fd7504c9000)
        libhiredis.so.1.0.0 => /usr/lib/libhiredis.so.1.0.0 (0x7fd74fc31000)
        libmagic.so.1 => /usr/lib/libmagic.so.1 (0x7fd74fc0d000)
        libbpf.so.0 => /usr/lib/libbpf.so.0 (0x7fd74fbd0000)
        libcap-ng.so.0 => /usr/lib/libcap-ng.so.0 (0x7fd74fbc8000)
        libnetfilter_queue.so.1 => /usr/lib/libnetfilter_queue.so.1 (0x7fd74fbbf000)
        libnfnetlink.so.0 => /usr/lib/libnfnetlink.so.0 (0x7fd74fbb7000)
        libjansson.so.4 => /usr/lib/libjansson.so.4 (0x7fd74fba9000)
        libyaml-0.so.2 => /usr/lib/libyaml-0.so.2 (0x7fd74fb8d000)
        libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x7fd74faf0000)
        libz.so.1 => /lib/libz.so.1 (0x7fd74fad6000)
        libpcap.so.1 => /usr/lib/libpcap.so.1 (0x7fd74fa98000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fd74fa7e000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fd7504c9000)
        libelf.so.1 => /usr/lib/libelf.so.1 (0x7fd74fa67000)
        libmnl.so.0 => /usr/lib/libmnl.so.0 (0x7fd74fa5f000)
bash-5.1$ pidof suricata
1
bash-5.1$ ps -ef
PID   USER     TIME  COMMAND
    1 root      3:40 {Suricata-Main} /usr/bin/suricata -i enp6s0f0 -v
   37 suricata  0:00 bash
   58 suricata  0:00 ps -ef
bash-5.1$ cat /proc/1/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        unlimited            unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             unlimited            unlimited            processes
Max open files            1048576              1048576              files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       321606               321606               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us
Actions #9

Updated by Victor Julien over 2 years ago

  • Related to Bug #3091: Suricata crashes with payload-buffer-size more than 1014kb added
Actions #10

Updated by Jeff Lucovsky over 2 years ago

  • Status changed from Assigned to In Review
Actions #11

Updated by Jeff Lucovsky over 2 years ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF