Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8726213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:12:14+00:00 2026-06-13T08:12:14+00:00

I have to create program, which is able to generate a GML file. For

  • 0

I have to create program, which is able to generate a GML file.

For this purpose I implemented a function GetEdges, this functions should returns three arrays (call by reference).

The signature of the function looks like:

bool GetEdges(DG_NODE_ID **sourceIds, DG_NODE_ID **destIds, int **weights, int *count)

Within the function I want to malloc space:

*sourceIds = (DG_NODE_ID *) malloc(cntEdges * sizeof (DG_NODE_ID));

As soon as I use 4 nodes i get following output:

graph: malloc.c:2451: sYSMALLOc: Assertion `(old_top == (((mbinptr)
(((char *) &((av)->bins[((1) – 1) * 2])) – __builtin_offsetof (struct
malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size)

= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) – 1)) & ~((2 * (sizeof(size_t)))
– 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)’ failed.

I tried everything and I do not have any clue why this fails after I use 4 nodes.

I uploaded the whole source code: Download – Source code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:12:15+00:00Added an answer on June 13, 2026 at 8:12 am

    It most probably means you are abusing the memory that is allocated by:

    1. Writing before the start of what you were allocated (uncommon).
    2. Writing after the end of what you were allocated (common).
    3. Freeing something that wasn’t previously allocated (uncommon).
    4. Writing to previously allocated space after it was freed (common).

    Do you have valgrind? If so, use it. If not, get it and use it if at all possible. (It’s available for many Unix-like systems; it is not available for Windows AFAIK.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to create a simple program with Python which uses OpenCV
I have a project to create a program, which prevents the user from escaping
I have created a concurrent, recursive directory traversal and file processing program, which sometimes
I have an application which needs to be able to create folders in UAC-protected
I have a program, which uses quickreports 5 to generate some reports. The program
I have created a program which allows me to upload images to my server.
I have a program which creates JButtons which are then added to a JPanel
I have to create a tester program for a C project (codetester.c). The user
I have to create a cipher program that shifts the letters of a message
For a school assignment I have to create a C++ program that will create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.