Walkingmind / embox

Automatically exported from code.google.com/p/embox
2 stars 0 forks source link

vfrok causes exception with lua cgi #700

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.x86/nonvga_debug at r14561 with lua & exec:
svn up -r14561
svn up third-party/lib/luasocket/Makefile src/cmds/net/httpd.c 
src/kernel/task/resource/res_argv.c 
src/include/kernel/task/resource/task_argv.h src/compat/posix/proc/exec.c
make confload-x86/nonvga_debug
make cacheclean
make clean
2.conf/mods.config
+ include embox.arch.x86.vfork
+ include embox.compat.posix.proc.vfork_stop_parent
+ include embox.compat.posix.proc.exec_stop_parent
+ include third_party.cmd.lua(luasocket_support=true)
+ include third_party.lib.luasocket
3.build
make

What is the expected output? What do you see instead?
--EMBOX--
$ ./scripts/qemu/auto_qemu 
Guessed AUTOQEMU_ARCH is: x86
Guessed AUTOQEMU_MEM is: 256
Guessed AUTOQEMU_NICS is: virtio
Guessed AUTOQEMU_KVM_ARG is: -enable-kvm
Guessed AUTOQEMU_LOAD_ARG is: -kernel ./build/base/bin/embox
Guessed AUTOQEMU_NOGRAPHIC_ARG is: -nographic
sudo qemu-system-i386 -kernel ./build/base/bin/embox -enable-kvm -m 256 -net 
nic,model=virtio,macaddr=AA:BB:CC:DD:EE:02 -net 
tap,script=./scripts/qemu/start_script,downscript=./scripts/qemu/stop_script 
-nographic
ioctl(TUNSETIFF): Device or resource busy
Enable IP Forwarding for eth0
net.ipv4.ip_forward = 1

Embox kernel start
runlevel: init level is 0
    unit: initializing embox.driver.interrupt.i8259: done
    unit: initializing embox.mem.static_heap: done
    unit: initializing embox.kernel.task.task_resource: done
    unit: initializing embox.kernel.task.task_table: done
    unit: initializing embox.driver.clock.pit: done
    unit: initializing embox.kernel.task.kernel_task: done
    unit: initializing embox.kernel.time.jiffies: done
    unit: initializing embox.kernel.thread.starter: done
    unit: initializing embox.kernel.time.timer: done
    unit: initializing embox.fs.driver.repo: done
    unit: initializing embox.mem.phymem: start=0x0933f000, end=0x10100000, size=115085312
done
    unit: initializing embox.fs.buffer_cache: done
    unit: initializing embox.fs.node: done
    unit: initializing embox.driver.block: done
    unit: initializing embox.kernel.time.kernel_time: done
    unit: initializing embox.fs.rootfs: initfs_mount: unpack initinitfs at 0x0029f214 into /
done
    test: running embox.test.posix.getopt_test .............. done
    test: running embox.test.stdio.printf_test ......... done
    test: running embox.test.posix.sleep_test ...... done
    test: running embox.test.recursion . done
    test: running embox.test.kernel.task.multitask_test ....... done
    test: running embox.test.kernel.timer_test .. done
    test: running embox.test.kernel.softirq_test ..... done
    test: running embox.test.framework.mod.member.ops_test . done
    test: running embox.test.gcc.int_arithmetic ......... done
    test: running embox.test.critical .. done
    unit: initializing embox.driver.ide: done
    test: running embox.test.third_party.trex_test . done
    test: running embox.test.net.parser.request_parser_test .... done
    test: running embox.test.net.parser.url_parser_test ... done
    test: running embox.test.kernel.lthread.lthread_test ..... done
    test: running embox.test.kernel.thread.thread_priority_test . done
    test: running embox.test.kernel.thread.thread_test .... done
    test: running embox.test.mem.heap ........ done
    test: running embox.test.mem.pool_test ...... done
    test: running embox.test.math.math_test .. done
    test: running embox.test.util.indexator_test ........... done
    test: running embox.test.util.tree_test ........... done
    test: running embox.test.util.slist_test .................. done
    test: running embox.test.util.list_test ........................................................... done
    test: running embox.test.util.bit_test ..... done
    test: running embox.test.util.array_test . done
    test: running embox.test.block_dev.ramdisk_test . done
    test: running embox.test.posix.environ_test ......... done
    test: running embox.test.stdlib.qsort_test ....... done
    test: running embox.test.stdlib.bsearch_test ...... done
    test: running embox.test.posix.ppty_test ... done
    test: running embox.test.posix.pipe_test ... done
    test: running embox.test.posix.select_test ...... done
    test: running embox.test.posix.poll_test ......... done
