hyperhq / runv

Hypervisor-based Runtime for OCI
Apache License 2.0
826 stars 129 forks source link

Can't handle very long input command lines #319

Closed wrouesnel closed 8 years ago

wrouesnel commented 8 years ago

I've been playing with a (somewhat unholy) mixing of runv and drone CI. This looks like it should work out of the box, but the initial container startup on one of my attempts fails with "too long" - I'm guessing because the .drone.yml is serialized as a very large single line of JSON passed to the init, which chokes on it.

Error log:

I0907 12:10:59.002003     878 init_comm.go:68] [console] hyper_loop epoll_wait 1
I0907 12:10:59.002798     878 init_comm.go:68] [console] hyper_handle_event get event 1, he 0x61d620, fd 3. ops 0x61d400
I0907 12:10:59.003572     878 init_comm.go:68] [console] hyper_handle_event event EPOLLIN, he 0x61d620, fd 3, 0x61d400
I0907 12:10:59.003849     878 init_comm.go:68] [console] hyper_event_read
I0907 12:10:59.004237     878 init_comm.go:68] [console] already read 8 bytes data
I0907 12:10:59.004609     878 init_comm.go:68] [console] hyper send type 14, len 4
I0907 12:10:59.004695     878 init_comm.go:106] read 8/8 [length = 0]
I0907 12:10:59.004705     878 init_comm.go:110] data length is 12
I0907 12:10:59.004713     878 init_comm.go:96] trying to read 4 bytes
I0907 12:10:59.004724     878 init_comm.go:106] read 12/12 [length = 12]
I0907 12:10:59.004747     878 init_comm.go:96] trying to read 8 bytes
I0907 12:10:59.004765     878 init_comm.go:225] got cmd:14
I0907 12:10:59.004777     878 init_comm.go:288] get command NEXT
I0907 12:10:59.004788     878 init_comm.go:291] send 512, receive 8
I0907 12:10:59.004910     878 init_comm.go:68] [console] get length 15890
I0907 12:10:59.005325     878 init_comm.go:68] [console] get length 15890, too long
I0907 12:10:59.006646     878 init_comm.go:68] [console] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
I0907 12:10:59.006670     878 init_comm.go:68] [console] 
I0907 12:10:59.007172     878 init_comm.go:68] [console] CPU: 0 PID: 1 Comm: init Not tainted 4.4.12-hyper #1
I0907 12:10:59.008271     878 init_comm.go:68] [console] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
I0907 12:10:59.009332     878 init_comm.go:68] [console]  0000000000000000 ffffffff8125831c ffffffff81572af0 ffff88000749feb8
I0907 12:10:59.010006     878 init_comm.go:68] [console]  ffffffff810c5bca 0000000000000010 ffff88000749fec8 ffff88000749fe68
I0907 12:10:59.010688     878 init_comm.go:68] [console]  ffffffff810c338f 0000000000000000 ffff880007492c10 0000000000000000
I0907 12:10:59.010894     878 init_comm.go:68] [console] Call Trace:
I0907 12:10:59.011312     878 init_comm.go:68] [console]  [<ffffffff8125831c>] ? dump_stack+0x5c/0x80
I0907 12:10:59.011696     878 init_comm.go:68] [console]  [<ffffffff810c5bca>] ? panic+0xc3/0x1e0
I0907 12:10:59.012518     878 init_comm.go:68] [console]  [<ffffffff810c338f>] ? perf_event_exit_task+0x9f/0x350
I0907 12:10:59.013181     878 init_comm.go:68] [console]  [<ffffffff8104e408>] ? do_exit+0xa68/0xa70
I0907 12:10:59.013667     878 init_comm.go:68] [console]  [<ffffffff8103f4d8>] ? __do_page_fault+0x168/0x3b0
I0907 12:10:59.014369     878 init_comm.go:68] [console]  [<ffffffff8104e474>] ? do_group_exit+0x34/0xa0
I0907 12:10:59.015123     878 init_comm.go:68] [console]  [<ffffffff8104e4eb>] ? SyS_exit_group+0xb/0x10
I0907 12:10:59.016052     878 init_comm.go:68] [console]  [<ffffffff8148a3ee>] ? entry_SYSCALL_64_fastpath+0x12/0x71
I0907 12:10:59.016532     878 init_comm.go:68] [console] Kernel Offset: disabled
gao-feng commented 8 years ago

@wrouesnel Yes, you are right, you can change the buffer size from 10240 to 20480, https://github.com/hyperhq/hyperstart/blob/master/src/init.c#L1137

we will consider to bump the default buffer size. Thanks for your report!