Rspamd: [BUG]Segmentaion fault on ARM64 upon startup

Created on 18 May 2019  Â·  21Comments  Â·  Source: rspamd/rspamd

Prerequisites

Describe the bug
The program gets a segfault if its not started with the --help or the -v switch
Backtrack for the bug
``
(gdb) bt full

0 0x0000ffff99939a90 in rspamd_rcl_jinja_handler (parser=, source=0xffff99ba7000 , source_len=1331, destination=0xffffee3ffed8, dest_len=0xffffee3ffee0, user_data=0xffff996f1160) at /work/community/rspamd/src/rspamd-1.9.3/src/libserver/cfg_rcl.c:3594

    tb = 0x0
    cfg = 0xffff996f1160
    L = 0x65e296fe2378
    err_idx = 4
    __func__ = "rspamd_rcl_jinja_handler"

1 0x0000ffff99a201f0 in ucl_parser_add_chunk_full (parse_type=UCL_PARSE_UCL, strat=UCL_DUPLICATE_APPEND, priority=0, len=1331, data=0xffff99ba7000 , parser=0xaaaabc249ea0) at /work/community/rspamd/src/rspamd-1.9.3/contrib/libucl/ucl_parser.c:2884

    ndata = 0x0
    nlen = 0
    nchain = <optimized out>
    chunk = 0xaaaabc248c40
    special_handler = 0xffff968d42b8
    chunk = <optimized out>
    special_handler = <optimized out>
    ndata = <optimized out>
    nlen = <optimized out>
    nchain = <optimized out>

2 ucl_parser_add_chunk_full (parser=0xaaaabc249ea0, data=, len=, priority=0, strat=UCL_DUPLICATE_APPEND, parse_type=UCL_PARSE_UCL) at /work/community/rspamd/src/rspamd-1.9.3/contrib/libucl/ucl_parser.c:2851

    chunk = <optimized out>
    special_handler = <optimized out>
    ndata = <optimized out>
    nlen = <optimized out>
    nchain = <optimized out>

3 0x0000ffff9993d278 in rspamd_config_parse_ucl (cfg=cfg@entry=0xffff996f1160, filename=filename@entry=0xaaaaaeb3f57b "/etc/rspamd/rspamd.conf", vars=vars@entry=0x0, inc_trace=inc_trace@entry=0x0, trace_data=trace_data@entry=0x0, skip_jinja=0, err=0xaaaabc2494a0, err@entry=0xffffee401080)

at /work/community/rspamd/src/rspamd-1.9.3/src/libserver/cfg_rcl.c:3763
    st = {st_dev = 64768, st_ino = 2382160, st_mode = 33188, st_nlink = 1, st_uid = 0, st_gid = 0, st_rdev = 0, __pad = 0, st_size = 1331, st_blksize = 4096, __pad2 = 0, st_blocks = 8, st_atim = {tv_sec = 1558177284, tv_nsec = 0}, st_mtim = {tv_sec = 1558177284, tv_nsec = 0}, st_ctim = {tv_sec = 1558178843, tv_nsec = 787569357}, __unused = {0, 0}}
    fd = <optimized out>
    parser = 0xaaaabc249ea0
    keypair_path = "/etc/rspamd/rspamd.conf.key\000/usr/local/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so\000it.lua;./?.lua;/usr/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/l"...
    decrypt_keypair = 0x0
    data = 0xffff99ba7000 <error: Cannot access memory at address 0xffff99ba7000>
    __func__ = "rspamd_config_parse_ucl"

4 0x0000ffff99940024 in rspamd_config_read (cfg=0xffff996f1160, filename=0xaaaaaeb3f57b "/etc/rspamd/rspamd.conf", logger_fin=0xaaaaaeb360c0 , logger_ud=0xffff99bb1060, vars=0x0, skip_jinja=0, lua_env=0x0) at /work/community/rspamd/src/rspamd-1.9.3/src/libserver/cfg_rcl.c:3802

    err = 0x0
    top = <optimized out>
    logger_section = <optimized out>
    logger_obj = <optimized out>
    __func__ = "rspamd_config_read"

