Multithreaded Modules Crash/Hang

25 views
Skip to first unread message

André Naef

unread,
Jul 31, 2023, 9:14:09 AM7/31/23
to OpenLiteSpeed Development
I am developing a handler module for OpenLiteSpeed. As soon as I mark the module for multithreaded operation via LSI_HDLR_DEFAULT_POOL, crashes occur.

To isolate the issue, I have followed the instructions in the Module Developer's Guide v 0.6 and have compiled the (multithreaded, very simple) mthello.c example. This module hangs when accessed as a handler.

Steps to reproduce:

1. The Base system is Ubuntu 20.04 LTS.
2. OpenLiteSpeed 1.7.17 is installed from repository.
3. Compile mthello.c using the commands given in the Module Developer's Guide.
4. Copy the mthello.so file over to the server modules directory.
5. Add the module in the Server Configuration.
6. Add a module handler context with path /hello and module mthello to the Example virtual host.
7. Point a browser to the Example host and path /hello.

The browser hangs at this point. The server error log shows the following:

2023-07-31 15:06:35.536582 [DEBUG] [1427467] [127.0.0.1:60484#Example] Run module [mthello] handler.
2023-07-31 15:06:35.536585 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] Set up MtHandler
2023-07-31 15:06:35.536588 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] setupDynRespBodyBuf()
2023-07-31 15:06:35.536591 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] Allocate response body buffer.
2023-07-31 15:06:35.536595 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] GZIP the response body in the buffer.
2023-07-31 15:06:35.536637 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] setupGzipBuf() begin GZIP stream.
2023-07-31 15:06:35.536642 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] [Tm] unlock MtRace.
2023-07-31 15:06:46.554092 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] cleanUpHandler(): HSPS_HANDLER_PROCESSING -> HSPS_WAIT_MT_CANCEL
2023-07-31 15:06:46.554095 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] cancelMtHandler() called. 2
2023-07-31 15:06:46.554097 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] mark HSF_MT_CANCEL. 2
2023-07-31 15:06:46.554100 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] Notify blocking handler threads
2023-07-31 15:06:46.554148 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] calling removeSessionCb on this 0x118b0e0
2023-07-31 15:06:46.554165 [DEBUG] [1427467] [127.0.0.1:60484#Example:mthello] session 0x118b0e0 is still in use by MT_HANDLER, postone recycling.
ro

Can anyone provide some hint on what is going on here?

Thanks a lot!

Reply all
Reply to author
Forward
0 new messages