Closed saibe closed 9 years ago
This issue is under investigation, thanks for the bug report. I'll keep you informed.
I'm not able to reproduce this issue on my workstation (using a
CentOS-6-x86 rootfs and a version of STLinux downloaded from
http://stlinux.com/). However, I spotted a dangerous code pattern in
the code in charge of the load script transfer [1]. It should first
call alloc_mem()
then call write_data()
, instead of changing
explicitly the stack pointer after calling write_data()
.
I'll send soon you a version of PRoot that replaces this dangerous code, so you'll be able to test whether it fixes the issue you reported.
[1] https://github.com/cedric-vincent/PRoot/blob/v5.0.0/src/execve/exit.c#L302
Hello @saibe,
Could you please give the following binary a try? It is a statically linked version of PRoot v5.0.0 that contains commit f91ec1a.
https://drive.google.com/file/d/0B4dzkhnYQiNUZXFCT1FkckVQNEk/view
md5sum = fe45a94d95a4abbf9042e9fb9c793369
Don't forget to mark this binary executable since the "x" bit doesn't survive HTTP download.
Regards, Cédric.
Hi
I'm also able to reproduce such issue.
The issue is related to the fact gdb is a 32bits binary trying to run iconv, which is a 64bits binary.
Initially I"ve thought it was related to vfork()
as gdb use vfork()
, but plain fork()
also exhibit the issue. For a reduced test case, please have a look at https://gist.github.com/ydroneaud/e1a98d5163732eecff1e
BTW, commit f91ec1a140f7930a82ff7eb0e61cd34350fdc447 doesn't fix the issue.
Regards.
@ydroneaud: many thanks for your work on this issue; it helps me a lot!
I'll [try to] make a fix tomorrow.
(Note: I'm using Fedora 20 x86_64 and not Ubuntu, but I believe it doesn't matter :)
It seems commit fd7ca5f8e92bd3b66d1fa1c31dc12db0ed5e88f9 fixes the issue (on my test case and with gdb).
@ydroneaud Thanks for the tests. This commit will be shipped in the upcoming release (v5.1.0), by the end of this month I hope.
Hello,
In my project using proot/mock over stlinux, when I aunch a 'make boot', I have some warning. It looks not matter since the command does what it should. I just share to you the warning message in case you have some details about it.
$ make boot
LANG=C LC_ALL=C stlinux_arm_boot -r -t "10.48.1.48:b2196stxh301:a9_0,active_cores=a9_0:dbu,ca9_freq=1500,debug=uart,debugram_base=0x47FF8000,debugram_size=32768,boardrev=2" -macaddr="eth0:00:80:E1:01:2F:A7" -ex "set pagination off" -b "/local/view/SDK2-15.3_INT_004_CF_L/build/build/sdk2-build.b2196-h301_a9/../build-b2196-h301_a9/kernel/vmlinux" -dtb "/local/view/SDK2-15.3_INT_004_CF_L/build/build/sdk2-build.b2196-h301_a9/../build-b2196-h301_a9/kernel/arch/arm/boot/devicetree/sdk2_stih301-b2196.dtb" -xpk "extra.gdb" -a "0x42000000" -s "251658240" -- "console=ttyAS0,115200" "CONSOLE=/dev/ttyAS0" "loglevel=1" "ip=::::b2196-h301_a9:eth0:dhcp" "root=/dev/nfs" "nfsroot=10.48.0.156:/var/lib/mock/st-redhat6.4-x86_64-SDK2-15.3_INT_004_CF_L/root/opt/STM/STLinux-2.4/devkit/armv7/target,tcp,nfsvers=3" "mtdparts=stm-nand-bch.0:0x500000(boot),-(rfs)" "bpa2parts=BPA2_Region|aud-coded|aud-transcoded|vid-coded|vid-transcoded|vid-raw-input|vid-output-0|vid-decimated-1|vid-copied-1|vid-macroblock-0|vid-extra-data-0|vid-extra-data-1|v4l2-coded-video-buffers|vid-enc-data-0|vid-enc-scaled-0|vid-encoded-0|v4l2-clut|v4l2-grab|gfx-memory|aud-codec-data|vid-codec-data|aud-output-0|aud-output-1|vid-output-1|vid-decimated-0|vid-copied-0|vid-macroblock-1|blitter|vid-enc-data-1|vid-enc-scaled-1|vid-encoded-1|coredisplay-video|multicom|hades-l3|BPA2_Region0|BPA2_Region1:207M:0x53000000,v4l2-vb2|v4l2-stmc8jpg|v4l2-stmvout|v4l2-compo:24M:0x51800000,coprocs:32M:0x40000000,modules|audio:8M:0x51000000,bigphysarea|te-buffers|m2m-ca3:63M:0x48000000,STMCReserve:32768:0x47FF8000" "vmalloc=502m" "mem=251658240@0x42000000"
Warning: disabling Linux kernel awareness layer due to -r or -n options.
Kernel auto-detected as non-SMP
Booting from device tree blob /tmp/stlinux_arm_boot_xlk25YH7.29419
Booting ....
proot warning: ptrace(POKEDATA): Input/output error
proot error: can't transfer load script: Bad address
The target is assumed to be little endian