5 0x0000aaaaaeb35ff4 in load_rspamd_config (rspamd_main=0xffff99bb1060, cfg=0xffff996f1160, init_modules=1, opts=(RSPAMD_CONFIG_INIT_URL | RSPAMD_CONFIG_INIT_LIBS | RSPAMD_CONFIG_INIT_SYMCACHE | RSPAMD_CONFIG_INIT_VALIDATE | RSPAMD_CONFIG_INIT_PRELOAD_MAPS), reload=0) at /work/community/rspamd/src/rspamd-1.9.3/src/rspamd.c:932

    __func__ = "load_rspamd_config"

6 0x0000aaaaaeb293f8 in main (argc=, argv=, env=) at /work/community/rspamd/src/rspamd-1.9.3/src/rspamd.c:1385

    i = <optimized out>
    res = 0
    signals = {__sa_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__bits = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
    sigpipe_act = {__sa_handler = {sa_handler = 0xffff99bb4000, sa_sigaction = 0xffff99bb4000}, sa_mask = {__bits = {3, 281474678920872, 187650052099408, 288, 0, 281473260933120, 0, 281473260929024, 281473260929024, 128, 281473260933120, 5, 281473260924476, 0, 0, 281474678920800}}, sa_flags = -1716353352, sa_restorer = 0xffffee4016c8}
    pworker = <optimized out>
    type = 1
    control_addr = 0x0
    ev_base = <optimized out>
    term_ev = {ev_evcallback = {evcb_active_next = {tqe_next = 0xffff99683000, tqe_prev = 0xffffee4012c0}, evcb_flags = 2508, evcb_pri = 179 '\263', evcb_closure = 153 '\231', evcb_cb_union = {evcb_callback = 0xffff98d36400, evcb_selfcb = 0xffff98d36400, evcb_evfinalize = 0xffff98d36400, evcb_cbfinalize = 0xffff98d36400}, evcb_arg = 0x28}, 
      ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0xfffffffffffffc00, tqe_prev = 0xffff99682000}, min_heap_idx = -1024}, ev_fd = -297790736, ev_base = 0xffff99b3042c <malloc+600>, ev_ = {ev_io = {ev_io_next = {le_next = 0xffff99571a40, le_prev = 0x8}, ev_timeout = {tv_sec = -256, tv_usec = 281473260920832}}, ev_signal = {ev_signal_next = {
            le_next = 0xffff99571a40, le_prev = 0x8}, ev_ncalls = -256, ev_pncalls = 0xffff99bb2000}}, ev_events = 24, ev_res = 0, ev_timeout = {tv_sec = 281473260923728, tv_usec = 281473260933120}}
    int_ev = {ev_evcallback = {evcb_active_next = {tqe_next = 0x318, tqe_prev = 0x21}, evcb_flags = 10288, evcb_pri = 187 '\273', evcb_closure = 153 '\231', evcb_cb_union = {evcb_callback = 0x308, evcb_selfcb = 0x308, evcb_evfinalize = 0x308, evcb_cbfinalize = 0x308}, evcb_arg = 0xffff99bb5000}, ev_timeout_pos = {ev_next_with_common_timeout = {
          tqe_next = 0xffffee401340, tqe_prev = 0xffff99b300f4}, min_heap_idx = -297790656}, ev_fd = -1730556016, ev_base = 0xffff99bb2830, ev_ = {ev_io = {ev_io_next = {le_next = 0xffff99bb2000, le_prev = 0xffff99bb1720}, ev_timeout = {tv_sec = 448, tv_usec = 0}}, ev_signal = {ev_signal_next = {le_next = 0xffff99bb2000, le_prev = 0xffff99bb1720}, 
          ev_ncalls = 448, ev_pncalls = 0x0}}, ev_events = 160, ev_res = 0, ev_timeout = {tv_sec = 28, tv_usec = 281473246154192}}
    cld_ev = {ev_evcallback = {evcb_active_next = {tqe_next = 0xffff99bb4000, tqe_prev = 0x21}, evcb_flags = 28, evcb_pri = 0 '\000', evcb_closure = 0 '\000', evcb_cb_union = {evcb_callback = 0xffffee4013d0, evcb_selfcb = 0xffffee4013d0, evcb_evfinalize = 0xffffee4013d0, evcb_cbfinalize = 0xffffee4013d0}, evcb_arg = 0xffff99b3042c <malloc+600>}, 
      ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0xffffee4013e0, tqe_prev = 0xffff99b3042c <malloc+600>}, min_heap_idx = -297790496}, ev_fd = -297790480, ev_base = 0xffff99b3042c <malloc+600>, ev_ = {ev_io = {ev_io_next = {le_next = 0xffff98d36b40, le_prev = 0x0}, ev_timeout = {tv_sec = -1, tv_usec = 281473260920832}}, ev_signal = {
          ev_signal_next = {le_next = 0xffff98d36b40, le_prev = 0x0}, ev_ncalls = -1, ev_pncalls = 0xffff99bb2000}}, ev_events = 24, ev_res = 0, ev_timeout = {tv_sec = 281473260923104, tv_usec = 281473260933120}}
    hup_ev = {ev_evcallback = {evcb_active_next = {tqe_next = 0xa8, tqe_prev = 0xffff98d36b40}, evcb_flags = -15264, evcb_pri = 217 '\331', evcb_closure = 152 '\230', evcb_cb_union = {evcb_callback = 0x2, evcb_selfcb = 0x2, evcb_evfinalize = 0x2, evcb_cbfinalize = 0x2}, evcb_arg = 0xffff98d36b40}, ev_timeout_pos = {ev_next_with_common_timeout = {
          tqe_next = 0x0, tqe_prev = 0x0}, min_heap_idx = 0}, ev_fd = -297790432, ev_base = 0xffff995a8b18, ev_ = {ev_io = {ev_io_next = {le_next = 0xffff98d9c460, le_prev = 0xc8}, ev_timeout = {tv_sec = 0, tv_usec = 0}}, ev_signal = {ev_signal_next = {le_next = 0xffff98d9c460, le_prev = 0xc8}, ev_ncalls = 0, ev_pncalls = 0x0}}, ev_events = 27424, 
      ev_res = -26413, ev_timeout = {tv_sec = 5, tv_usec = 281474678920304}}
    usr1_ev = {ev_evcallback = {evcb_active_next = {tqe_next = 0xffff995a8f80, tqe_prev = 0xffff99682000}, evcb_flags = -15264, evcb_pri = 217 '\331', evcb_closure = 152 '\230', evcb_cb_union = {evcb_callback = 0xffff98d36b40, evcb_selfcb = 0xffff98d36b40, evcb_evfinalize = 0xffff98d36b40, evcb_cbfinalize = 0xffff98d36b40}, evcb_arg = 0xffff99bb3fa8}, 
      ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0x3, tqe_prev = 0xffff99bb459c}, min_heap_idx = 3}, ev_fd = 3, ev_base = 0x1c, ev_ = {ev_io = {ev_io_next = {le_next = 0xffffee4014e0, le_prev = 0xffff998e530c <rspamd_logger_add_debug_module+216>}, ev_timeout = {tv_sec = 281474678920416, tv_usec = 281473260628100}}, ev_signal = {

--Type for more, q to quit, c to continue without paging--
ev_signal_next = {le_next = 0xffffee4014e0, le_prev = 0xffff998e530c }, ev_ncalls = 5344, ev_pncalls = 0xffff99b6a884}}, ev_events = 0, ev_res = 0, ev_timeout = {tv_sec = 281473260929024, tv_usec = 281473260916992}}
control_ev = {ev_evcallback = {evcb_active_next = {tqe_next = 0x0, tqe_prev = 0x3}, evcb_flags = 17820, evcb_pri = 187 '\273', evcb_closure = 153 '\231', evcb_cb_union = {evcb_callback = 0x3, evcb_selfcb = 0x3, evcb_evfinalize = 0x3, evcb_cbfinalize = 0x3}, evcb_arg = 0x1c}, ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0xaaaaaeb53c50,
tqe_prev = 0x99b6a878}, min_heap_idx = -1363854256}, ev_fd = -297789888, ev_base = 0xffff99b6b498, ev_ = {ev_io = {ev_io_next = {le_next = 0xffff99bb4000, le_prev = 0x3}, ev_timeout = {tv_sec = 281474678920872, tv_usec = 187650052099408}}, ev_signal = {ev_signal_next = {le_next = 0xffff99bb4000, le_prev = 0x3}, ev_ncalls = 5800,
ev_pncalls = 0xaaaaaeb28d50

}}, ev_events = 288, ev_res = 0, ev_timeout = {tv_sec = 0, tv_usec = 281473260933120}}
term_tv = {tv_sec = 281473260924476, tv_usec = 281473255481344}
rspamd_main =
skip_pid = 0
valgrind_mode = 0
__func__ = "main"
``

