Git Product home page Git Product logo

Comments (8)

jart avatar jart commented on July 24, 2024 1

Thanks for posting your /var/log/syslog which contained the faulting address 0x410f1c. I see now what the issue is:

image

Looks like this can be fixed by using vxorps instead of vpxor.

from cosmopolitan.

jart avatar jart commented on July 24, 2024

Could you please download these two files:

To the o/build/bootstrap/ directory, and then re-run the build?

from cosmopolitan.

tankf33der avatar tankf33der commented on July 24, 2024

I am stuck and cant move.

After downloading files and run build again It did not helped and failed with huge blue output again.
I dont post it here thou.

$ make clean
ARCHIVE.a      o//libc/stubs/stubs.a
Illegal instruction
archive failed: o/build/bootstrap/ar.com rcsD o//libc/stubs/stubs.a libc/stubs/ o//libc/stubs/stubs.a.pkg o//libc/stubs/abort.S.zip.o o//libc/stubs/addvdi3.S.zip.o o//libc/stubs/addvsi3.S.zip.o o//libc/stubs/addvti3.S.zip.o o//libc/stubs/asan.S.zip.o o//libc/stubs/assertfail.S.zip.o o//libc/stubs/cxapurevirtual.S.zip.o o//libc/stubs/debugbreak.S.zip.o o//libc/stubs/errno.S.zip.o o//libc/stubs/errnolocation.S.zip.o o//libc/stubs/exit.S.zip.o o//libc/stubs/fentry.S.zip.o o//libc/stubs/gcov.S.zip.o o//libc/stubs/instrumentation.S.zip.o o//libc/stubs/ld.S.zip.o o//libc/stubs/mcount.S.zip.o o//libc/stubs/missingno.S.zip.o o//libc/stubs/mulvdi3.S.zip.o o//libc/stubs/mulvsi3.S.zip.o o//libc/stubs/mulvti3.S.zip.o o//libc/stubs/negvdi2.S.zip.o o//libc/stubs/negvsi2.S.zip.o o//libc/stubs/negvti2.S.zip.o o//libc/stubs/onarithmeticoverflow.S.zip.o o//libc/stubs/panic.S.zip.o o//libc/stubs/retpoline.S.zip.o o//libc/stubs/stackchkguard.S.zip.o o//libc/stubs/stackguard.S.zip.o o//libc/stubs/subvdi3.S.zip.o o//libc/stubs/subvsi3.S.zip.o o//libc/stubs/subvti3.S.zip.o o//libc/stubs/sysv2nt.S.zip.o o//libc/stubs/triplf.S.zip.o o//libc/stubs/typeinfo.S.zip.o o//libc/stubs/ubsan.S.zip.o o//libc/stubs/xnu.S.zip.o o//libc/stubs/zip.S.zip.o o//libc/stubs/abort.o o//libc/stubs/addvdi3.o o//libc/stubs/addvsi3.o o//libc/stubs/addvti3.o o//libc/stubs/asan.o o//libc/stubs/assertfail.o o//libc/stubs/cxapurevirtual.o o//libc/stubs/debugbreak.o o//libc/stubs/errno.o o//libc/stubs/errnolocation.o o//libc/stubs/exit.o o//libc/stubs/fentry.o o//libc/stubs/gcov.o o//libc/stubs/instrumentation.o o//libc/stubs/ld.o o//libc/stubs/mcount.o o//libc/stubs/missingno.o o//libc/stubs/mulvdi3.o o//libc/stubs/mulvsi3.o o//libc/stubs/mulvti3.o o//libc/stubs/negvdi2.o o//libc/stubs/negvsi2.o o//libc/stubs/negvti2.o o//libc/stubs/onarithmeticoverflow.o o//libc/stubs/panic.o o//libc/stubs/retpoline.o o//libc/stubs/stackchkguard.o o//libc/stubs/stackguard.o o//libc/stubs/subvdi3.o o//libc/stubs/subvsi3.o o//libc/stubs/subvti3.o o//libc/stubs/sysv2nt.o o//libc/stubs/triplf.o o//libc/stubs/typeinfo.o o//libc/stubs/ubsan.o o//libc/stubs/xnu.o o//libc/stubs/zip.o


NOTE: deleting o//depend because of an unspecified prerequisite: clean

