腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
malloc
():
C
中
的
top
size
已损坏
c
、
pointers
、
struct
、
malloc
、
dynamic-memory-allocation
我尝试在
C
中使用struct创建一个堆栈,如下所示: typedef struct int index;} Stack; 以及一个为其分配内存
的
函数:in case stack gets full, it will be increased by 10 } 在main函数
中
:++i) print
浏览 298
提问于2021-08-18
得票数 0
1
回答
malloc
():Linux
中
recv()方法
的
top
size
已损坏
c++
当它崩溃时,我得到:
malloc
(): corrupted
top
size
。
浏览 0
提问于2020-03-23
得票数 0
1
回答
sysmalloc
的
malloc
错误
c
、
malloc
在我
的
C
程序
中
,我得到以下消息错误: a.out:
malloc
.
c
:2369: sysmalloc:断言`(old_
top
== (Mbinptr))(char *)和((Av)->bins( 1)-1)* 2)) - __builtin_offsetof (struct
malloc
_chunk,fd))和old_
size
== 0)Fd_nextsize)+((2*(sizeof(
Size
_t))-1)和~(2*(siz
浏览 2
提问于2015-07-23
得票数 2
回答已采纳
1
回答
读取
c
++文件
中
的
所有字节。
c
、
windows
、
file
、
stat
我正在尝试从文件
中
读取字节,但大小
已损坏
。在调试时,我可以看到st.st_
size
的
值,但我无法读取
size
的
值。int main(void) FILE* oud; _off_t
size
; char constpath[] = "
C
:\\Users\\Ruben\\Documents\\test.txt"; err
浏览 2
提问于2012-10-16
得票数 2
2
回答
使用函数初始化结构
c
、
struct
、
initialization
这在我
的
main.
c
中
Path Solution;printf("
Size
: %d\n",Solution.
size
);}typedef struct{
浏览 0
提问于2015-10-16
得票数 0
1
回答
如何使用kprobe计算linux内核
中
的
malloc
linux-kernel
、
malloc
、
system-calls
、
fedora
、
kprobe
我想用fedora
中
的
Kprobe对
malloc
系统调用进行计数。我知道
malloc
不是一个系统调用,它是在用户空间实现
的
,但如果可能的话,我想用kprobe来计算
malloc
。我必须给Kprobe
的
系统调用
的
名称是什么?例如,对于do_work: kp.addr = (kprobe_opcode_t *) kallsyms_lookup_name("do_fork");
浏览 11
提问于2013-01-23
得票数 1
回答已采纳
2
回答
newlib
中
的
malloc
():在一次大
的
失败分配之后,它会浪费内存吗?
c
、
embedded
、
malloc
、
newlib
、
sbrk
我正在为STM32F7编写一个嵌入式软件,我
的
libc是newlib-2.4.0.20160527。(0x40000);mem =
malloc
(0x40000); 一切正常工作(即
malloc
两次返回非零)。因此,堆上实际上没有分配
的
内存(我没有得到任何mem != 0,所以我甚至不能使用free() ),也没有可用
的
内存。我期望
malloc
()对每个sz > 0x40000都失败,对于每个sz <= 0x40000都会成功(假设f
浏览 5
提问于2016-08-22
得票数 4
2
回答
sYSMALLOc:断言失败-有什么有效
的
调试方法吗?
c
、
debugging
、
gdb
、
malloc
我
的
服务器守护进程在大多数机器上都工作得很好,但是在我得到
的
一台机器上:1)))&& ((old_
top
)->
size
&
浏览 2
提问于2010-02-23
得票数 8
2
回答
C
Sysmalloc断言失败
c
、
memory-management
、
malloc
、
assertion
在运行
C
程序时,我得到了下面的sysmalloc错误。
malloc
.
c
:3096: sYSMALLOc: Assertion `(old_
top
== (((mbinptr) (((char *)&& old_
size
== 0) || ((unsigned long) (old_
size</
浏览 2
提问于2015-08-11
得票数 0
3
回答
为什么我
的
堆栈返回null?
c
、
stack
我一直在用
C
编写一个简单
的
堆栈:#include <string.h>typedefstruct Stack { void **
top
; Stack *stack =
malloc
void *old_
top
= s
浏览 2
提问于2014-07-22
得票数 0
回答已采纳
1
回答
Malloc
断言
c
、
unix
、
malloc
我在一个函数中使用
malloc
()。函数
的
第一次调用运行良好,但第二次,我得到了 allum1:
malloc
.
c
:2372: sysmalloc: Assertion `(old_
top
== (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct
malloc
_chunk, fd)))) && old_
size
== 0) ||
浏览 1
提问于2015-02-21
得票数 0
回答已采纳
2
回答
malloc
误差
C
++
c++
、
malloc
可能重复:
malloc
.
c
:3096: sYSMALLOc: Assertion `(old_
top
== (((mbinptr) (((char*) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct
malloc
_chunk, fd)))) && old_
size
== 0)|| ((unsig
浏览 3
提问于2010-10-11
得票数 2
回答已采纳
3
回答
内存分配和释放不工作
c
、
struct
、
malloc
、
free
、
sizeof
我试图在
C
(VS 2022)
中
创建动态分配
的
结构数组,但是程序在释放内存时会崩溃:void task() { struct Student tmp; struct Student * students = (structStudent*)
malloc
(
浏览 6
提问于2022-04-19
得票数 -1
2
回答
在声明后将连续内存分配给2d数组
c
、
arrays
、
malloc
据我所知,现代
的
C
标准允许我将一块内存分配给一个2d数组,如下所示:// assign rows and cols
size
_t rows, cols;例如,我知道可以使用单个索引来代替
浏览 0
提问于2017-09-05
得票数 1
1
回答
如何在
C
语言中修复这个错误“下标值”?
arrays
、
c
、
pointers
我从我
的
程序
中
得到了这个错误 84 | }while(deck; //int topcardindex; char* name; * * 4) ej
浏览 2
提问于2020-12-17
得票数 1
2
回答
C
malloc
错误代码:3096
c
、
malloc
你好,朋友们,我在使用
malloc
时遇到了问题,错误代码是3096:
malloc
.
c
:3096: sYSMALLOc: old_
top
`(Mbinptr))(char *)和((Av)->bins(( 1) -1)* 2)) - __builtin_offsetof (struct
malloc
_chunk,fd))和old_
size
== 0)Fd_nextsize)+((2*(sizeof(
Size
_t))-1)和~(2*(sizeof(
Size<
浏览 1
提问于2013-07-09
得票数 0
回答已采纳
1
回答
在马洛克还是我
的
?
c++
、
c
、
gcc
这是我
的
错误,还是
malloc
本身
的
错误/断言失败?alloc.
c
:2451: sYSMALLOc:断言`(old_
top
== (Mbinptr))(char *)和(Av)->bins(( 1) -1)* 2)) - __builtin_offsetof(struct
malloc
_chunk,fd))和old_
size
== 0) (无符号
的
长) (old_
size
) =(__builtin_offsetof (
浏览 5
提问于2012-12-09
得票数 1
回答已采纳
1
回答
已中止
的
核心转储
c
stack.out:
malloc
.
c
:2372: __builtin_offsetof (struct
malloc
_chunk, fd)))) && old_
size
== 0) || ((unsigned long) (old_
size
) >= (unsign
浏览 0
提问于2017-04-03
得票数 0
1
回答
如何将2d数组复制到临时2d数组并返回它?
c
、
memory-management
、
memory-leaks
、
valgrind
、
memcpy
我试图将一个二维it数组复制到一个临时
的
二维it数组
中
,并返回它。我在下面试过了,但我发现了一个可疑
的
malloc
错误。我试着用勇敢
的
方法检查它,但找不到任何有用
的
东西。memcpy(grid_state[i], grid[i], length); return grid_state;未结算错误消息如下: program:
malloc
.
c
(struct
malloc
_chunk, fd)))) &&
浏览 0
提问于2016-08-22
得票数 1
回答已采纳
2
回答
调用memset后出现奇怪
的
sysmalloc断言错误
c
、
memory
我对
C
编程比较陌生,目前正在开发一个简单
的
Hashtable (我有其他语言
的
经验)。server:
malloc
.
c
:2401: sysmalloc: Assertion (old_
top
== initial_
top
(av) &&
浏览 10
提问于2020-12-06
得票数 1
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
对象存储
云点播
即时通信 IM
活动推荐
运营活动
广告
关闭
领券