Steps to Reproduce

  1. Start rspamd
  2. Segfault

Expected behavior
Normal startup sequence

Versions

Rspamd daemon version 1.9.3

Additional Information

It worked around in december now upgraded and crashes.
Might be releated to commit 812dfbbd064daf5f60260b5718bbe3ba4173eabf
CPU Arch is ARM64, runs on Scaleway

bug wontfix

All 21 comments

I don't have any arm64 hardware to test. So let's say it's unsupported.

If I give you access to my server, would you able to test it?

It's possible to build arm64 codes natively on CI with Drone Cloud - see https://cloud.drone.io - that should provide a suitable test environment with a modest amount of setup effort.

Also, there are some known issues to be aware of with Lua and LuaJIT on arm64, notable the use of a "lightuserdata" to store pointers. The Intel world has a 47-bit data type here, and arm64 has a 48-bit data type. There is way too much to wade through at https://github.com/LuaJIT/LuaJIT/issues/49 but given that the relevant code change has Lua in it this is the first that comes to mind.

That's exactly what I'm working on.

The easiest workaround looks like disabling luajit on arm64 in fact.

I have it running on an arm64 platform with libluajit-5.1 just upgraded to 1.9.4 with no changes to configs just checked out 1.9.4 and ran cmake in build folder. Have been running it for about a year on arm64 rk3328, if you only have 2gb ram clamav will use pretty much all the ram

