lpereira / lwan

Experimental, scalable, high performance HTTP server
https://lwan.ws
GNU General Public License v2.0
5.92k stars 549 forks source link

MacOS - Killed 9 Problem... #170

Closed bbg closed 6 years ago

bbg commented 8 years ago

Hi,

I'm using MacOS Version 10.11.6, The source code is compiled successfully.

Compiler information.

Apple LLVM version 8.0.0 (clang-800.0.33.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Cmake version cmake version 3.6.1

Compilation shape.

batuhangoksu:build batuhangoksu$ cmake .. -DCMAKE_BUILD_TYPE=Release
-- Running CMake for lwan (Scalable, high performance, experimental web server)
-- tcmalloc found: /usr/local/lib/libtcmalloc_minimal.dylib
-- Valgrind headers not found -- disabling valgrind support
-- Building with Lua support using luajit-5.1
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   lwan-shared

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/batuhangoksu/desktop/lwan/build
batuhangoksu:build batuhangoksu$ make
Scanning dependencies of target mimegen
[  2%] Creating directories for 'mimegen'
[  4%] No download step for 'mimegen'
[  6%] No patch step for 'mimegen'
[  8%] No update step for 'mimegen'
[ 11%] Performing configure step for 'mimegen'
-- The C compiler identification is AppleClang 8.0.0.8000033
-- Check for working C compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is AppleClang 8.0.0.8000033
-- Check for working CXX compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.5") 
-- Using zlib (/usr/lib/libz.dylib) for mimegen
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/batuhangoksu/desktop/lwan/build/common/tools/src/mimegen-build
[ 13%] Performing build step for 'mimegen'
Scanning dependencies of target mimegen
[ 20%] Building C object CMakeFiles/mimegen.dir/mimegen.c.o
[ 40%] Building C object CMakeFiles/mimegen.dir/Users/batuhangoksu/desktop/lwan/common/hash.c.o
[ 60%] Building C object CMakeFiles/mimegen.dir/Users/batuhangoksu/desktop/lwan/common/murmur3.c.o
[ 80%] Building C object CMakeFiles/mimegen.dir/Users/batuhangoksu/desktop/lwan/common/reallocarray.c.o
[100%] Linking C executable mimegen
[100%] Built target mimegen
[ 15%] Performing install step for 'mimegen'
[ 17%] Completed 'mimegen'
[ 17%] Built target mimegen
Scanning dependencies of target generate_mime_types_table
[ 20%] Generating ../mime-types.h
Uncompressed: 27945 bytes; compressed: 7380 bytes (compressed 3.786585x)
[ 20%] Built target generate_mime_types_table
Scanning dependencies of target lwan-static
[ 22%] Building C object common/CMakeFiles/lwan-static.dir/base64.c.o
[ 24%] Building C object common/CMakeFiles/lwan-static.dir/hash.c.o
[ 26%] Building C object common/CMakeFiles/lwan-static.dir/int-to-str.c.o
[ 28%] Building C object common/CMakeFiles/lwan-static.dir/list.c.o
[ 31%] Building C object common/CMakeFiles/lwan-static.dir/lwan.c.o
[ 33%] Building C object common/CMakeFiles/lwan-static.dir/lwan-cache.c.o
[ 35%] Building C object common/CMakeFiles/lwan-static.dir/lwan-config.c.o
[ 37%] Building C object common/CMakeFiles/lwan-static.dir/lwan-coro.c.o
[ 40%] Building C object common/CMakeFiles/lwan-static.dir/lwan-http-authorize.c.o
[ 42%] Building C object common/CMakeFiles/lwan-static.dir/lwan-io-wrappers.c.o
[ 44%] Building C object common/CMakeFiles/lwan-static.dir/lwan-job.c.o
[ 46%] Building C object common/CMakeFiles/lwan-static.dir/lwan-redirect.c.o
[ 48%] Building C object common/CMakeFiles/lwan-static.dir/lwan-request.c.o
[ 51%] Building C object common/CMakeFiles/lwan-static.dir/lwan-response.c.o
[ 53%] Building C object common/CMakeFiles/lwan-static.dir/lwan-rewrite.c.o
[ 55%] Building C object common/CMakeFiles/lwan-static.dir/lwan-serve-files.c.o
[ 57%] Building C object common/CMakeFiles/lwan-static.dir/lwan-socket.c.o
[ 60%] Building C object common/CMakeFiles/lwan-static.dir/lwan-status.c.o
[ 62%] Building C object common/CMakeFiles/lwan-static.dir/lwan-straitjacket.c.o
[ 64%] Building C object common/CMakeFiles/lwan-static.dir/lwan-tables.c.o
[ 66%] Building C object common/CMakeFiles/lwan-static.dir/lwan-template.c.o
[ 68%] Building C object common/CMakeFiles/lwan-static.dir/lwan-thread.c.o
[ 71%] Building C object common/CMakeFiles/lwan-static.dir/lwan-trie.c.o
[ 73%] Building C object common/CMakeFiles/lwan-static.dir/missing.c.o
/Users/batuhangoksu/desktop/lwan/common/missing.c:100:48: warning: implicit conversion changes signedness: 'long' to
      'unsigned long' [-Wsign-conversion]
        cur = (const char *)memchr(cur, c, end - cur);
                            ~~~~~~         ~~~~^~~~~
1 warning generated.
[ 75%] Building C object common/CMakeFiles/lwan-static.dir/murmur3.c.o
[ 77%] Building C object common/CMakeFiles/lwan-static.dir/patterns.c.o
[ 80%] Building C object common/CMakeFiles/lwan-static.dir/reallocarray.c.o
[ 82%] Building C object common/CMakeFiles/lwan-static.dir/realpathat.c.o
[ 84%] Building C object common/CMakeFiles/lwan-static.dir/sd-daemon.c.o
[ 86%] Building C object common/CMakeFiles/lwan-static.dir/strbuf.c.o
[ 88%] Building C object common/CMakeFiles/lwan-static.dir/lwan-lua.c.o
[ 91%] Linking C static library liblwan.a
[ 91%] Built target lwan-static
Scanning dependencies of target lwan-shared
[ 93%] Building C object common/CMakeFiles/lwan-shared.dir/__/empty.c.o
[ 95%] Linking C shared library liblwan.dylib
[ 95%] Built target lwan-shared
Scanning dependencies of target lwan
[ 97%] Building C object lwan/CMakeFiles/lwan.dir/main.c.o
[100%] Linking C executable lwan
[100%] Built target lwan
batuhangoksu:build batuhangoksu$ make
[ 17%] Built target mimegen
[ 20%] Built target generate_mime_types_table
[ 91%] Built target lwan-static
[ 95%] Built target lwan-shared
[100%] Built target lwan
batuhangoksu:build batuhangoksu$ sudo make install
Password:
[ 17%] Built target mimegen
[ 20%] Built target generate_mime_types_table
[ 91%] Built target lwan-static
[ 95%] Built target lwan-shared
[100%] Built target lwan
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/pkgconfig/lwan.pc
-- Installing: /usr/local/lib/liblwan.a
-- Installing: /usr/local/lib/liblwan.dylib
-- Installing: /usr/local/include/lwan/lwan.h
-- Installing: /usr/local/include/lwan/lwan-coro.h
-- Installing: /usr/local/include/lwan/lwan-trie.h
-- Installing: /usr/local/include/lwan/lwan-status.h
-- Installing: /usr/local/include/lwan/strbuf.h
-- Installing: /usr/local/include/lwan/hash.h
-- Installing: /usr/local/include/lwan/lwan-template.h
-- Installing: /usr/local/include/lwan/lwan-serve-files.h
-- Installing: /usr/local/include/lwan/lwan-config.h
-- Installing: /usr/local/bin/lwan

I am running after lwan file. "Killed 9" gives the error.

lpereira commented 8 years ago

I only have access to a OS X 10.10 machine (with Apple LLVM version 7.0.2 (clang-700.1.81)), and I can't reproduce. Being killed with a signal of "9" is weird, since that's SIGKILL. Something is sending that signal to Lwan, which is pretty unexpected.

Let's try troubleshooting:

lampmanyao commented 8 years ago

It runs well on my MacOS. My gcc and cmake version as the same as yours. Do you have any coredump file? @batuhangoksu

bbg commented 8 years ago

@lpereira @LampmanYao

I think I've solved the problem. Lua 5.1.x or LuaJIT 2.x experiencing problems when compiled with Lwan. When compiled without Lua 5.1.x or LuaJIT 2.x running smoothly.

lpereira commented 8 years ago

This is pretty curious, as Lua is supposed to be fairly portable. I'll take a look whenever I'm close to the Mac I have access to.

hshq commented 7 years ago

I've had the same problem. It's OK with Lua5.1.5, but will fail to run with LuaJIT2.0.4. I think the problem comes from the dylib of LuaJIT2.0.4.

Then there's another problem: the lwan/lwan doesn't have any lwan_module_NAME symbol.

lpereira commented 7 years ago

This seems to be fixed by the commit that fixed #194. Can someone please confirm? (I still don't have access to any Mac.)

lpereira commented 6 years ago

Closing as fixed.