runlevel: init level is 1
    unit: initializing third_party.lib.acpica: done
    unit: initializing embox.kernel.time.timekeeper: done
    unit: initializing embox.net.dev: done
    unit: initializing embox.net.neighbour: done
    unit: initializing embox.net.net_entry: done
    unit: initializing embox.driver.pci: done
    unit: initializing embox.driver.net.loopback: done
    unit: initializing embox.net.tcp: done
    unit: initializing embox.profiler.tracing: done
    unit: initializing embox.fs.driver.ramfs: done
    unit: initializing embox.fs.driver.tmpfs: done
    unit: initializing embox.driver.serial.i8250: done
    pci: virtio driver inserted
    pci: virtio handles 1af4:1000 bus 0 slot 3 func 0
    test: running embox.test.net.inet_stream_socket_test .............. done
    test: running embox.test.net.inet_dgram_socket_test ............. done
    test: running embox.test.net.inet_socket_test ...... done
    test: running embox.test.net.socket_test ............................ done
runlevel: init level is 2
    unit: initializing embox.init.start_script: 
Started shell [tish] on device [ttyS0]
loading start script:
> ifconfig lo 127.0.0.1 netmask 255.0.0.0 up 
> route add 127.0.0.0 netmask 255.0.0.0 lo 
> ifconfig eth0 10.0.2.16 netmask 255.255.255.0 hw ether AA:BB:CC:DD:EE:02 up 
> route add 10.0.2.0 netmask 255.255.255.0 eth0 
> route add default gw 10.0.2.10 eth0 
> export PWD=/ 
> export HOME=/ 
root@embox:/#httpd
httpd: debug: httpd_client_process: method=GET uri_target=/cgi-bin/help 
uri_query=(null)
httpd: debug: httpd_client_process: method=GET uri_target=/cgi-bin/help 
uri_query=(null)
httpd: debug: httpd_client_process: method=GET uri_target=/cgi-bin/help 
uri_query=(null)
httpd: debug: httpd_client_process: method=GET uri_target=/cgi-bin/fib.lua 
uri_query=(null)
EXCEPTION [0x0]: error = 00000000
EAX=e6cbdfbb    EBX=00000000 ECX=0050e064 EDX=09462cae
 GS=00900010     FS=01d00010  ES=00180010  DS=00900010
EDI=00000014    ESI=00000014 EBP=7ff7a516 EIP=01d082ae
 CS=00000008 EFLAGS=00010086 ESP=7ff70010  SS=4701d089

 --   01000000 * A R    thread 295  task 2 ------------------------------------

  4 0x00147113 <exception_handler+0x158> ...h/x86/kernel/exception_handler.c:20
  3 0x00100079 <excep_stub+0x1c>       src/arch/x86/kernel/exception_entry.S:49
  2 0x01d082ae <getprotoent+0x1afd897>    src/compat/posix/net/getprotoent.c:40
  1 0xf000ff53 <getprotoent+0xefe0553c>   src/compat/posix/net/getprotoent.c:40