rm -f o//depend
$
$
$ make
ARCHIVE.a      o//libc/stubs/stubs.a
Illegal instruction
archive failed: o/build/bootstrap/ar.com rcsD o//libc/stubs/stubs.a libc/stubs/ o//libc/stubs/stubs.a.pkg o//libc/stubs/abort.S.zip.o o//libc/stubs/addvdi3.S.zip.o o//libc/stubs/addvsi3.S.zip.o o//libc/stubs/addvti3.S.zip.o o//libc/stubs/asan.S.zip.o o//libc/stubs/assertfail.S.zip.o o//libc/stubs/cxapurevirtual.S.zip.o o//libc/stubs/debugbreak.S.zip.o o//libc/stubs/errno.S.zip.o o//libc/stubs/errnolocation.S.zip.o o//libc/stubs/exit.S.zip.o o//libc/stubs/fentry.S.zip.o o//libc/stubs/gcov.S.zip.o o//libc/stubs/instrumentation.S.zip.o o//libc/stubs/ld.S.zip.o o//libc/stubs/mcount.S.zip.o o//libc/stubs/missingno.S.zip.o o//libc/stubs/mulvdi3.S.zip.o o//libc/stubs/mulvsi3.S.zip.o o//libc/stubs/mulvti3.S.zip.o o//libc/stubs/negvdi2.S.zip.o o//libc/stubs/negvsi2.S.zip.o o//libc/stubs/negvti2.S.zip.o o//libc/stubs/onarithmeticoverflow.S.zip.o o//libc/stubs/panic.S.zip.o o//libc/stubs/retpoline.S.zip.o o//libc/stubs/stackchkguard.S.zip.o o//libc/stubs/stackguard.S.zip.o o//libc/stubs/subvdi3.S.zip.o o//libc/stubs/subvsi3.S.zip.o o//libc/stubs/subvti3.S.zip.o o//libc/stubs/sysv2nt.S.zip.o o//libc/stubs/triplf.S.zip.o o//libc/stubs/typeinfo.S.zip.o o//libc/stubs/ubsan.S.zip.o o//libc/stubs/xnu.S.zip.o o//libc/stubs/zip.S.zip.o o//libc/stubs/abort.o o//libc/stubs/addvdi3.o o//libc/stubs/addvsi3.o o//libc/stubs/addvti3.o o//libc/stubs/asan.o o//libc/stubs/assertfail.o o//libc/stubs/cxapurevirtual.o o//libc/stubs/debugbreak.o o//libc/stubs/errno.o o//libc/stubs/errnolocation.o o//libc/stubs/exit.o o//libc/stubs/fentry.o o//libc/stubs/gcov.o o//libc/stubs/instrumentation.o o//libc/stubs/ld.o o//libc/stubs/mcount.o o//libc/stubs/missingno.o o//libc/stubs/mulvdi3.o o//libc/stubs/mulvsi3.o o//libc/stubs/mulvti3.o o//libc/stubs/negvdi2.o o//libc/stubs/negvsi2.o o//libc/stubs/negvti2.o o//libc/stubs/onarithmeticoverflow.o o//libc/stubs/panic.o o//libc/stubs/retpoline.o o//libc/stubs/stackchkguard.o o//libc/stubs/stackguard.o o//libc/stubs/subvdi3.o o//libc/stubs/subvsi3.o o//libc/stubs/subvti3.o o//libc/stubs/sysv2nt.o o//libc/stubs/triplf.o o//libc/stubs/typeinfo.o o//libc/stubs/ubsan.o o//libc/stubs/xnu.o o//libc/stubs/zip.o

make: *** No rule to make target 'o//libc/stubs/stubs.a', needed by 'o//ape'.  Stop.
$

from cosmopolitan.

tankf33der avatar tankf33der commented on July 24, 2024

Keep having fun, the same fail on Void and Fedora, note Manjaro can execute ar.com below:

# FEDORA RAWHIDE
$ uname -a
Linux localhost.localdomain 5.10.0-0.rc6.90.fc34.x86_64 #1 SMP Mon Nov 30 14:04:45 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ wget https://justine.lol/cosmopolitan/ar.com
$ chmod 755
$ ./ar.com
Illegal instruction (core dumped)
$ strace ./ar.com
execve("./ar.com", ["./ar.com"], 0x7ffd08ce7500 /* 26 vars */) = 0
mmap(0x100080000000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x100080000000
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPN, si_addr=0x410f1c} ---
+++ killed by SIGILL (core dumped) +++
Illegal instruction (core dumped)
$

from cosmopolitan.

tankf33der avatar tankf33der commented on July 24, 2024

This is on Manjaro with the same file:

