Recent Posts

Pages: 1 [2] 3 4 5 6 7 ... 10
11
Help / Re: Malloc() / Heap issue with debug build target
« Last post by Krice on April 23, 2019, 10:42:02 pm »
That's an indication of memory corruption. It's quite easy to do with C using malloc etc. It just hides problems so easily. And the best part is that the actual problem may not even be in that part of the code.
12
Help / Re: Malloc() / Heap issue with debug build target
« Last post by oBFusCATed on April 23, 2019, 10:22:50 pm »
You are going to have to wait for an CB Debugging person. They will likely ask for a full debugging log.
If you want to get help you have to accomplish this.
Full log is enabled in Settings -> Debugger -> General -> Full (debug) log.
Then copy-paste the contents of the debugger tab in the log and others.
13
Help / Re: code::block will not open
« Last post by oBFusCATed on April 23, 2019, 10:20:45 pm »
The builds on the site doesn't work on ubuntu 18.xx...
14
Help / Re: Malloc() / Heap issue with debug build target
« Last post by Marnix on April 23, 2019, 09:22:21 pm »
Regarding the watch view, I have disabled it but I cannot delete the function arguments and local variables from it.

Before I continue, I'm not sure any more if this is a CB issue, so if any of the mods decide to close this thread, I'll regret it but the forum rules are clear.

I did some more testing and I see unpredictable behavior:

- if I declare one additional local variable in the function that calls the failing ReadString() it works.
- but if, additionaly to the extra declaration, I initialize the nr_of_lflags var it crashes again.

Below is the function code, see the 3 COMMENTS IN CAPS.


Code: [Select]
int32_t ReadFlags(int64_t offset)
{
  int32_t code        = NO_ID;
  int32_t com_loc_len = 0; /* Length of common location flags string.                                */
  int32_t com_obj_len = 0; /* Length of common object flags string.                                  */
                           /* Length of local flags string is a global variable for save() function. */

  int32_t nr_of_lflags;  /* IF I INITIALIZE THIS VAR THE EXTRA LOCAL DECLARATION HAS NO EFFECT */
  int i  = 0;

  int test = 0;  /* WITH THIS LINE IT WORKS, IF I REMOVE IT, OR INTIALIZE nr_of_lflags THE PROBLEM RETURNS */

  /* go to offset in datafile */
  if (fseek(datafile, offset, 0) == -1) {
    PrintError(16, NULL, "ReadFlags()");
    return(ERROR);
  }

  /* check for the keyword */
  if (!GetNextCode32(&code)) {
    PrintError(23, NULL, "keyword record");
    return(ERROR);
  }
  if (code != FLAGS) {
    PrintError(21, NULL, "flags");
    return(ERROR);
  }
  /* Read number of common flagbits.                  */
  /* We need the number for the SetBitVal() function. */
  if (!GetNextCode32(&nr_of_cflags)) {
    PrintError(23, NULL, "nr_of_cflags");
    return(ERROR);
  }

  /* calculate com_loc_len and com_obj_len. */
  com_loc_len = ((nr_of_cflags*nr_of_locs)/WORD_LEN)+1;
  com_obj_len = ((nr_of_cflags*nr_of_objs)/WORD_LEN)+1;

  /* Create space on heap for com_loc_flags. */
  if ((com_loc_flags = (int32_t *) malloc(com_loc_len*sizeof(int32_t))) == NULL) {
    PrintError(15, NULL, "ReadFlags()");
    return(ERROR);
  }

  /* Create space on heap for com_obj_flags. */
  if ((com_obj_flags = (int32_t *) malloc(com_obj_len*sizeof(int32_t))) == NULL) {
    PrintError(15, NULL, "ReadFlags()");
    return(ERROR);
  }

  /* Read the com_loc_flags. */
  if (fread((void *) com_loc_flags, sizeof(int32_t), com_loc_len, datafile)
      != com_loc_len) {
    PrintError(23, NULL, "common location flags");
    return(ERROR);
  }

  /* Read the com_obj_flags. */
  if (fread((void *) com_obj_flags, sizeof(int32_t), com_obj_len, datafile)
      != com_obj_len) {
    PrintError(23, NULL, "common object flags");
    return(ERROR);
  }

  /* Read length of local flagbits string.           */
  /* We don't need the actual number of local flags. */
  if (!GetNextCode32(&loc_flags_string_len)) {
    PrintError(23, NULL, "loc_flags_string_len");
    return(ERROR);
  }

  /* Create space on heap.             */
  if ((local_flags = (int32_t *) malloc(loc_flags_string_len*sizeof(int32_t))) == NULL) {
    PrintError(15, NULL, "ReadFlags()");
    return(ERROR);
  }

  /* read the information */
  if (fread((void *) local_flags, sizeof(int32_t), loc_flags_string_len, datafile)
      != loc_flags_string_len) {
    PrintError(23, NULL, "local flags");
    return(ERROR);
  }

  /* Check if we must read debug info */  /* @@ */
  if (debug) {
    /* check for the keyword */
    if (!GetNextCode32(&code)) {
      PrintError(23, NULL, "keyword record");
      return(ERROR);
    }
    if (code != DEBUG) {
      PrintError(21, NULL, "debug");
      return(ERROR);
    }

    /* Malloc() space for common flags debug info. */
    if ((com_flag_dbug = (debugInfo *) malloc(nr_of_cflags*sizeof(debugInfo))) == NULL) {
      PrintError(15, NULL, "common flags debug info");
      return(ERROR);
    }

    /* Malloc() space for local flags debug info. */
    if ((loc_flag_dbug = (debugInfo *) malloc(nr_of_lflags*sizeof(debugInfo))) == NULL) {
      PrintError(15, NULL, "local flags debug info");
      return(ERROR);
    }

    for (i=0; i<nr_of_cflags; i++) {
      if ( ((com_flag_dbug[i]).name = ReadString()) == NULL)
        return(ERROR);
    }
    /* read the number of local flags */
    /* is is only needed when we have debug info */
    if (!GetNextCode32(&nr_of_lflags)) {
      PrintError(23, NULL, "nr_of_lflags");
      return(ERROR);
    }
    for (i=0; i<nr_of_lflags; i++) {
      if ( ((loc_flag_dbug[i]).name = ReadString()) == NULL)    /* THIS rEADsTRING() CALL FAILS */
        return(ERROR);
      if (!GetNextCode32(&(loc_flag_dbug[i]).owner))
        return(ERROR);
    }
  }

  return(OK);
}
15
Help / Re: code::block will not open
« Last post by andrews825pc on April 23, 2019, 08:18:58 pm »
Hi thanks for writing me back. I'm using XUbuntu 18.04
I just went to downloads and I downloaded this codeblocks_17.12-1_amd64_stable.tar.xz and installed it though deb file.
when running in terminal just say it cant be found?