Do you have worker-normal disabled as per self scan setup? I had lots of problems until I enabled it and it didn't use any more noticeable resources. I setup worker-controller worker-normal and worker-proxy in override.d not local.d so it uses non overridden config from main config files

I was hitting segfault as well but apparently I wasn't compiling it properly. Installing the dependencies in this specific order and versions (to avoid issues) works:
````
apt install devscripts fakeroot debhelper dh-systemd libjemalloc-dev libunwind-dev cmake ragel libevent-dev lua5.1 liblua5.1-dev libsqlite3-0=3.16.2-5+deb9u1 libsqlite3-dev sqlite3 libmagic1=1:5.30-1+deb9u2 libmagic-dev libfann-dev libfann2 libluajit-5.1-common=2.1.0~beta3+dfsg-5.1~bpo9+1 luajit libluajit-5.1
`````
Then
git clone --recursive https://github.com/vstakhov/rspamd.git cd rspamd git checkout tags/1.9.4 mkdir rspamd.build cd rspamd.build cmake ../rspamd make dist tar xvf rspamd-1.9.4.tar.xz cd rspamd-1.9.4 debuild -uc -us cd .. dpkg -i *.deb
And it runs:
service rspamd status â—Ź rspamd.service - rapid spam filtering system Loaded: loaded (/lib/systemd/system/rspamd.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2019-07-01 16:03:07 UTC; 6s ago Docs: https://rspamd.com/doc/ Main PID: 14799 (rspamd) Tasks: 7 (limit: 4915) CGroup: /system.slice/rspamd.service

Also marked this package on hold, so apt wont ever replace it with: apt-mark hold rspamd

System: Debian GNU/Linux 9 (stretch) 4.4.179-rk3399
Related to: https://github.com/rspamd/rspamd/issues/2953

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I got segmentation fault on trying to start Rspamd 2.x on arm64, I originally just had luajit 5.1 installed. Removed that and used lua5.1 and it now runs. Looking at your dependencies you have lua5.1 then luajit5.1 at the end of the list. I think cmake chooses luajit5.1 if available before it checks for lua5.1

@a16bitsysop did you have any success bulding 2.2? What cmake version and build dependencies / packages are you using and from where (I had to manually build and install cmake)? Can you check https://github.com/rspamd/rspamd/issues/3175 and tell me if your build process is the same? Thank you.

Yes I have 2.2 running on arm64 on 2 sbc’s, one Compiled with clang and one with GCC as wasn’t sure if issue was GCC first. Do you have luajit installed? I just use
cmake ../rspamd
make -j8
make install

But don’t think that would make a difference, will check versions of dependencies I have.

Did an ldd on rspamd as thought might be more useful, this system is Ubuntu 18.04

  linux-vdso.so.1 (0x0000007fb6a79000)
        librspamd-server.so => /usr/local/lib/rspamd/librspamd-server.so (0x0000007fb6710000)
        libsqlite3.so.0 => /usr/lib/aarch64-linux-gnu/libsqlite3.so.0 (0x0000007fb6607000)
        libsodium.so.23 => /usr/lib/aarch64-linux-gnu/libsodium.so.23 (0x0000007fb65ca000)
        liblua5.1.so.0 => /usr/lib/aarch64-linux-gnu/liblua5.1.so.0 (0x0000007fb6593000)
        libglib-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0 (0x0000007fb6485000)
        librspamd-ev.so => /usr/local/lib/rspamd/librspamd-ev.so (0x0000007fb6464000)
        libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007fb630b000)
        /lib/ld-linux-aarch64.so.1 (0x0000007fb6a4e000)
        libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007fb6251000)
        libpcre.so.3 => /lib/aarch64-linux-gnu/libpcre.so.3 (0x0000007fb61df000)
        libicui18n.so.60 => /usr/lib/aarch64-linux-gnu/libicui18n.so.60 (0x0000007fb5f22000)
        libicuuc.so.60 => /usr/lib/aarch64-linux-gnu/libicuuc.so.60 (0x0000007fb5d4d000)
        libssl.so.1.1 => /usr/lib/aarch64-linux-gnu/libssl.so.1.1 (0x0000007fb5cc3000)
        libcrypto.so.1.1 => /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1 (0x0000007fb5a7f000)
        libz.so.1 => /lib/aarch64-linux-gnu/libz.so.1 (0x0000007fb5a52000)
        librt.so.1 => /lib/aarch64-linux-gnu/librt.so.1 (0x0000007fb5a3b000)
        librspamd-replxx.so => /usr/local/lib/rspamd/librspamd-replxx.so (0x0000007fb59f9000)
        librspamd-actrie.so => /usr/local/lib/rspamd/librspamd-actrie.so (0x0000007fb59d8000)
        librspamd-kann.so => /usr/local/lib/rspamd/librspamd-kann.so (0x0000007fb59a7000)
        libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007fb5983000)
        libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007fb5957000)
        libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000007fb5942000)
        libstdc++.so.6 => /usr/lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007fb57af000)
        libicudata.so.60 => /usr/lib/aarch64-linux-gnu/libicudata.so.60 (0x0000007fb3df6000)

@a16bitsysop thank you for the feedback. I'm running on Debian 9.11 (stretch) and I tried with both luajit and without it and the results seems to be the same. I even tried to build it inside a container to avoid having stuff from the past that might affect the build but it didn't work as well. Maybe it's just the fact that I'm in Debian?

I'm going to try to build in a different arm64 to check what happens, maybe this is something related with the RK3399. Strangely I can build 1.9.4 and it starts without issues as I described in here https://github.com/rspamd/rspamd/issues/2906#issuecomment-507328471

My two current builds are on rk3328’s
I have a rk3399 as well, I will try and compile on that one.

Built it and ran on a rk3399 (with no config change from default)

Including dependencies installed first.

dunc@roc:~$ lsb_release --all
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
dunc@roc:~$


Setting up libpcrecpp0v5:arm64 (2:8.39-12) ...
Setting up libncurses-dev:arm64 (6.1+20181013-2+deb10u2) ...
Setting up libsodium23:arm64 (1.0.17-1) ...
Setting up libpcre16-3:arm64 (2:8.39-12) ...
Setting up libmagic-mgc (1:5.35-4+deb10u1) ...
Setting up libarchive13:arm64 (3.3.3-4+deb10u1) ...
Setting up libmagic1:arm64 (1:5.35-4+deb10u1) ...
Setting up libsepol1-dev:arm64 (2.8-1) ...
Setting up libjemalloc2:arm64 (5.1.0-3) ...
Setting up libreadline-dev:arm64 (7.0-5) ...
Setting up libmagic-dev:arm64 (1:5.35-4+deb10u1) ...
Setting up libffi-dev:arm64 (3.2.1-9) ...
Setting up ragel (6.10-1) ...
Setting up libglib2.0-data (2.58.3-2+deb10u2) ...
Setting up libuv1:arm64 (1.24.1-1) ...
Setting up lua-cjson:arm64 (2.1.0+dfsg-2.1) ...
Setting up libsqlite3-dev:arm64 (3.27.2-3) ...
Setting up uuid-dev:arm64 (2.33.1-0.1) ...
Setting up libpcre32-3:arm64 (2:8.39-12) ...
Setting up icu-devtools (63.1-6) ...
Setting up pkg-config (0.29-6) ...
Setting up libsodium-dev:arm64 (1.0.17-1) ...
Setting up lua-bitop:arm64 (1.0.2-5) ...
Setting up zlib1g-dev:arm64 (1:1.2.11.dfsg-1) ...
Setting up librhash0:arm64 (1.3.8-1) ...
Setting up liblua5.1-0:arm64 (5.1.5-8.1+b2) ...
Setting up cmake-data (3.13.4-1) ...
Setting up python3-lib2to3 (3.7.3-1) ...
Setting up libicu-dev:arm64 (63.1-6) ...
Setting up libjsoncpp1:arm64 (1.7.4-3) ...
Setting up libhiredis0.14:arm64 (0.14.0-3) ...
Setting up python3-distutils (3.7.3-1) ...
Setting up libglib2.0-dev-bin (2.58.3-2+deb10u2) ...
Setting up libblkid-dev:arm64 (2.33.1-0.1) ...
Setting up liblua5.1-0-dev:arm64 (5.1.5-8.1+b2) ...
Setting up libpcre3-dev:arm64 (2:8.39-12) ...
Setting up libglib2.0-bin (2.58.3-2+deb10u2) ...
Setting up redis-tools (5:5.0.3-4+deb10u1) ...
Setting up cmake (3.13.4-1) ...
Setting up libmount-dev:arm64 (2.33.1-0.1) ...
Setting up libselinux1-dev:arm64 (2.8-1+b1) ...
Setting up redis-server (5:5.0.3-4+deb10u1) ...

dunc@roc:~/rspamd.build$ sudo rspamd -f
2019-12-06 20:51:44 #9783(main) <abd362>; main; detect_priv: cannot run rspamd workers as root user, please add -u and -g options to select a proper unprivilleged user or specify --insecure flag
dunc@roc:~/rspamd.build$ sudo rspamd -f -u nobody -g nobody
2019-12-06 20:53:17 #9791(main) <e62e34>; main; detect_priv: group specified does not exists (Success), aborting
dunc@roc:~/rspamd.build$ sudo rspamd -f -u nobody -g nogroup
open_log: cannot open desired log file: /var/log/rspamd/rspamd.log, No such file or directory
Fatal error, cannot open logfile, exiting
dunc@roc:~/rspamd.build$ sudo mkdir /var/log/rspamd
dunc@roc:~/rspamd.build$ sudo chown nobody:nogroup /var/log
log/     log.hdd/
dunc@roc:~/rspamd.build$ sudo chown nobody:nogroup /var/log/rspamd
dunc@roc:~/rspamd.build$ sudo rspamd -f -u nobody -g nogroup
^Cdunc@roc:~/rspamd.build$ sudo tail /var/log/rspamd/rspamd.log
2019-12-06 20:54:44 #9841(main) <406e52>; main; rspamd_check_termination_clause: normal process 9846 terminated normally
2019-12-06 20:54:44 #9841(main) <406e52>; main; rspamd_cld_handler: do not respawn process normal after found terminated process with pid 9846
2019-12-06 20:54:44 #9841(main) <406e52>; main; rspamd_check_termination_clause: normal process 9847 terminated normally
2019-12-06 20:54:44 #9841(main) <406e52>; main; rspamd_cld_handler: do not respawn process normal after found terminated process with pid 9847
2019-12-06 20:54:44 #9841(main) <406e52>; main; rspamd_check_termination_clause: controller process 9843 terminated normally
2019-12-06 20:54:44 #9841(main) <406e52>; main; rspamd_cld_handler: do not respawn process controller after found terminated process with pid 9843
2019-12-06 20:54:44 #9841(main) <406e52>; main; rspamd_check_termination_clause: normal process 9845 terminated normally
2019-12-06 20:54:44 #9841(main) <406e52>; main; rspamd_cld_handler: do not respawn process normal after found terminated process with pid 9845
2019-12-06 20:54:44 #9841(main) rspamd_roll_history_save: cannot save history to /var/lib/rspamd/rspamd.history: No such file or directory
2019-12-06 20:54:44 #9841(main) <406e52>; main; main: terminating...
dunc@roc:~/rspamd.build$

Thank you! I created a new container and installed all the dependencies you listed, and some other stuff that I found missing:

apt install devscripts fakeroot debhelper dh-systemd libjemalloc-dev libunwind-dev cmake libevent-dev libpcrecpp0v5 libncurses-dev libsodium23 libpcre16-3 libmagic-mgc libarchive13 libmagic1 libsepol1-dev libjemalloc2 libreadline-dev libmagic-dev libffi-dev ragel libglib2.0-data libuv1 lua-cjson libsqlite3-dev uuid-dev libpcre32-3 icu-devtools pkg-config libsodium-dev lua-bitop zlib1g-dev librhash0 liblua5.1-0 cmake-data python3-lib2to3 libicu-dev libjsoncpp1 libhiredis0.14 python3-distutils libglib2.0-dev-bin libblkid-dev liblua5.1-0-dev libpcre3-dev libglib2.0-bin redis-tools libmount-dev libselinux1-dev libssl-dev libcurl4-openssl-dev

After building I was able to start it without issues. Finally! Here is my build and package process for those interested:

git clone --recursive https://github.com/vstakhov/rspamd.git
cd rspamd 
git checkout tags/2.2
vim debian/changelog # change version to 2.2
vim CMakeLists.txt # enable systemd units if you would like to use them
cd ..
mkdir rspamd-build && cd rspamd-build
cmake ../rspamd
make dist
tar xvf rspamd-2.2.tar.xz
cd rspamd-2.2
debuild -uc -us -d
dpkg -i ../rspamd_2.2_arm64.deb

Thank you very much @a16bitsysop !

Cool, I don’t think 2.2+ uses libevent anymore?
I haven’t tried to build as a package yet.

Hm, not sure I believe I had to add it otherwise it would complain. I'll try to build 2.3 without it tomorrow.

Update: I was able to build and run 2.3 without installing libevent-dev.

I think cmake is missing a few dependency checks before it builds, my list of dependencies to build rspamd is currently:
cmake ragel pkg-config liblua5.1-dev libglib2.0-dev libsqlite3-dev libicu-dev libmagic-dev libssl-dev redis libsodium-dev

Was this page helpful?
0 / 5 - 0 ratings