$ ./ar.com 
Usage: ./ar.com rcsD ARCHIVE FILE...
$ strace ./ar.com 
execve("./ar.com", ["./ar.com"], 0x7fff21516990 /* 61 vars */) = 0
mmap(0x100080000000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x100080000000
mprotect(0x416000, 8192, PROT_READ)     = 0
rt_sigaction(SIGQUIT, {sa_handler=0x40dfba, sa_mask=~[QUIT ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_RESETHAND, sa_restorer=0x410500}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGFPE, {sa_handler=0x40dfba, sa_mask=~[QUIT ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_RESETHAND, sa_restorer=0x410500}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGILL, {sa_handler=0x40dfba, sa_mask=~[QUIT ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_RESETHAND, sa_restorer=0x410500}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGSEGV, {sa_handler=0x40dfba, sa_mask=~[QUIT ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_RESETHAND, sa_restorer=0x410500}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGTRAP, {sa_handler=0x40dfba, sa_mask=~[QUIT ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_RESETHAND, sa_restorer=0x410500}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGABRT, {sa_handler=0x40dfba, sa_mask=~[QUIT ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_RESETHAND, sa_restorer=0x410500}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGBUS, {sa_handler=0x40dfba, sa_mask=~[QUIT ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_RESETHAND, sa_restorer=0x410500}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
writev(2, [{iov_base="Usage: ./ar.com rcsD ARCHIVE FIL"..., iov_len=37}], 1Usage: ./ar.com rcsD ARCHIVE FILE...
) = 37
exit_group(1)                           = ?
+++ exited with 1 +++
$

from cosmopolitan.

vmedea avatar vmedea commented on July 24, 2024

Don't know if it's the same issue but I also get an illegal instruction exception in ar.com while running make from the repository:

ARCHIVE.a      o//libc/stubs/stubs.a
Illegal instruction (core dumped)
archive failed: o/build/bootstrap/ar.com rcsD o//libc/stubs/stubs.a libc/stubs/ …

make: *** No rule to make target 'o//libc/stubs/stubs.a', needed by 'o//ape'.  Stop.

(Ubuntu 20.04, AMD CPU, running inside a LXC environment)

dmesg has the following message:

ar.com[445797] trap invalid opcode ip:407488 sp:7ffecd16c568 error:0 in ar.com[400000+9000]

Digging deeper:

$ echo 0x7 > /proc/self/coredump_filter
$ make
ARCHIVE.a      o//libc/stubs/stubs.a
Illegal instruction (core dumped)
...
$ objdump -d core|grep 407488 
  407488:       c5 dd ef e4             vpxor  %ymm4,%ymm4,%ymm4

This makes sense. This is an avx2 instruction and the CPU I'm testing on only supports up to avx.


Trying with gdb and the other version of ar.com above gets me the following backtrace:

#0  0x0000000000407488 in memmem (haystackp=0x100080000240, haystacklen=17594333595349, needlep=0x22, needlelen=64) at libc/alg/memmem.c:73
#1  0x0000000000401e6b in spawnve$nt (flags=2147484224, stdiofds=0x1000800106d5, program=0x22 <error: Cannot access memory at address 0x22>, argv=0x40, envp=0x100080010660) at libc/calls/hefty/spawnve-nt.c:38
#2  0x00000000004011c5 in abort () at libc/runtime/abort.S:53
#3  0x000000000000004f in ?? ()

from cosmopolitan.

kokke avatar kokke commented on July 24, 2024

Hi @jart - I think you've done great and novel work here :) I am super excited to try this project!

Just FYI, I have the same problem on Debian with an old i5 laptop (Lenovo T420). Same with the versions of ar.com you provided. Looks like same issue as @tankf33der

Seemingly my system compiles the code fine but fails at archiving the object-code with an "illegal instruction" error message.
I suspect the missing AVX2-support is at blame here.

A question: With which assumptions is cosmopolitan built? (I'm sure it can be found in the code/built-scripts, but I haven't found it..). It sounds plausible that there is an assumption about AVX2 support that just needs to go somewhere?

/tmp/c_cosmopolitan/cosmopolitan-master$ make -j4
[...]
ARCHIVE.a      o//third_party/zlib/zlib.a
Illegal instruction
archive failed: [...]
/tmp/c_cosmopolitan/cosmopolitan-master$ head /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
stepping	: 7
microcode	: 0x2f
cpu MHz		: 919.066
cache size	: 3072 KB
physical id	: 0

/tmp/c_cosmopolitan/cosmopolitan-master$ uname -a
Linux laptop 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux

from cosmopolitan.

jart avatar jart commented on July 24, 2024

New binaries are now uploaded to https://justine.lol/ for Cosmopolitan and related projects, e.g. Blinkenlights, Memzoom, Apelife, and Redbean.

from cosmopolitan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.