run 0x001135db <task_trampoline+0x0>                 src/kernel/task/multi.c:41

 --   01000000       W  thread 0  task 1 --------------------------------------

 18 0x00184274 <sched_switch+0x4d>                 src/kernel/sched/sched.c:378
 17 0x00110c99 <sched_prepare_thread+0x3e> .../thread/thread_sched_routine.c:21
 16 0x0018439a <__schedule+0xe7>                   src/kernel/sched/sched.c:404
 15 0x001843eb <schedule+0x17>                     src/kernel/sched/sched.c:458
 14 0x0018459c <sched_wait+0xb>                src/kernel/sched/sched_wait.c:44
 13 0x001845dc <sched_wait_timeout+0x19>       src/kernel/sched/sched_wait.c:74
 12 0x001853a1 <task_waitpid_posix+0xaf>    src/kernel/task/syslib/waitpid.c:48
 11 0x001e9b6c <waitpid+0x1f>                src/compat/posix/proc/waitpid.c:13
 10 0x00122b2f <process_external+0x65>                src/cmds/shell/tish.c:181
  9 0x00122cec <tish_exec+0x7e>                       src/cmds/shell/tish.c:235
  8 0x00122fd0 <tish_run+0xaa>                        src/cmds/shell/tish.c:326
  7 0x00123069 <shell_run+0x2c>                      src/include/cmd/shell.h:31
  6 0x00123164 <run_script+0xc0>                     src/init/start_script.c:26
  5 0x0014683c <unit_mod_enable+0x59>                   src/framework/unit.c:25
  4 0x00146cf3 <mod_enable+0x7b>                   src/framework/mod/core.c:146
  3 0x0014673c <runlevel_set+0xa3>                  src/framework/runlevel.c:54
  2 0x001000ff <init+0x24>                                 src/kernel/init.c:51
  1 0x001000bd <kernel_start+0x10>                         src/kernel/init.c:23

run 0x00183660 <boot_stub+0x0>               src/kernel/thread/boot_thread.c:21

 --   02000000       W  thread 2  task 1 --------------------------------------

  6 0x00184274 <sched_switch+0x4d>                 src/kernel/sched/sched.c:378
  5 0x00110c99 <sched_prepare_thread+0x3e> .../thread/thread_sched_routine.c:21
  4 0x0018439a <__schedule+0xe7>                   src/kernel/sched/sched.c:404
  3 0x001843eb <schedule+0x17>                     src/kernel/sched/sched.c:458
  2 0x0011059a <thread_exit+0x97>                  src/kernel/thread/core.c:232
  1 0x001100be <thread_create+0x0>                  src/kernel/thread/core.c:71

run 0x00114c16 <handler_timeout+0x0>            src/tests/posix/sleep_test.c:39

 --   01000000     R    thread 1  task 1 --------------------------------------

  9 0x00184274 <sched_switch+0x4d>                 src/kernel/sched/sched.c:378
  8 0x00110c99 <sched_prepare_thread+0x3e> .../thread/thread_sched_routine.c:21
  7 0x0018439a <__schedule+0xe7>                   src/kernel/sched/sched.c:404
  6 0x00184409 <sched_preempt+0x17>                src/kernel/sched/sched.c:465
  5 0x0014611f <critical_dispatch_pending+0x5c>        src/kernel/critical.c:21
  4 0x00100b88 <irq_handler+0x76>          src/arch/x86/kernel/irq_handler.c:20
  3 0x0010004c <_traps_text_start+0x1c>      src/arch/x86/kernel/irq_entry.S:34
  2 0x00100c2a <arch_idle+0x4>                    src/arch/x86/kernel/arch.c:24
  1 0x001100b0 <thread_trampoline+0x89>             src/kernel/thread/core.c:55

run 0x0018377c <idle_run+0x0>                src/kernel/thread/idle_thread.c:20

 --   02000000       W  thread 299  task 3 ------------------------------------

  7 0x00184274 <sched_switch+0x4d>                 src/kernel/sched/sched.c:378
  6 0x00110c99 <sched_prepare_thread+0x3e> .../thread/thread_sched_routine.c:21
  5 0x0018439a <__schedule+0xe7>                   src/kernel/sched/sched.c:404
  4 0x001843eb <schedule+0x17>                     src/kernel/sched/sched.c:458
  3 0x00113c8b <task_finish_exit+0x2f>              src/kernel/task/multi.c:293
  2 0x001eeadd <_exit+0x6d>                     src/compat/posix/proc/exit.c:18
  1 0x00208f64 <task_exec_callback+0x0> ...rk_stop_parent/exec_stop_parent.c:35

