Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when running on x86_64 /bin/ls #1602

Closed
bradlarsen opened this issue Jan 29, 2020 · 0 comments · Fixed by #1604
Closed

Crash when running on x86_64 /bin/ls #1602

bradlarsen opened this issue Jan 29, 2020 · 0 comments · Fixed by #1604
Labels

Comments

@bradlarsen
Copy link
Contributor

OS / Environment

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic

Manticore version

Version 0.3.2.1

Python version

Python 3.8.0

Dependencies

capstone==4.0.1
crytic-compile==0.1.6
cytoolz==0.10.1
eth-hash==0.2.0
eth-typing==2.2.1
eth-utils==1.8.4
future==0.18.2
manticore==0.3.2.1
pkg-resources==0.0.0
ply==3.11
prettytable==0.7.2
pyelftools==0.26
pyevmasm==0.2.0
pysha3==1.0.2
PyYAML==5.3
rlp==1.2.0
toolz==0.10.0
unicorn==1.0.2rc1
wasm==1.2
wrapt==1.11.2
z3-solver==4.8.7.0

Summary of the problem

If you try to run manticore on /bin/ls with no arguments, Manticore crashes.

Step to reproduce the behavior

$ time manticore /bin/ls

Expected behavior

Manticore should not crash.

Actual behavior

$ time manticore /bin/ls
2020-01-29 15:43:49,946: [1547] m.n.manticore:INFO: Loading program /bin/ls
2020-01-29 15:44:37,641: [1577] m.p.platform:WARNING: Unimplemented system call at 0x7fffff10cf17: sys_set_robust_list(0x7ffffffcbf20, 0x18)
2020-01-29 15:44:37,669: [1577] m.p.linux:WARNING: SIGACTION, Ignoring changing signal handler for signal 32
2020-01-29 15:44:37,686: [1577] m.p.linux:WARNING: SIGACTION, Ignoring changing signal handler for signal 33
2020-01-29 15:44:37,692: [1577] m.p.linux:WARNING: SIGACTION, Ignoring changing signal mask set cmd:140737488354728
2020-01-29 15:44:37,703: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:38,017: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:38,040: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:38,251: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:38,286: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:38,503: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:38,660: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:38,957: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:39,549: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:39,765: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:39,801: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:40,000: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:40,006: [1577] m.p.platform:WARNING: Unimplemented system call at 0x7fffff8ab977: sys_statfs(0x7fffffbaac63, 0x7ffffffffd60)
2020-01-29 15:44:40,018: [1577] m.p.platform:WARNING: Unimplemented system call at 0x7fffff8ab977: sys_statfs(0x7fffffbaac6a, 0x7ffffffffd60)
2020-01-29 15:44:40,035: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:40,236: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:40,287: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:40,568: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:49,682: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:49,856: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:50,203: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:50,360: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:50,378: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:50,535: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:50,729: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:50,867: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:53,059: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:53,219: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:53,250: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:53,401: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
2020-01-29 15:44:53,511: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc631:       0f ae 44 24 40  fxsave  [rsp + 0x40]
2020-01-29 15:44:53,637: [1577] m.n.c.abstractcpu:WARNING: Unimplemented instruction: 0x00007fffffdcc646:       0f ae 4c 24 40  fxrstor [rsp + 0x40]
FILE MODE: sindex.c :: 100644
FILE MODE: helloworld :: 100755
FILE MODE: basic.c :: 100644
FILE MODE: sindex :: 100755
FILE MODE: simple_copy :: 100755
FILE MODE: strncmp :: 100755
FILE MODE: Makefile :: 100644
FILE MODE: sendmail.c :: 100644
FILE MODE: ibranch :: 100755
FILE MODE: simpleassert.c :: 100644
FILE MODE: basic :: 100755
FILE MODE: ibranch.c :: 100644
FILE MODE: simple_copy.c :: 100644
FILE MODE: mcore_4cezftu_ :: 40700
FILE MODE: crackme.c :: 100644
FILE MODE: basic_state_merging.c :: 100644
FILE MODE: strncmp.c :: 100644
FILE MODE: crackme.py :: 100644
FILE MODE: lava.c :: 100644
FILE MODE: nostdlib :: 100755
FILE MODE: indexhell :: 100755
FILE MODE: nostdlib.c :: 100644
FILE MODE: binaries :: 40755
FILE MODE: simpleassert :: 100755
FILE MODE: helloworld.c :: 100644
FILE MODE: arguments.c :: 100644
FILE MODE: crackme :: 100755
FILE MODE: baby-re.c :: 100644
FILE MODE: arguments :: 100755
FILE MODE: indexhell.c :: 100644
FILE MODE: sendmail :: 100755
Traceback (most recent call last):
  File "/home/vagrant/manticore/venv/bin/manticore", line 11, in <module>
    sys.exit(main())
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/__main__.py", line 47, in main
    native_main(args, logger)
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/native/cli.py", line 39, in native_main
    m.finalize()
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/native/manticore.py", line 314, in finalize
    super().finalize()
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/core/manticore.py", line 971, in finalize
    for state in self.all_states:
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/core/manticore.py", line 657, in all_states
    state = self._load(state_id)
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/utils/event.py", line 85, in newFunction
    result = func(self, *args, **kw)
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/core/manticore.py", line 410, in _load
    state = self._workspace.load_state(state_id, delete=False)
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/core/workspace.py", line 465, in load_state
    return self._store.load_state(f"{self._prefix}{state_id:08x}{self._suffix}", delete=delete)
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/core/workspace.py", line 179, in load_state
    state = self._serializer.deserialize(f)
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/utils/helpers.py", line 102, in deserialize
    return pickle.load(f)
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/platforms/linux.py", line 2906, in __setstate__
    super().__setstate__(state)
  File "/home/vagrant/manticore/venv/lib/python3.8/site-packages/manticore/platforms/linux.py", line 669, in __setstate__
    self.files[1].peer = self.output
AttributeError: 'NoneType' object has no attribute 'peer'

real    1m15.852s
user    1m5.858s
sys     0m9.925s
@bradlarsen bradlarsen added the bug label Jan 29, 2020
bradlarsen pushed a commit that referenced this issue Jan 31, 2020
ehennenfent pushed a commit that referenced this issue Feb 4, 2020
* Organize examples in Makefile

* .gitignore binaries created in examples/linux

* Add a new Linux example using fclose

* Add a test case for the fclose example binary

See also #1602 and #1604.

* Add a comment for the change from #1604

* Delete an obsolete comment

* Add type hints to native integration tests

* Do not squelch command output from test

* Use `--worksapce` for `test_logger_verbosity`

This should prevent extra mcore_* directories from hanging around after testing.

* Reformat test_integration_native.py via `black`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant