lpereira / lwan

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

Unable to build on ARM 32-bit #108

Closed hbfs closed 9 years ago

hbfs commented 9 years ago

Quad Core Cortex ARMv7

processor       : 0-3
model name      : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 48.00
Features        : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc0d
CPU revision    : 1
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
$ make
[  2%] Built target generate_mime_types_table
[  5%] Building C object common/CMakeFiles/lwan-common.dir/base64.c.o
*** Error in `/usr/bin/cc': double free or corruption (top): 0x0009ce80 ***
Aborted
make[2]: *** [common/CMakeFiles/lwan-common.dir/base64.c.o] Error 134
make[1]: *** [common/CMakeFiles/lwan-common.dir/all] Error 2
make: *** [all] Error 2
lpereira commented 9 years ago

That looks like a compiler bug, possibly hardware problem (corrupted memory is pretty common, specially considering ARM systems will have their root file systems on SD cards).

Can you compile other programs on the same hardware?

hbfs commented 9 years ago

Thanks for the super fast reply!

The root filesystem is on NAND / eMMC. I've compiled other programs without issue, do you have a specific project you would like me to test?

lpereira commented 9 years ago

If the same compiler can build other software, there must be something in base64.c that's triggering a compiler bug. There's not much that can be done from the Lwan side.

lpereira commented 9 years ago

I'm downloading Ubuntu for my RPi2; will see if I can reproduce.

lpereira commented 9 years ago

Couldn't reproduce here. Up-to-date Ubuntu 14.04.2, running on an RPi2 (ARMv7 as well), could build without problems. So it's unlikely a compiler bug; it's more likely a corrupted root filesystem or faulty hardware (RAM?).

hbfs commented 9 years ago

I'll reflash my board and try again.

lpereira commented 9 years ago

Any luck, @hbfs?

hbfs commented 9 years ago

@lpereira week is off to a busy start -- got some time to look into this..

Even after a clean image on the original box there are issues leading me to believe its a bad image. Here's the config:

$ cmake .. -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.8")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test HAVE_BUILTIN_CPU_INIT
-- Performing Test HAVE_BUILTIN_CPU_INIT - Failed
-- Performing Test HAVE_BUILTIN_UMULL_OVERFLOW
-- Performing Test HAVE_BUILTIN_UMULL_OVERFLOW - Failed
-- Performing Test HAVE_STATIC_ASSERT
-- Performing Test HAVE_STATIC_ASSERT - Success
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- libc has clock_gettime(). Good.
-- jemalloc and tcmalloc were not found, using system malloc
-- Performing Test HAS_LTO
-- Performing Test HAS_LTO - Success
-- Performing Test HAS_FAT_LTO_OBJECTS
-- Performing Test HAS_FAT_LTO_OBJECTS - Success
-- Performing Test HAVE_BUILTIN_IA32_CRC32
-- Performing Test HAVE_BUILTIN_IA32_CRC32 - Failed
-- Valgrind headers not found -- disabling valgrind support
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- checking for modules 'luajit>=2.0;luajit<=2.0.9999'
--   package 'luajit>=2.0' not found
--   package 'luajit<=2.0.9999' not found
-- checking for modules 'lua>=5.1.0;lua<=5.1.999'
--   package 'lua>=5.1.0' not found
--   package 'lua<=5.1.999' not found
-- checking for modules 'lua>=5.1.0;lua<=5.1.999'
--   package 'lua>=5.1.0' not found
--   package 'lua<=5.1.999' not found
-- checking for modules 'lua51>=5.1.0;lua51<=5.1.999'
--   package 'lua51>=5.1.0' not found
--   package 'lua51<=5.1.999' not found
-- checking for modules 'lua5.1>=5.1.0;lua5.1<=5.1.999'
--   found lua5.1, version 5.1.5
--   found lua5.1, version 5.1.5
-- Building with Lua support using lua5.1
-- Found PythonInterp: /usr/bin/python (found version "2.7.6")
-- checking for module 'sqlite3>=3.6.20'
--   found sqlite3, version 3.8.2
-- Found MySQL includes at /usr/include/mysql
-- Found MySQL client library at /usr/lib/arm-linux-gnueabihf/libmysqlclient.so
-- Configuring done
-- Generating done

Builds fine on another Ubuntu box with similar hardware (RK3288)..

# lwan
$ siege -q -b -t10S http://localhost:8080

Lifting the server siege...      done.

Transactions:              61538 hits
Availability:             100.00 %
Elapsed time:               9.27 secs
Data transferred:          67.08 MB
Response time:              0.00 secs
Transaction rate:        6638.40 trans/sec
Throughput:             7.24 MB/sec
Concurrency:               13.47
Successful transactions:           0
Failed transactions:               0
Longest transaction:            0.02
Shortest transaction:           0.00
# Simple Go
$ siege -q -b -t10S http://localhost:8080

Lifting the server siege...      done.

Transactions:              47847 hits
Availability:             100.00 %
Elapsed time:               9.60 secs
Data transferred:           0.55 MB
Response time:              0.00 secs
Transaction rate:        4984.06 trans/sec
Throughput:             0.06 MB/sec
Concurrency:               14.59
Successful transactions:       47847
Failed transactions:               0
Longest transaction:            0.03
Shortest transaction:           0.00