[squid-users] FATAL: assertion failed: mem/PageStack.cc:159: "StoredNode().is_lock_free()"

Nishant Sharma codemarauder at gmail.com
Wed Jul 3 13:27:10 UTC 2024


Hello,

On 28/06/24 20:01, Nishant Sharma wrote:
> On 28/06/24 19:44, Alex Rousskov wrote:
>> I do not know the answer to your question. SMP performance penalties 
>> are often smaller for smaller cache sizes, but cache size is not the 
>> only performance-affecting locking-sensitive parameter, so YMMV.
> 
> I was able to compile after commenting the specific line of code. Squid 
> workers start and I am able to bind them to specific CPU cores.

I had reported the issue to Openwrt project as well and I understood 
that in order to save space, squid was being compiled for mips16 instead 
of mips32.

Even after compiling it for mips32 (by adding a flag for the build 
system), the error is still occuring as in the code in 
`ipc/mem/PageStack.h` `uint64_t` is specified.

I was able to compile by replacing `uint64_t` to `uint32_t` and squid 
worked with workers > 1.

Further discussion on Openwrt issue tracker suggested [1] the following:

<quote>
The posix definition is that lock ID is native integer. It should be 
some conditional in ./configure style portability of squid to run on 
(most) 32bit platforms.
</quote>

Is there any change that we need to do in the configure script to check 
for the availability of 64 bit atomic lock and use 32 bit lock if not 
available?

Or may be document the fact that it is not advisable / possible to run 
squid in SMP mode on such platforms that are not able to provide 64 bit 
lock ID.

I tried to go through config.log and could see the following messages 
which might or might not be related to this:

<config.log>
...
...
...

configure:46036: checking for uint64_t
configure:46036: $? = 0
configure:46036: result: yes

AND

configure:46027: checking for int64_t

configure:46027: mipsel-openwrt-linux-musl-g++ -std=c++17 -c 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include 
  -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves 
-fno-plt -fhonour-copts -msoft-float 
-fmacro-prefix-map=/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/build_dir/target-mipsel_24kc_musl/squid-6.10=squid-6.10 
-Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 
-Wl,-z,now -Wl,-z,relro -Wno-error 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include/libxml2 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/include 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include/fortify 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include 
  conftest.cpp >&5
configure:46027: $? = 0

configure:46027: mipsel-openwrt-linux-musl-g++ -std=c++17 -c 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include 
  -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves 
-fno-plt -fhonour-copts -msoft-float 
-fmacro-prefix-map=/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/build_dir/target-mipsel_24kc_musl/squid-6.10=squid-6.10 
-Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 
-Wl,-z,now -Wl,-z,relro -Wno-error 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include/libxml2 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/include 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include/fortify 
-I/home/devuser/openwrt-23.05/arthur/mt7621/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include 
  conftest.cpp >&5

conftest.cpp: In function 'int main()':
conftest.cpp:324:67: warning: integer overflow in expression of type 
'int64_t' {aka 'long long int'} results in '-9223372036854775808' 
[-Woverflow]
   324 |                  < (int64_t) (((((int64_t) 1 << N) << N) - 1) * 
2 + 2))];
       | 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
conftest.cpp:323:26: error: size '-1' of array 'test_array' is negative
   323 | static int test_array [1 - 2 * !((int64_t) (((((int64_t) 1 << 
N) << N) - 1) * 2 + 1)
       | 
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   324 |                  < (int64_t) (((((int64_t) 1 << N) << N) - 1) * 
2 + 2))];
       | 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
configure:46027: $? = 1

configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Squid Web Proxy"
| #define PACKAGE_TARNAME "squid"
| #define PACKAGE_VERSION "6.10"
| #define PACKAGE_STRING "Squid Web Proxy 6.10"
| #define PACKAGE_BUGREPORT "https://bugs.squid-cache.org/"
| #define PACKAGE_URL ""
...
...
...
...
</config.log>

Regards,
Nishant

* [1] 
https://github.com/openwrt/packages/issues/24469#issuecomment-2203033868


More information about the squid-users mailing list