run 0x001135db <task_trampoline+0x0>                 src/kernel/task/multi.c:41

--HOST--
$ echo -ne "GET /cgi-bin/fib.lua HTTP/1.1\r\n\r\n" | nc 10.0.2.16 80
fib(7) = 13
(waiting)

Please use labels and text to provide additional information.

Original issue reported on code.google.com by ki.stfu on 18 Aug 2014 at 11:42

GoogleCodeExporter commented 9 years ago
also:
include embox.cmd.net.httpd(use_cgi=true)

Original comment by ki.stfu on 18 Aug 2014 at 11:51

GoogleCodeExporter commented 9 years ago
or update . to r14619 and:

--EMBOX--
$ ./scripts/qemu/auto_qemu -no-kvm
Guessed AUTOQEMU_ARCH is: x86
Guessed AUTOQEMU_MEM is: 256
Guessed AUTOQEMU_NICS is: virtio
Guessed AUTOQEMU_KVM_ARG is: -enable-kvm
Guessed AUTOQEMU_LOAD_ARG is: -kernel ./build/base/bin/embox
Guessed AUTOQEMU_NOGRAPHIC_ARG is: -nographic
sudo qemu-system-i386 -kernel ./build/base/bin/embox -enable-kvm -m 256 -net 
nic,model=virtio,macaddr=AA:BB:CC:DD:EE:02 -net 
tap,script=./scripts/qemu/start_script,downscript=./scripts/qemu/stop_script 
-nographic -no-kvm
ioctl(TUNSETIFF): Device or resource busy
Enable IP Forwarding for eth0
net.ipv4.ip_forward = 1

Embox kernel start
runlevel: init level is 0
    unit: initializing embox.driver.interrupt.i8259: done
    unit: initializing embox.mem.static_heap: done
    unit: initializing embox.kernel.task.task_resource: done
    unit: initializing embox.kernel.task.task_table: done
    unit: initializing embox.driver.clock.pit: done
    unit: initializing embox.kernel.task.kernel_task: done
    unit: initializing embox.kernel.time.jiffies: done
    unit: initializing embox.kernel.thread.starter: done
    unit: initializing embox.kernel.time.timer: done
    unit: initializing embox.fs.driver.repo: done
    unit: initializing embox.mem.phymem: start=0x0934a000, end=0x10100000, size=115040256
done
    unit: initializing embox.fs.buffer_cache: done
    unit: initializing embox.fs.node: done
    unit: initializing embox.driver.block: done
    unit: initializing embox.kernel.time.kernel_time: done
    unit: initializing embox.fs.rootfs: initfs_mount: unpack initinitfs at 0x002a1884 into /
