【问题标题】:Segmentation Fault: vfscanf.c No such file or directory分段错误:vfscanf.c 没有这样的文件或目录
【发布时间】:2017-04-28 19:00:10
【问题描述】:

我正在将文件上传到远程云服务器,并在从云中运行时出现此错误。该程序在我的电脑上运行没有错误。

    ./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.

然后我想运行其他更简单的程序来检查这是否特定于我的二进制文件并且仍然得到相同的错误。

稍后运行测试程序:

    int main() {

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

编辑:我正在使用 QT 版本 5.3.2 构建它,并使用 gdb 运行。

【问题讨论】:

  • @deW1 你能指导一下如何解决它吗?
  • 请完成后测试程序(包括标题)。并发布你是如何编译它的。
  • 添加信息,让这篇文章对其他有同样问题的人有用。

标签: c++ qt segmentation-fault gdb cloud


【解决方案1】:

您正在使用在其他版本的操作系统中编译的二进制文件

检查您的 PC 的操作系统版本和远程计算机的操作系统版本。 使用相同的操作系统版本来编译您的程序。

在远程机器上编译代码也可以解决这个问题。

您可以使用命令行检查:

lsb_release -a

【讨论】:

  • Cloud: Distributor ID: Debian Description: Debian GNU/Linux 8.7 (jessie) Release: 8.7 Codename: jessie 和 PC:Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie) Release: 8.6 Codename: jessie
  • 除了你提到的@Rama 之外,没有其他方法可以解决这个问题吗?
  • 我不知道。所以你必须将你的电脑升级到 8.7
  • 作为生产 PC,这样做风险太大,因为它可能会破坏其他几个项目。
  • 使用带有 jessie 8.7 的虚拟机构建二进制文件
【解决方案2】:

在两台机器上都将 gcc 和 gdb 升级到最新版本。还升级到 Debian 8.8。但是问题没有解决。

所以,接下来在远程主机上安装与在工作 Linux PC 上相同的 QT 版本 5.3.2。瞧!问题就解决了。

唯一阻止在远程无头机器上安装 QT 5.3.2 的是错误:Could not connect to X Server

所以,SSH 是否使用 -X 参数并且安装发生了。 :)

如果没有上面@Rama 的帮助,这是不可能的!

【讨论】:

    猜你喜欢
    • 2018-03-31
    • 1970-01-01
    • 1970-01-01
    • 2021-10-31
    • 1970-01-01
    • 2013-08-08
    • 2013-11-04
    • 2012-02-18
    • 2012-10-21
    相关资源
    最近更新 更多