I got it working I used just this link and it works now :)
https://github.com/bluehazzard/codeblocks_sf/wiki/build_linux_mint_18
16
Help / Re: code::block will not open
« Last post by oBFusCATed on April 23, 2019, 08:12:35 pm »
What OS are you running? How have you installed C::B?
If you're on linux what happens if you open a terminal/console and try to start it from there?
17
Help / code::block will not open
« Last post by andrews825pc on April 23, 2019, 08:09:48 pm »
Hi, I'm new to code::block and I just installed it but when I go to my menu and development and click on code::block nothing happens, did I not install it right. Please help with this thank you very much :)
18
Plugins development / Re: [New plugin] cbSystemView for embedded development
« Last post by oBFusCATed on April 23, 2019, 07:07:00 pm »
The gdb from tdm I had also had these two executables and yes they probably use it to setup correct python environment. But this is not what CB expects and there are problems.
19
Plugins development / Re: [New plugin] cbSystemView for embedded development
« Last post by ollydbg on April 23, 2019, 04:49:23 pm »
On windows any gdb which supports python is setup to start two executables gdb and gdb_orig...
I think only GDB supplied from mingw-w64(original name is mingw-build) has such two gdb executables. I don't know why they need such changes, maybe they want to load the python pretty printer automatically by the proxy-gdb.

For me, I use GDB build myself, I don't use such proxy-gdb. ;)
20
Development / Re: C::B EOF?
« Last post by stahta01 on April 23, 2019, 04:35:12 pm »
So any chance to see the new CodeBlocks version this year? I mean that nightly build stuff is just something for hardcore CB users.

No, it is for people who wish to help this project improve.

Tim S.
Sorry but canīt completly agrre, itīs not enough to wish to do something, you need to have some skills in doing it and not everibody is familiar with that compiler, linker and build stuff.

So, you do not know enough to report bugs unless you are familiar with that compiler, linker and build stuff? I strongly disagree.

Tim S.
 
Pages: 1 [2] 3 4 5 6 7 ... 10