done
    test: running embox.test.posix.getopt_test .............. done
    test: running embox.test.stdio.printf_test ......... done
    test: running embox.test.posix.sleep_test ...... done
    test: running embox.test.recursion . done
    test: running embox.test.kernel.task.multitask_test ....... done
    test: running embox.test.kernel.timer_test .. done
    test: running embox.test.kernel.softirq_test ..... done
    test: running embox.test.framework.mod.member.ops_test . done
    test: running embox.test.gcc.int_arithmetic ......... done
    test: running embox.test.critical .. done
    unit: initializing embox.driver.ide: done
    test: running embox.test.third_party.trex_test . done
    test: running embox.test.net.parser.request_parser_test .... done
    test: running embox.test.net.parser.url_parser_test ... done
    test: running embox.test.kernel.lthread.lthread_sched_wait_test ...... done
    test: running embox.test.kernel.lthread.lthread_mutex_test . done
    test: running embox.test.kernel.lthread.lthread_test ..... done
    test: running embox.test.kernel.thread.thread_priority_test . done
    test: running embox.test.kernel.thread.thread_test .... done
    test: running embox.test.mem.heap ........ done
    test: running embox.test.mem.pool_test ...... done
    test: running embox.test.math.math_test .. done
    test: running embox.test.util.indexator_test ........... done
    test: running embox.test.util.tree_test ........... done
    test: running embox.test.util.slist_test .................. done
    test: running embox.test.util.list_test ........................................................... done
    test: running embox.test.util.bit_test ..... done
    test: running embox.test.util.array_test . done
    test: running embox.test.block_dev.ramdisk_test . done
    test: running embox.test.posix.environ_test ......... done
    test: running embox.test.stdlib.qsort_test ....... done
    test: running embox.test.stdlib.bsearch_test ...... done
    test: running embox.test.posix.ppty_test ... done
    test: running embox.test.posix.pipe_test ... done
    test: running embox.test.posix.select_test ...... done
    test: running embox.test.posix.poll_test ......... done
runlevel: init level is 1
    unit: initializing third_party.lib.acpica: done
    unit: initializing embox.kernel.time.timekeeper: done
    unit: initializing embox.net.dev: done
    unit: initializing embox.net.neighbour: done
    unit: initializing embox.net.net_entry: done
    unit: initializing embox.driver.pci: done
    unit: initializing embox.driver.net.loopback: done
    unit: initializing embox.net.tcp: done
    unit: initializing embox.profiler.tracing: done
    unit: initializing embox.fs.driver.ramfs: done
    unit: initializing embox.fs.driver.tmpfs: done
    unit: initializing embox.driver.serial.i8250: done
    pci: virtio driver inserted
    pci: virtio handles 1af4:1000 bus 0 slot 3 func 0
    test: running embox.test.net.inet_stream_socket_test .............. done
    test: running embox.test.net.inet_dgram_socket_test ............. done
    test: running embox.test.net.inet_socket_test ...... done
    test: running embox.test.net.socket_test ............................ done
runlevel: init level is 2
    unit: initializing embox.init.start_script: 
Started shell [tish] on device [ttyS0]
loading start script:
> ifconfig lo 127.0.0.1 netmask 255.0.0.0 up 
> route add 127.0.0.0 netmask 255.0.0.0 lo 
> ifconfig eth0 10.0.2.16 netmask 255.255.255.0 hw ether AA:BB:CC:DD:EE:02 up 
> route add 10.0.2.0 netmask 255.255.255.0 eth0 
> route add default gw 10.0.2.10 eth0 
> export PWD=/ 
> export HOME=/ 
root@embox:/#httpd
httpd: debug: httpd_client_process: method=GET uri_target=/cgi-bin/fib.lua 
uri_query=(null)
qemu: fatal: Trying to execute code outside RAM or ROM at 0x7ff7a516

EAX=00908000 EBX=00000000 ECX=0051007c EDX=0051007c
ESI=00000000 EDI=00000000 EBP=001d809a ESP=01d130a0
EIP=7ff7a516 EFL=00000006 [-----P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     0031e120 0000002f
IDT=     0031e160 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000 
DR6=ffff0ff0 DR7=00000400
CCS=00000004 CCD=01d13074 CCO=SUBL    
EFER=0000000000000000
FCW=037f FSW=4000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=d000000000000000 4002
FPR6=c000000000000000 4033 FPR7=c000000000000000 4033
XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000
XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000
XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000
XMM06=00000000000000000000000000000000 XMM07=00000000000000000000000000000000

--HOST--
$ echo -ne "GET /cgi-bin/fib.lua HTTP/1.1\r\n\r\n" | nc 10.0.2.16 80
fib(7) = 13
(waiting)

Original comment by ki.stfu on 18 Aug 2014 at 12:16

GoogleCodeExporter commented 9 years ago
fixed r14622 

Original comment by drakon.m...@gmail.com on 19 Aug 2014 at 1:35