linux-noah / noah Goto Github PK
View Code? Open in Web Editor NEWBash on Ubuntu on macOS
License: Other
Bash on Ubuntu on macOS
License: Other
Maybe due to lack of status conversion
$ cd /usr
$ pwd
/usr
$ /bin/pwd
/Users/yuichi/.noah/tree/usr
Whenever noah tries to do anything other than display the help and version text, it crashes:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Note: EXC_CORPSE_NOTIFY
The following command demonstrates a crash in debug build mode on macOS 10.12.6 :
./noah -s trace.log -m ~/.noah/tree/ /bin/bash
ASAN report
=================================================================
==21828==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000000990 at pc 0x00010a7ea118 bp 0x7fff55576c80 sp 0x7fff55576430
WRITE of size 24 at 0x603000000990 thread T0
#0 0x10a7ea117 in __asan_memset (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x51117)
#1 0x10a6c8028 in alloc_fdtable fs.c:124
#2 0x10a6c8914 in register_fd fs.c:548
#3 0x10a6dca1b in sys_dup2 fs.c:1749
#4 0x10a6dc8a0 in _sys_dup2 fs.c:1741
#5 0x10a68d1ba in handle_syscall main.c:73
#6 0x10a68b913 in main_loop main.c:146
#7 0x10a68f61f in main main.c:581
#8 0x7fffb903d234 in start (libdyld.dylib:x86_64+0x5234)
0x603000000990 is located 0 bytes to the right of 32-byte region [0x603000000970,0x603000000990)
allocated by thread T0 here:
#0 0x10a7f2230 in wrap_realloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x59230)
#1 0x10a6c7efa in alloc_fdtable fs.c:119
#2 0x10a6c8914 in register_fd fs.c:548
#3 0x10a6dca1b in sys_dup2 fs.c:1749
#4 0x10a6dc8a0 in _sys_dup2 fs.c:1741
#5 0x10a68d1ba in handle_syscall main.c:73
#6 0x10a68b913 in main_loop main.c:146
#7 0x10a68f61f in main main.c:581
#8 0x7fffb903d234 in start (libdyld.dylib:x86_64+0x5234)
SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x51117) in __asan_memset
Shadow bytes around the buggy address:
0x1c06000000e0: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd
0x1c06000000f0: fa fa fd fd fd fd fa fa fd fd fd fd fa fa 00 00
0x1c0600000100: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa
0x1c0600000110: 00 00 00 02 fa fa 00 00 00 fa fa fa 00 00 00 fa
0x1c0600000120: fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa 00 00
=>0x1c0600000130: 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0600000140: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0600000150: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0600000160: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0600000170: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0600000180: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==21828==ABORTING
Abort trap: 6
$ ls /
ls: cannot access '/root': Permission denied
Users Volumes bin boot dev etc home lib lib64 mnt opt proc root run sbin srv sys tmp usr var
I'm having trouble getting noah to work on my computer, since it keeps aborting whenever hv_vmx_vcpu_read_vmcs
returns an error. Poking around, it looks like it fails with a HV_ERROR
when it calls the method with VMCS_HOST_IA32_SYSENTER_ESP
or VMCS_HOST_IA32_SYSENTER_EIP
as the field
, but I'm not sure why this is happening.
If I run noah .noah/tree/bin/sh
, it's fine, but what if want to run /bin/sh -i -E
? How do I do it?
Here is what I tried and what I got:
noah .noah/tree/bin/sh -i -E
Unknown option: i
Unknown option: e
I get this warning starting as sudo or not
groups: cannot find name for group ID 61
I'm on a macbook pro and a MAC os X sierra, using iterm2 with zsh, and installed noah with homebrew
╭─ ~ 2.4.0@learn SBCL 1.3.18
╰─ noah ✓ 19.96 Dur 6078 13:47:23
Noah is installing the initial filesystem in ~/.noah/tree. Proceed? [Y/n] Y
Password:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 109M 100 109M 0 0 416k 0 0:04:28 0:04:28 --:--:-- 428k
109MiB 0:00:01 [60.9MiB/s] [================================>] 100%
ubuntu is successfully installed into /Users/toni/.noah/tree
Allow noah to run as root? It's necessary for privileged commands such as sudo.
Noah is still under development, so please enable it at your own risk! [y/N] y
Password:
groups: cannot find name for group ID 61
groups: cannot find name for group ID 79
groups: cannot find name for group ID 80
groups: cannot find name for group ID 81
groups: cannot find name for group ID 98
groups: cannot find name for group ID 701
groups: cannot find name for group ID 204
groups: cannot find name for group ID 395
groups: cannot find name for group ID 398
groups: cannot find name for group ID 399
I have no name!@MacBook-Pro-de-Antonio:~$
I have no name!@MacBook-Pro-de-Antonio:~$ exit
exit
╭─ ~ 2.4.0@learn SBCL 1.3.18
╰─ noah ✓ 9.41 Dur 6081 16:56:03
Allow noah to run as root? It's necessary for privileged commands such as sudo.
Noah is still under development, so please enable it at your own risk! [y/N]
* Running noah as normal user... This may cause unstable behavior of sudo executed from inside noah.
groups: cannot find name for group ID 61
groups: cannot find name for group ID 79
groups: cannot find name for group ID 80
groups: cannot find name for group ID 81
groups: cannot find name for group ID 98
groups: cannot find name for group ID 701
groups: cannot find name for group ID 204
groups: cannot find name for group ID 395
groups: cannot find name for group ID 398
groups: cannot find name for group ID 399
I have no name!@MacBook-Pro-de-Antonio:~$ exit
╭─ ~ 2.4.0@learn SBCL 1.3.18
╰─ noah ✓ 02:43:41 Dur 6079 16:35:32
groups: cannot find name for group ID 61
groups: cannot find name for group ID 79
groups: cannot find name for group ID 80
groups: cannot find name for group ID 81
groups: cannot find name for group ID 98
groups: cannot find name for group ID 701
groups: cannot find name for group ID 204
groups: cannot find name for group ID 395
groups: cannot find name for group ID 398
groups: cannot find name for group ID 399
I have no name!@MacBook-Pro-de-Antonio:~$ exit
exit
On my computer, with version of noah built from fcab6c6, I'm intermittently getting the following assertion to trip:
Assertion failed: (oact.sa_handler == SIG_IGN || oact.sa_handler == SIG_DFL), function init_signal, file noah/src/ipc/signal.c, line 59.
(this is a debug build I compiled because of other issues with noah, such as heap corruption).
php work good, but if I load opcache.so it will exit without error message.
zend_extension=opcache.so
I guess maybe it seems relate to thread.
I've tried the Quick Start in README, and get the following result on El Capitan.
Just a report because you may be already working in progress ;) 🔧
╭─○ yasulab ‹2.3.0› ~
╰─○ sudo noahstrap archlinux ./test-chroot
Password:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 485M 100 485M 0 0 6356k 0 0:01:18 0:01:18 --:--:-- 6526k
x lib
x bin
x dev/
x home/
x etc/
x etc/motd
...
x var/cache/pacman/pkg/pinentry-0.9.7-2-x86_64.pkg.tar.xz
x var/cache/pacman/pkg/sed-4.2.2-4-x86_64.pkg.tar.xz
x var/games/
tar: Error exit delayed from previous errors.
archlinux is successfully installed into ./test-chroot
╭─○ yasulab ‹2.3.0› ~
╰─○ noah -m ./test-chroot /bin/bash -i
bash: cannot set terminal process group (-1): Operation not permitted
bash: no job control in this shell
[I have no name!@YYMBP ~]$ ls
bash: [12077: 3 (255)] tcsetattr: Operation not permitted
💭 Maybe you should add some example commands after logging in bash, or other attractive samples except bash?
canopus:build yuichi$ noah
bash: cannot set terminal process group (98338): Operation not permitted
bash: no job control in this shell
[yuichi@canopus build]$
Could you add support for running 32bit executables?
When I execute
/usr/local/libexec/noah -m ~/.noah/tree/ /bin/bash
, I get
Abort trap: 6
.
Just noah
or /usr/local/bin/noah
does nothing (it just makes a new shell line).
When running cmake on some source code inside noah, I get very frequent hangups. cmake just freezes in the middle of what it was just doing. I used the Instruments.app that is shipped with XCode to disable all but one CPU core. This works around this problem.
Can it use FUSE? Then we could possibly run AppImages. Has anyone ever tried?
On MacOS Sierra version 10.13.6
Trying to run bitcoin-cli
./bitcoin-cli -testnet
Segmentation fault
Have no tried any other executable, but the executable works on ubuntu docker containers running ubuntu:17.10
I mount my real Ubuntu with fuse OS X at /Volumes/Ubuntu
how can I get Noah to use it (I don't mind that this may be living dangerously).
Hello,
I'm trying to run noah on OS X Sierra
Installed with
brew install linux-noah/noah/noah
Running with
$ noah
Error:
Running noah as normal user... This may cause unstable behavior of sudo executed from inside noah.
Invalid --mnt flag: : No such file or directory
I also tried to install this way:
brew uninstall noah
brew install --build-bottle ./noah.rb
brew bottle noah
But the same problem happens.
What am I doing wrong ?
Noah is installing the initial filesystem into ~/.noah/tree. Proceed? [Y/n] y
Password:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
6 171M 6 10.5M 0 0 10926 0 4:34:27 0:16:51 4:17:36 0
curl: (56) Recv failure: Connection reset by peer
could not fetch the suite at /usr/local/bin/noahstrap line 64.
It seems you have switched to Ubuntu VM image as default image (bc52707), but still latest release installs Arch, instead of Ubuntu.
This might be confusing, user may try to use "apt" command on the image instead of "pacman" :-)
So probably you need at least simple description something like "We will release new version that ship with Ubuntu image, until the release you can use Arch Linux image", etc.
I installed Noah with brew and upon executing Noah for the first time, it said "Your cpu seems too old. Buy a new Mac!"
I have a Macbook 2010. This is an intel core duo. What on earth does my CPU have to do with anything? Does it need duo specific instructions? I imagine Noah is written for the x86_64 architecture at large.
When I try to do anything as sudo, I get an error:
sudo: unknown uid 501: who are you?
Is this a bug or intended behaviour? What can I do?
root@a2ens-MacBook-Pro:~# apt-get install git
Reading package lists... Done
Building dependency tree... Done
The following additional packages will be installed:
ca-certificates git-man krb5-locales libasn1-8-heimdal libcurl3-gnutls
libedit2 liberror-perl libgdbm3 libgssapi-krb5-2 libgssapi3-heimdal
libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal
libhx509-5-heimdal libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3
libkrb5support0 libldap-2.4-2 libperl5.22 libroken18-heimdal librtmp1
libsasl2-2 libsasl2-modules libsasl2-modules-db libwind0-heimdal libx11-6
libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 openssh-client
openssl patch perl perl-modules-5.22 rename rsync xauth
Suggested packages:
gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el git-email
git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn krb5-doc
krb5-user libsasl2-modules-otp libsasl2-modules-ldap libsasl2-modules-sql
libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal ssh-askpass
libpam-ssh keychain monkeysphere ed diffutils-doc perl-doc
libterm-readline-gnu-perl | libterm-readline-perl-perl make openssh-server
The following NEW packages will be installed:
ca-certificates git git-man krb5-locales libasn1-8-heimdal libcurl3-gnutls
libedit2 liberror-perl libgdbm3 libgssapi-krb5-2 libgssapi3-heimdal
libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal
libhx509-5-heimdal libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3
libkrb5support0 libldap-2.4-2 libperl5.22 libroken18-heimdal librtmp1
libsasl2-2 libsasl2-modules libsasl2-modules-db libwind0-heimdal libx11-6
libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 openssh-client
openssl patch perl perl-modules-5.22 rename rsync xauth
0 upgraded, 43 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.4 MB of archives.
After this operation, 84.1 MB of additional disk space will be used.
E: Couldn't determine free space in /var/cache/apt/archives/ - statvfs (2: No such file or directory)
Cannot resolve noah-ci.idylls.jp port 80
Cannot resolve idylls.jp port 80
I got this message everywhere.
We cannot know this project active or not because of no way to see your project's status.
I hope you to continue this project. Please relaunch the server.
thanks.
T/O
A code that reproduces the bug:
#include<stdio.h>
#include<string.h>
#include<pthread.h>
#include<stdlib.h>
#include<unistd.h>
pthread_t tid[2];
int counter;
void* doSomeThing(void *arg)
{
unsigned long i = 0;
counter += 1;
printf("\n Job %d started\n", counter);
for(i=0; i<(0xFFFFFFFF);i++);
printf("\n Job %d finished\n", counter);
return NULL;
}
int main(void)
{
int i = 0;
int err;
while(i < 2)
{
err = pthread_create(&(tid[i]), NULL, &doSomeThing, NULL);
if (err != 0)
printf("\ncan't create thread :[%s]", strerror(err));
i++;
}
pthread_join(tid[0], NULL);
pthread_join(tid[1], NULL);
return 0;
}
The expected result:
Job 1 started
Job 2 started
Job 2 finished
Job 2 finished
What I got:
Job 1 started
mac OSX 10.11.6 (15G1004)
Homebrew 1.3.6
Homebrew/homebrew-core (git revision 16df1; last commit 2017-11-07)
==> Installing noah from linux-noah/noah ==> Downloading https://github.com/linux-noah/noah/archive/0.5.0.tar.gz Already downloaded: /Users/username/Library/Caches/Homebrew/noah-0.5.0.tar.gz ==> cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/noah/0.5.0 -DCMAKE_BUILD_TYPE=Release ==> make install Last 15 lines from /Users/username/Library/Logs/Homebrew/noah/02.make: ^ /tmp/noah-20171107-50423-1b7bgp3/noah-0.5.0/src/sys/time.c:188:12: error: use of undeclared identifier 'CLOCK_MONOTONIC' return CLOCK_MONOTONIC; ^ /tmp/noah-20171107-50423-1b7bgp3/noah-0.5.0/src/sys/time.c:190:12: error: use of undeclared identifier 'CLOCK_PROCESS_CPUTIME_ID' return CLOCK_PROCESS_CPUTIME_ID; ^ /tmp/noah-20171107-50423-1b7bgp3/noah-0.5.0/src/sys/time.c:192:12: error: use of undeclared identifier 'CLOCK_THREAD_CPUTIME_ID' return CLOCK_THREAD_CPUTIME_ID; ^ 5 errors generated. make[2]: *** [CMakeFiles/noah.dir/src/sys/time.c.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/noah.dir/all] Error 2 make: *** [all] Error 2
OUTPUT:
$ noah
Allow noah to run as root? It's necessary for privileged commands such as sudo.
Noah is still under development, so please enable it at your own risk! [y/N] y
Password:
read_vmcs failed
While attempting to run noah in debug build with v0.5.1 on Mac OS Sierra(10.12.6), the following segfault was reported as below.
Is this an AddressSanitizer bug or a noah bug?
==13512==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000460 (pc 0x00010560e582 bp 0x7fff5a5f99b0 sp 0x7fff5a5f8640 T0)
==13512==The signal is caused by a WRITE memory access.
==13512==Hint: address points to the zero page.
#0 0x10560e581 in main main.c:551
#1 0x7fffb903d234 in start (libdyld.dylib:x86_64+0x5234)
==13512==Register values:
rax = 0x3925cce988b8002e rbx = 0x0000000000000340 rcx = 0x3925cce988b8002e rdx = 0x0000100000000000
rdi = 0x00000000000034c8 rsi = 0x00007fff5a5f8418 rbp = 0x00007fff5a5f99b0 rsp = 0x00007fff5a5f8640
r8 = 0x0000000000000000 r9 = 0x000000000000001b r10 = 0x000000000000002e r11 = 0x00007fffb916b498
r12 = 0x0000000000000000 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x0000000000000000
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV main.c:551 in main
==13512==ABORTING
Abort trap: 6
$ mkdir foo
$ chmod -r foo
$ cd foo
bash: cd: foo: Permission denied
I am running into sporadic deadlocks when trying to run a simple multithreaded program.
Steps to reproduce:
g++ main.cc -pthread && while true; do ./a.out; done
The program deadlocks within a few runs, while it does not do so when I do the same in the native environment.
fstatat needs to support LINUX_AT_EMPTY flag.
Compiling the following code:
int main() {
__asm__("int3");
}
and run gdb ./a.out
many many times and get the following error:
yuichi@canopus:~/Developer/noah/build$ gdb ./a.out
Noah WARNING: SA_SIGINFO implementaion is incomplete: 0x4000004
Noah WARNING: SA_SIGINFO implementaion is incomplete: 0x14000004
Noah WARNING: SA_SIGINFO implementaion is incomplete: 0x4000004
Noah WARNING: SA_SIGINFO implementaion is incomplete: 0x4000004
Noah WARNING: SA_SIGINFO implementaion is incomplete: 0x4000004
Noah WARNING: SA_SIGINFO implementaion is incomplete: 0x4000004
Noah WARNING: SA_SIGINFO implementaion is incomplete: 0x14000004
!!PANIC!!
perror is "Undefined error: 0" if it is valid
recording overlapping regions
[20702:923115] Obtained 10 stack frames.
0 noah 0x000000010d4e7f85 printbt_to_sink + 85
1 noah 0x000000010d4e7ef0 panic + 608
2 noah 0x000000010d5051ab record_region + 331
3 noah 0x000000010d507c8e do_mmap + 526
4 noah 0x000000010d50768d sys_brk + 253
5 noah 0x000000010d507519 _sys_brk + 105
6 noah 0x000000010d4e0ca7 handle_syscall + 199
7 noah 0x000000010d4e04ee main_loop + 494
8 noah 0x000000010d4e146c main + 652
9 libdyld.dylib 0x00007fffe776f255 start + 1
$ noah
load_elf_interp, could not open file: /lib64/ld-linux-x86-64.so.2
Error: Operation not permitted
$
WARNING swReactorEpoll_create: epoll_create failed. Error: Function not implemented
Looks like unsupported flags are given to clock_gettime.
$ ls
a.out
$ a.ou [Hit tab here, then something strange happens and the noah process is killed]
When running sudo noah
, I receive the following error:
noah(37758,0x7fffc18ed3c0) malloc: *** error for object 0x7fc149c067f8: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
I am on OS X Sierra and have just installed noah from brew according to the instructions. Running noah
without sudo initially worked, but crashed with the same error in the end:
Allow noah to run as root? It's necessary for privileged commands such as sudo.
Noah is still under development, so please enable it at your own risk! [y/N] y
noah(31942,0x7fffc18ed3c0) malloc: *** error for object 0x7ff7a6c069d8: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
I built linux kernel with allnoconfig (+ tty support) on noah and found that it took a very long time compared to the real kernel running on vmware on the same machine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.