473,668 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

***glibc detected*** free(): invalid next size (fast): help?

8 New Member
I made a program that finds a minimum spanning tree.

In my main
I created
kruskal k;
and called
k.findMST();

Expand|Select|Wrap|Line Numbers
  1. void kruskal :: findMST(){
  2. int edgesAccepted = 0;
  3. disjoint ds( numVer ); //disjoint set data structure
  4. edge e; //struct containing vertices and weight
  5. int u,v;
  6.  
  7. while( ( edgesAccepted < numVer - 1 ) && !que.empty())
  8. {
  9. //finds mst 
  10. }
  11.  
  12. }
  13.  
After findMST() function ends, i get the following error.



Expand|Select|Wrap|Line Numbers
  1. *** glibc detected *** ./prog2: free(): invalid next size (fast): 0x09de8180 ***
  2. ======= Backtrace: =========
  3. /lib/libc.so.6[0xb36a96]
  4. /lib/libc.so.6(cfree+0x90)[0xb39fb0]
  5. /usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x342a691]
  6. ./prog2[0x804bb15]
  7. ./prog2[0x804bb3f]
  8. ./prog2[0x804bb78]
  9. ./prog2[0x804bc56]
  10. ./prog2[0x804b67b]
  11. ./prog2[0x8049b50]
  12. ./prog2[0x8049565]
  13. /lib/libc.so.6(__libc_start_main+0xdc)[0xae5dec]
  14. ./prog2(__gxx_personality_v0+0x65)[0x8048e91]
  15. ======= Memory map: ========
  16. 00ab3000-00acc000 r-xp 00000000 08:02 196887     /lib/ld-2.5.so
  17. 00acc000-00acd000 r-xp 00019000 08:02 196887     /lib/ld-2.5.so
  18. 00acd000-00ace000 rwxp 0001a000 08:02 196887     /lib/ld-2.5.so
  19. 00ad0000-00c0a000 r-xp 00000000 08:02 196888     /lib/libc-2.5.so
  20. 00c0a000-00c0c000 r-xp 0013a000 08:02 196888     /lib/libc-2.5.so
  21. 00c0c000-00c0d000 rwxp 0013c000 08:02 196888     /lib/libc-2.5.so
  22. 00c0d000-00c10000 rwxp 00c0d000 00:00 0
  23. 00c12000-00c37000 r-xp 00000000 08:02 196958     /lib/libm-2.5.so
  24. 00c37000-00c38000 r-xp 00024000 08:02 196958     /lib/libm-2.5.so
  25. 00c38000-00c39000 rwxp 00025000 08:02 196958     /lib/libm-2.5.so
  26. 0335e000-03369000 r-xp 00000000 08:02 197036     /lib/libgcc_s-4.1.2-20070626.so.1
  27. 03369000-0336a000 rwxp 0000a000 08:02 197036     /lib/libgcc_s-4.1.2-20070626.so.1
  28. 03377000-03457000 r-xp 00000000 08:02 1167049    /usr/lib/libstdc++.so.6.0.8
  29. 03457000-0345b000 r-xp 000df000 08:02 1167049    /usr/lib/libstdc++.so.6.0.8
  30. 0345b000-0345c000 rwxp 000e3000 08:02 1167049    /usr/lib/libstdc++.so.6.0.8
  31. 0345c000-03462000 rwxp 0345c000 00:00 0
  32. 08048000-0804d000 r-xp 00000000 00:1b 31195548   /prog2
  33. 0804d000-0804e000 rwxp 00004000 00:1b 31195548  /prog2
  34. 09de8000-09e09000 rwxp 09de8000 00:00 0
  35. 40000000-40001000 r-xp 40000000 00:00 0          [vdso]
  36. 40001000-4000a000 rw-p 40001000 00:00 0
  37. 4001a000-4001c000 rw-p 4001a000 00:00 0
  38. 40100000-40121000 rw-p 40100000 00:00 0
  39. 40121000-40200000 ---p 40121000 00:00 0
  40. bfd64000-bfd7a000 rw-p bfd64000 00:00 0          [stack]
  41. make: *** [run] Aborted
  42.  
Nov 29 '07 #1
1 19396
RRick
463 Recognized Expert Contributor
These messages generally mean that the heap storage (i.e. malloc) has been corrupted.

Unfortunately, you won't get much information from the stack dump as to who or what caused this problem. Heap corruption is usually caused by a rogue pointer or buffer overwrite and shows up later in the program execution after the damage has been done.

Valgrind is a good memory checker for these types of problems.
Dec 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1240
by: Rob | last post by:
Hi I am getting the error *** glibc detected *** free(): invalid pointer: 0x083e20cc *** Aborted When I run the code <?php
27
31366
by: Deephay | last post by:
Greetings all, I have a program that used the realloc() function to change the allocated size of a buffer, the program works with some arguments, but with some other arguments, it will show me the error message like: *** glibc detected *** realloc(): invalid next size: 0x0804c3a8 *** and then I inserted a perror("realloc") to see what happend, it says that:
1
2930
by: mahiapkum | last post by:
hello all i have a code which looks fine when reviewed but when the application has a long run say for example of 2 days it gets exit, because of glibc error and the sample code is as follows: while (1) { if((kfp = kd_open(kd_filename, READ, NULL , INIT_YES))== NULL) { printf("%s: File not found ...\n", kd_filename); if (!forceflag) { sleep(5); ...
0
6535
by: shrik | last post by:
I have following error : Total giant files in replay configuration file are : File name : /new_file/prob1.rec Given file /new_file/prob1.rec is successfully verified. Splitting for giant file /new_file/prob1.rec started. Please wait.... In while loop of request searching *** glibc detected *** ./a.out: free(): invalid next size (normal): 0x099da890 *** ======= Backtrace: ========= /lib/libc.so.6
4
4390
by: shrik | last post by:
I have following error : Total giant files in replay configuration file are : File name : /new_file/prob1.rec Given file /new_file/prob1.rec is successfully verified. Splitting for giant file /new_file/prob1.rec started. Please wait.... In while loop of request searching *** glibc detected *** ./a.out: free(): invalid next size (normal): 0x099da890 *** ======= Backtrace: ========= /lib/libc.so.6
3
18739
by: Renzr | last post by:
I have a C++ package which works very well in the 32-bit Linux-like OS. However, it will lead to a "*** glibc detected *** ./ex2: munmap_chunk(): invalid pointer" in 64-bit (Fedora 7-64), when it delete a object generated by new operator. I really do not known why? And I need your help. Please tell me why and when this error should happen? So that I can fix my problem. :)
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8797
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8656
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.