Opened 3 years ago

Closed 2 years ago

#7344 closed bug (invalid)

64-bit and 32-bit binaries compiled with '-static' gets 'SIGKILL'ed (after many 'SIGVTALRM's and lots of memory consumption)

Reported by: cetinsert Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 7.4.1
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

Initial Report & Discussion

Quoting the person who reported the problem:
some background:
my public-server is some old machine that is apparently unable to even run the static binary (it took me a long time to realize that this was the case, it started and then just died after a while with the message "killed!" i tried building from source, but ghc is to old (6.8.2). to work around that i set up an ssh-tunnel from public-server to my local-client and run "PortFusion ] 2000 [" here.

PortFusion Discussion Forum

Binaries

cs@deployment:~/Corsis/PortFusion/1.2.1$ file PortFusion-Linux-x86-64-static PortFusion-Linux-x86-32-static

PortFusion-Linux-x86-64-static: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=0xe53aa9be69fa27587e1551db3423d051cbd18e24, stripped

PortFusion-Linux-x86-32-static: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=0xac311dcad032544624204ee57d64afe30578ab56, stripped

64-bit
32-bit

Runtime Systems

cs@deployment:~/Corsis/PortFusion/1.2.1$ ./PortFusion-Linux-x86-64-static +RTS --info -RTS
 [("GHC RTS", "YES")
 ,("GHC version", "7.4.1")
 ,("RTS way", "rts_thr")
 ,("Build platform", "x86_64-unknown-linux")
 ,("Build architecture", "x86_64")
 ,("Build OS", "linux")
 ,("Build vendor", "unknown")
 ,("Host platform", "x86_64-unknown-linux")
 ,("Host architecture", "x86_64")
 ,("Host OS", "linux")
 ,("Host vendor", "unknown")
 ,("Target platform", "x86_64-unknown-linux")
 ,("Target architecture", "x86_64")
 ,("Target OS", "linux")
 ,("Target vendor", "unknown")
 ,("Word size", "64")
 ,("Compiler unregisterised", "NO")
 ,("Tables next to code", "YES")
 ]

cs@deployment:~/Corsis/PortFusion/1.2.1$ ./PortFusion-Linux-x86-32-static +RTS --info -RTS
 [("GHC RTS", "YES")
 ,("GHC version", "7.4.1")
 ,("RTS way", "rts_thr")
 ,("Build platform", "i386-unknown-linux")
 ,("Build architecture", "i386")
 ,("Build OS", "linux")
 ,("Build vendor", "unknown")
 ,("Host platform", "i386-unknown-linux")
 ,("Host architecture", "i386")
 ,("Host OS", "linux")
 ,("Host vendor", "unknown")
 ,("Target platform", "i386-unknown-linux")
 ,("Target architecture", "i386")
 ,("Target OS", "linux")
 ,("Target vendor", "unknown")
 ,("Word size", "32")
 ,("Compiler unregisterised", "NO")
 ,("Tables next to code", "YES")
 ]

Operating System

2.6.26-2-xen-amd64 #1 SMP x86_64

Memory Usage

VIRT RES SHR S %CPU %MEM
64-bit: 432m 354m 28 R 26 23.1
32-bit: 339m 325m 1220 R 85 21.2

Strace Head/Tail

execve("./PortFusion-Linux-x86-64-static", ["./PortFusion-Linux-x86-64-static"...], [/* 22 vars */]) = 0
uname({sys="Linux", node="community.gotpike.org", ...}) = 0
brk(0)                                  = 0x1920000
brk(0x1921200)                          = 0x1921200
arch_prctl(ARCH_SET_FS, 0x19208c0)      = 0
set_tid_address(0x1920b90)              = 6362
set_robust_list(0x1920ba0, 0x18)        = 0
futex(0x7fffba04321c, 0x189 /* FUTEX_??? */, 1, NULL, 19208c0) = -1 ENOSYS (Function not implemented)
rt_sigaction(SIGRTMIN, {0x544c60, [], SA_RESTORER|SA_SIGINFO, 0x549480}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x544cf0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x549480}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
open("/dev/urandom", O_RDONLY)          = 3
read(3, "O$\276\362\273\222W"..., 7)    = 7
close(3)                                = 0

...

mmap(0x7f7da2300000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7da2100000
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
rt_sigreturn(0x1a)                      = 7316992
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
clock_gettime(0x2 /* CLOCK_??? */, {8, 290909435}) = 0
gettimeofday({1350534807, 794239}, NULL) = 0
clock_gettime(0x3 /* CLOCK_??? */, {8, 290212222}) = 0
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
rt_sigreturn(0x1a)                      = 140177567371264
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
rt_sigreturn(0x1a)                      = 140177567244256
rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
clock_gettime(0x2 /* CLOCK_??? */, {8, 334487438}) = 0
gettimeofday({1350534807, 882102}, NULL) = 0
clock_gettime(0x3 /* CLOCK_??? */, {8, 333790569}) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
+++ killed by SIGKILL +++

Change History (5)

comment:1 Changed 3 years ago by cetinsert

Complete Strace for PortFusion-Linux-x86-64-static

PortFusion-strace.log

comment:2 Changed 2 years ago by eMBee

  • Type of failure changed from Runtime crash to None/Unknown

i just observed that the same static binaries gobble up huge amounts of memory on another machine too (about 2 of 4GB). only there they don't get killed. the machine where they get killed has 1.5GB of memory.

so it looks like there is no crash but a simple OOM kill and the problem is more likely a memory leak of some sort.

comment:3 Changed 2 years ago by cetinsert

Sources

The static binaries that are the subject of this ticket are built from the source of PortFusion at version 1.2.1.

Sources at 1.2.1

comment:4 Changed 2 years ago by simonmar

  • difficulty set to Unknown
  • Status changed from new to infoneeded

Could you elaborate on why you think this is a bug in GHC and not a space leak in the program in question? If it is a bug in GHC, can you give us a way to reproduce it?

comment:5 Changed 2 years ago by igloo

  • Resolution set to invalid
  • Status changed from infoneeded to closed

No response from submitter, so closing.

Note: See TracTickets for help on using tickets.