小编Jos*_*euf的帖子

这为什么会这么分裂?有人可以解释valgrind错误吗?

所以我有这个程序在我的家用机器上编译很好,但是一旦我在大学服务器上编译它就会打破......:/这对我的屁股来说是一个巨大的痛苦.我不知道可能导致错误的位置或原因.我首先从大学的valgrind报告开始.

    ==13527== Memcheck, a memory error detector
==13527== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==13527== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==13527== Command: ./main stock.dat coins.dat
==13527== 
==13527== Invalid write of size 8
==13527==    at 0x402762: load_data (in /RMIThome/shr/5/s3234575/Assignments2/main)
==13527==    by 0x4028BE: main (in /RMIThome/shr/5/s3234575/Assignments2/main)
==13527==  Address 0x6172676f72502074 is not stack'd, malloc'd or (recently) free'd
==13527== 
==13527== 
==13527== Process terminating with default action of signal 11 (SIGSEGV)
==13527==  General Protection Fault …
Run Code Online (Sandbox Code Playgroud)

c struct valgrind memory-leaks segmentation-fault

-6
推荐指数
1
解决办法
356
查看次数

标签 统计

c ×1

memory-leaks ×1

segmentation-fault ×1

struct ×1

valgrind ×1