Git Product home page Git Product logo

google-coredumper's People

Contributors

achichinov avatar anatol avatar dutow avatar madscientist avatar romain-geissler-1a avatar zlobober avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

google-coredumper's Issues

coredumper_unittest fails on Ubuntu 20.04

If I compile and run the tests on Red Hat EL 7.x, they all pass fine.

If I compile and run the tests on Ubuntu 20.04 LTS, the coredumper_unittest fails in the GDB test because the generated core cannot be read and so it times out waiting for the expected results:

GNU gdb (GDB) 10.1
...
Reading symbols from /proc/193258/exe...

warning: core file may not match specified executable file.
Core was generated by `.libs/coredumper_unittest'.
#0  0x00007f5468a3f9ac in ?? ()
[Current thread is 1 (LWP 193258)]
(gdb)   Id   Target Id         Frame
* 1    LWP 193258        0x00007f5468a3f9ac in ?? ()
  2    LWP 193274        0x000055e969ac4a67 in ?? ()
  3    LWP 193273        0x000055e969ac4a69 in ?? ()

and if I try to use GDB on the core I get:

$ gdb -c core-test .libs/coredumper_unittest
Reading symbols from .libs/coredumper_unittest...

warning: core file may not match specified executable file.
Core was generated by `.libs/coredumper_unittest'.
#0  0x00007f5468a3f9ac in ?? ()
[Current thread is 1 (LWP 193258)]
(gdb) thr a a bt

Thread 3 (LWP 193273):
#0  0x000055e969ac4a69 in ?? ()
#1  0x00007f5468a01609 in ?? ()
#2  0x0000000000000000 in ?? ()

Thread 2 (LWP 193274):
#0  0x000055e969ac4a67 in ?? ()
#1  0x00007f5468a01609 in ?? ()
#2  0x0000000000000000 in ?? ()

Thread 1 (LWP 193258):
#0  0x00007f5468a3f9ac in ?? ()
Backtrace stopped: Cannot access memory at address 0x5aa4da70

But if I compile on a Red Hat 7.x system it works (note, it works even on an Ubuntu system: it doesn't matter where we RUN the test only where we compile it).

There must be some change in the system headers etc. from RHEL 7 to Ubuntu 20.04 that causes the coredumper code to be miscompiled so that it cannot write a valid core file any longer. For posterity here is the output from the core generated by coredumper_unittest compiled on RHEL 7:

warning: core file may not match specified executable file.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./coredumper_unittest'.
#0  0x00000000004044fa in WriteCoreDump ()
[Current thread is 1 (Thread 0x7f5ae8ca2740 (LWP 4077741))]
(gdb)   Id   Target Id                           Frame
* 1    Thread 0x7f5ae8ca2740 (LWP 4077741) 0x00000000004044fa in WriteCoreDump ()
  2    Thread 0x7f5ae84a0700 (LWP 4077745) 0x0000000000401b16 in Busy ()
  3    Thread 0x7f5ae8ca1700 (LWP 4077744) 0x0000000000401b21 in Busy ()
(gdb)

Unit tests fail on Ubuntu 17.10

The unittests fail when run on Ubuntu 17.10 / GCC 7.2 / binutils 2.29.1:

./preconfig
./configure CFLAGS=-O1
make
./coredumper_unittest
  ...
coredumper_unittest: ../src/coredumper_unittest.c:396: CheckExtraNotesWithReadElf: Assertion `note_index == kExtraNotesCount' failed.

Fails compiled with -O2 / GCC 7.x

When compiling with GCC 7.2 / 7.3 and -O2, the coredumper library doesn't work properly. The unittest dumps core immediately. When using the library in a real program I've seen things such as the coredumper library hanging inside the syscalls.

If you compile with -O1, then everything works. It also works with -O2 and older compilers (GCC 4.x and 5.x for sure... I'm not sure about 6.x). I don't know if this represents a bug in the coredumper code or an issue with the optimizer in GCC (most likely the former).

To reproduce simply check out and build using the normal operations and GCC 7.x:

./preconfig
./configure
make
make check

will dump core. If you clean up then build with -O1, it will work:

git clean -fdX
./preconfig
./configure CFLAGS=-O1
make
make check

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.