-1

I'm uploading files to a remote cloud server and got this error when running it from cloud. The program runs without error on my PC.

    ./mythread
Segmentation fault
$ gdb ./mythread
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show     copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./mythread...done.
(gdb) run
Starting program: /home/anand/wm/dbug/mythread 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
warning: the debug information found in "/usr/lib/libgl2ps.so.0.0.0" does not match "/usr/lib/libgl2ps.so.0" (CRC mismatch).

warning: the debug information found in "/usr/lib/libxine.so.2.5.0" does not match "/usr/lib/libxine.so.2" (CRC mismatch).

warning: the debug information found in "/usr/lib/libgfortran.so.3.0.0" does not match "/usr/lib/libgfortran.so.3" (CRC mismatch).

warning: the debug information found in "/usr/lib/libspeex.so.1.5.0" does not match "/usr/lib/libspeex.so.1" (CRC mismatch).

warning: the debug information found in "/usr/lib/libopus.so.0.5.0" does not match "/usr/lib/libopus.so.0" (CRC mismatch).

warning: the debug information found in "/usr/lib/libgeos_c.so.1.8.2" does not match "/usr/lib/libgeos_c.so.1" (CRC mismatch).

warning: the debug information found in "/usr/lib/libnetcdf.so.7.1.1" does not match "/usr/lib/libnetcdf.so.7" (CRC mismatch).

warning: the debug information found in "/usr/lib/libogg.so.0.8.2" does not match "/usr/lib/libogg.so.0" (CRC mismatch).

warning: the debug information found in "/usr/lib/libarpack.so.2.0.0" does not match "/usr/lib/libarpack.so.2" (CRC mismatch).


Program received signal SIGSEGV, Segmentation fault.
0x00007fffe3dc2110 in _IO_vfscanf_internal (s=s@entry=0x7fffffffe9a0, format=format@entry=0x7fffe5ddc3d0 "%d%n", 
argptr=argptr@entry=0x7fffffffeac8, errp=errp@entry=0x0) at vfscanf.c:340
340 vfscanf.c: No such file or directory.

Then I thought of running other simpler programs to examine if this is specific to my binary file and still got the same error.

Test program run later:

    int main() {

    int i = 0;
    while(i<10)
    {
        i =i+1;
        std::cout << i << "\n";
    }
    return 0;
}

Edit: I'm building it with QT version 5.3.2, and running with gdb.

Rama
  • 3,222
  • 2
  • 11
  • 26
muglikar
  • 146
  • 2
  • 18

2 Answers2

1

You are using a binary that is compiled in other version of O.S.

Check the version OS version of your PC and OS version of the remote machine. Use the same OS vesion to compile your programs.

This coud be solved also compiling the code in the remote machine.

You can check using command line:

lsb_release -a
Rama
  • 3,222
  • 2
  • 11
  • 26
  • `Cloud: Distributor ID: Debian Description: Debian GNU/Linux 8.7 (jessie) Release: 8.7 Codename: jessie` And PC: `Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie) Release: 8.6 Codename: jessie` – muglikar Apr 28 '17 at 19:10
  • Is there no other way to solve this other than ones you mentioned @Rama ? – muglikar Apr 28 '17 at 19:10
  • Not that I know. So you must to upgrade your PC to 8.7 – Rama Apr 28 '17 at 19:11
  • Being a production PC, that's too risky to do as it may break several other projects. – muglikar Apr 28 '17 at 19:12
  • 1
    Use a virual machine with jessie 8.7 to build that binary – Rama Apr 28 '17 at 19:13
  • I have upgraded both the systems to the latest May 6th 8.8 release of Debian and I still get this SegFault. So, may be it wasn't entirely due to different versions of Debian 8. – muglikar May 08 '17 at 12:28
  • @muglikar Test program doesn't work too? The error message is the same? – Rama May 08 '17 at 12:38
  • Yes, the simple test program also does not run and I get the same error. – muglikar May 08 '17 at 12:43
  • @muglikar, This make no sense. How do you compile, post the entire command, did you include heders? did you include additional libs? did you clean before compile? did you check that the binaries are the new ones? – Rama May 08 '17 at 13:16
  • I did run it in gdb on cloud and I see this on bt (backtrace): [backtrace](https://pastebin.com/VXv4ieVe) – muglikar May 08 '17 at 19:44
  • @muglikar, you can check also gdb versions(from cloud and production): `gdb -v` to check that are the same. BTW how do you compile? – Rama May 08 '17 at 19:48
  • @muglikar The application also has to be both compiled and linked with -g. See http://stackoverflow.com/questions/5244509/no-debugging-symbols-found-when-using-gdb – Rama May 08 '17 at 19:51
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/143722/discussion-between-muglikar-and-rama). – muglikar May 08 '17 at 20:01
1

Upgraded both gcc and gdb to their latest versions on both machines. Also upgraded both to Debian 8.8. But the problem was unsolved.

So, next installed same QT version 5.3.2 on remote host as on work Linux PC. And lo! The problem stood solved.

Only thing that was preventing installation of QT 5.3.2 on the remote headless machine was the error: Could not connect to X Server

So, did SSH using -X parameter and the installation happened. :)

This wouldn't have been possible without help from @Rama above!

muglikar
  • 146
  • 2
  • 18