f



Invalid pointer - Munmap_chunk

Hi everyone,

I have some trouble using awk -- mawk.
When I use gawk, I got no problem.
But when I use mawk, I got some error :

*** glibc detected *** awk: munmap_chunk(): invalid pointer: 0x000000000061944c ***
And then a backtrace in /lib/libc.so at line 6 for awk.

Now, an explanation : I use a shell script to read about 1 million lines, and get some information. Lines are like : <ID> <num> xxxx xxxx <TYPE_INFO> <INFO> xxxxx...
So I use a 3-dimensional array in order to save <INFO> for each couple <ID, Num>, and then write them into a file. So, the array is like : array[ID, Num, type1] = "blabla", array[ID, Num, type2]="something else", etc with different ID and Num, of course.

I suppose I get an error due to the huge array created. Using gawk is working, until I get a too big array again, I guess. So, not a "real" solution.

Is there a way I can free memory for those array when I don't need it ? Or maybe I'm doing something wrong -- very likely :(

Well, I hope it's understandable... I can put an exemple of my code if needed (reading myFileIn)

awk -v FILE_OUT=$myFileOut'
  BEGIN {
    # reading from another file
  }
  {
    attributs=$6
    for (i = 7; i <= NF; ++i) # we get all the data
      attributs=attributs" "$i
    nb = split(attributs, tab, "|") # args are separated by "|"
   
    if ($5 == "THIS") {
      myTab[$1, $2, 1] = tab(9)
      myTab[$1, $2, 2] = tab(10)
    }
    else if ($5 == "THAT") {
      myTab[$1, $2, 3] = tab(2)
      myTab[$1, $2, 4] = tab(6)
      myTab[$1, $2, 5] = tab(7)
    }
    else if ($5 == "FINALLY") {
      write_file($1, $2)
    }
  }
  END {
  }
  
  function write_file(id, num) {
    printf "%3.3s%.7d%5.5s%5.5s%.2d%4.4s\n",
      myTab[id, num, 1],
      myTab[id, num, 2],
      myTab[id, num, 3],
      myTab[id, num, 4],
      myTab[id, num, 5] >> FILE_OUT
  }
' myFileIn
  

I use more field in my array, but the semantic is the same.
Thanks for your help... 

Regards,

Robin
0
robin
10/22/2013 12:55:06 PM
comp.lang.awk 3450 articles. 0 followers. Post Follow

7 Replies
854 Views

Similar Articles

[PageSpeed] 48

In article <81e17b26-02d8-4b8b-a3d7-1c4e7df6e19d@googlegroups.com>,
 <robin.geffroy@gmail.com> wrote:
>Hi everyone,
>
>I have some trouble using awk -- mawk.
>When I use gawk, I got no problem.
>But when I use mawk, I got some error :
>
>*** glibc detected *** awk: munmap_chunk(): invalid pointer: 0x000000000061944c ***
>And then a backtrace in /lib/libc.so at line 6 for awk.

Well, the error message probably doesn't matter much or mean anything
(unless you a Mawk developer).  It just means (as you've correctly deduced)
"too much array storage".

One thing I don't completely understand from your description is whether or
not gawk really does solve your problem.  Above you say that you "get no
problem", but then below you write:

    I suppose I get an error due to the huge array created. Using gawk is
    working, until I get a too big array again, I guess. So, not a "real"
    solution.

(See P.S. below)

>Now, an explanation : I use a shell script to read about 1 million lines, and get
>some information. Lines are like : <ID> <num> xxxx xxxx <TYPE_INFO> <INFO>
>xxxxx...

Anyway, if my analysis of your code is correct, then it looks like your
code logic is:

read a record
do some processing
write out the results
repeat

and there is no need for any inter-record storage.  I.e., each record's
results don't depend on any other record's results.  So, you don't need to
accumulate a big array.  In that case, there are two ways to go about
eliminating the large array:

    1) Start each loop with "delete bigarray".  That will clean out any old
	results and prevent the array from growing incrementally.

    2) Re-write the code so that it doesn't create the array in the first
	place.  Generally, if you don't need inter-record storage, you
	don't need an array like this.  I leave the details of this
	re-analysis/re-write to you.

P.S., a side question/comment: I'm actually surprised that you did have a
problem with gawk.  My understanding was that gawk was not supposed to have
limits like this.  I know that sounds "fantastic" and, of course, all
software has limits, but still, I hope those who are familiar with gawk and
its design goals will see what I mean here.  Out of curiosity, what
platform (DOS, Windows, Unix, Linux, Mac OSX, ...) are you running on?

-- 

Some of the more common characteristics of Asperger syndrome include: 

* Inability to think in abstract ways (eg: puns, jokes, sarcasm, etc)
* Difficulties in empathising with others
* Problems with understanding another person's point of view
* Hampered conversational ability
* Problems with controlling feelings such as anger, depression 
    and anxiety
* Adherence to routines and schedules, and stress if expected routine 
    is disrupted
* Inability to manage appropriate social conduct
* Delayed understanding of sexual codes of conduct
* A narrow field of interests. For example a person with Asperger 
    syndrome may focus on learning all there is to know about 
    baseball statistics, politics or television shows.
* Anger and aggression when things do not happen as they want
* Sensitivity to criticism
* Eccentricity
* Behaviour varies from mildly unusual to quite aggressive 
    and difficult

0
gazelle
10/22/2013 1:14:22 PM
Thanks for your answer.=20

First, for gawk : it DOES solve the problem, but I'm afraid the problem can=
 appear again, if a get a huger array with huger files... That's the only r=
eason I said it was not a "real" solution, sorry for the misunderstanding :=
) (I didn't got the problem even with 10m lines file for now, but who knows=
, maybe it will happen again...)
FYI, I'm using Debian / Linux 2.6 (64 bits). (with a ssh connection)

For your analysis, it's not totally exact. Actually my lines are more like =
that :
<ID_1> <num_1> xxxx xxxx <TYPE_INFO> <INFO> xxxxx
<ID_2> <num_2> xxxx xxxx <TYPE_INFO> <INFO> xxxxx
<ID_1> <num_2> xxxx xxxx <TYPE_INFO> <INFO> xxxxx
<ID_3> <num_1> xxxx xxxx <TYPE_INFO> <INFO> xxxxx
<ID_2> <num_1> xxxx xxxx <TYPE_INFO> <INFO> xxxxx
....


And I neither know how much "num" I have to read, nor I know how much "ID" =
I have to.
That's why I'm using an array : I store data related to "ID_1" into an arra=
y, and when I get a line like "ID_1 num_x xxx xxx <type> <MY_FINAL_INFO>", =
I write the content of my array in a file.

Thus, I can't delete my array at the beginning of each loop. I could delete=
 it (field by field) after I wrote it into the file.

Maybe there is a way to do that without any array (or maybe without a=20
3-dimensional array, which would be less memory-consuming), but I didn't fi=
nd it (yet ? )

Regards,

Robin
0
robin
10/22/2013 1:28:36 PM
In article <19b91627-db63-40ae-ab27-bce3f6283658@googlegroups.com>,
 <robin.geffroy@gmail.com> wrote:
....
>Maybe there is a way to do that without any array (or maybe without a 
>3-dimensional array, which would be less memory-consuming), but I didn't
>find it (yet ? )

Comments:
    1) Is there any particular reason why you *want* to use Mawk (rather
	than Gawk) ?  Note that I am not saying there isn't; there may very
	well be good reasons to do so.  Among them the fact that in some
	Debian distros, the default AWK is Mawk not Gawk.  Mistakenly so,
	IMHO.
    2) If you're in a hurry, I'd say just go with GAWK.  In this modern
	world, a millions lines of input isn't really that big.  If/when
	you do try it on 10,000,000 lines of input and it fails, then you
	can consider the next point.
    3) If you are using (or can use) Gawk 4.x (or later), then you can use
	the new (true) multi-dimensional arrays, so you could delete things
	you don't need once you've written them.  I.e., what I have in mind
	is modifying your write_file() routine so it looks something like:

	write_file() {
	    do stuff with myTab[a][b][c]
	    delete myTab[a]
	    }

	That should delete everything in the array that has 'a' as its
	first subscript, while leaving everything else intact.

-- 
(This discussion group is about C, ...)

Wrong.  It is only OCCASIONALLY a discussion group
about C; mostly, like most "discussion" groups, it is
off-topic Rorsharch [sic] revelations of the childhood
traumas of the participants...

0
gazelle
10/22/2013 4:27:57 PM
In article <l45tne$nf5$1@news.xmission.com>,
Kenny McCormack <gazelle@shell.xmission.com> wrote:
>P.S., a side question/comment: I'm actually surprised that you did have a
>problem with gawk.

He didn't, which you probably know by now.

> My understanding was that gawk was not supposed to have limits like this.

Indeed, that is true.  "No arbitrary limits" is one of the major
principles behind GNU software. To my knowledge gawk is only limited by
what the operating system will let it allocate.

> I know that sounds "fantastic" and, of course, all software has limits,
> but still, I hope those who are familiar with gawk and its design goals
> will see what I mean here.

There are limits, of course.  But they are imposed by the OS
and/or compiler and/or system architecture.

Arnold
-- 
Aharon (Arnold) Robbins 			arnold AT skeeve DOT com
P.O. Box 354		Home Phone: +972 8 979-0381
Nof Ayalon
D.N. Shimshon 9978500	ISRAEL
0
arnold
10/22/2013 5:46:02 PM
Hi.

In article <19b91627-db63-40ae-ab27-bce3f6283658@googlegroups.com>,
 <robin.geffroy@gmail.com> wrote:
>First, for gawk : it DOES solve the problem, but I'm afraid the problem
>can appear again, if a get a huger array with huger files... That's the
>only reason I said it was not a "real" solution,

See the note that I just posted. On a 64-bit system with modern OS
(GNU/Linux, other Unix, 64-bit Windows [if gawk was compiled in 64 bit
mode]) the limits are so large that you really should not have to worry
about this.

If you can use gawk, you probably should.

Thanks,

Arnold
-- 
Aharon (Arnold) Robbins 			arnold AT skeeve DOT com
P.O. Box 354		Home Phone: +972 8 979-0381
Nof Ayalon
D.N. Shimshon 9978500	ISRAEL
0
arnold
10/22/2013 5:48:18 PM
Well, thanks to all of you :)

Kenny, there is no reason I want to use mawk. I was just wondering if there=
 were a way to make things "cleaner".
I can use Gawk without any problem, and I will. But, as you said, default a=
wk on this machine is Mawk and not Gawk. I just wanted to use "awk" (-> maw=
k) in order not to change the script relative to others (there's a bunch of=
 script like mine, using "awk" and not "gawk", that's it. But those scripts=
 are less complexe, thus don't need gawk...)

I didn't know I can use multi-dimensionnal arrays like that. I'll take a lo=
ok at that :)

Anyway, subject close, that's fine for me, thanks to you :)

Regards,

Robin
0
robin
10/23/2013 9:08:13 AM
In article <c847d792-38d5-4e19-80e9-8d27557fc093@googlegroups.com>,
 <robin.geffroy@gmail.com> wrote:
>Well, thanks to all of you :)
>
>Kenny, there is no reason I want to use mawk. I was just wondering if there were
>a way to make things "cleaner".
>I can use Gawk without any problem, and I will. But, as you said, default awk on
>this machine is Mawk and not Gawk. I just wanted to use "awk" (-> mawk) in order
>not to change the script relative to others (there's a bunch of script like mine,
>using "awk" and not "gawk", that's it. But those scripts are less complexe, thus
>don't need gawk...)
>
>I didn't know I can use multi-dimensionnal arrays like that. I'll take a look at that :)
>
>Anyway, subject close, that's fine for me, thanks to you :)
>
>Regards,
>
>Robin

Great!  Sounds like everything is under control.

The net at its best...

-- 
"They shall be attended by boys graced with eternal youth, who to the
beholder?s eyes will seem like sprinkled pearls.  When you gaze  upon that
scene, you will behold a kingdom blissful and glorious."

--- Qur'an 76:19 ---
0
gazelle
10/23/2013 12:25:22 PM
Reply:

Similar Artilces:

Pointers, pointers, pointers.......
Hi group. Asking again some help to better understand the basic principles of RPL.... In RPLMAN they say: >>>In the most general definition of RPL, I is an object pointer >>>pointing to a composite object that is the top of a stack of >>>composite objects called the runstream. >>>R points to the rest of the runstream stack. What is really meant by *the rest of the runstream* ? Is R pointing to the object right after the one pointed by I? Is R pointing to the rest of the stack *as a whole* (how's it possible?) Anything else I didn't catch? >>...

pointers, pointers, pointers...
Hi There, I came up with following sample code to demonstrate my issue: #include <18F87K22.h> #device HIGH_INTS=TRUE, adc=16, ICD=TRUE #fuses NOWDT //No Watch Dog Timer #fuses WDT128 //Watch Dog Timer uses 1:128 #fuses HSM //Hi-Speed crystal oscillator #fuses NOBROWNOUT //No brownout reset #fuses NOPLLEN //No PLL enabled #fuses BBSIZ1K //1K words Boot Block size #fuses NOXINST //Extended set extension and Indexed typedef struct{ int8 foo, test; } Th...

pointer-to-pointer (invalid lvalue in unary `&)
i'm doing some Linux Kernel hacking for a course i'm currently taking. there is a pointer to a struct (struct example_struct *ex_ptr) in a .c that i want to access in a system call. i defined a pointer to a pointer in the .c: extern struct example_struct **pointer; and somewhere in the code i tried: pointer = &ex_ptr; and i get this error when trying to compile the kernel: invalid lvalue in unary `&' and it points to the line: pointer = &ex_ptr;....any idea why and what i should do to fix it? On 3 Apr 2004 09:49:41 -0800, lmachado@eden.rutgers.edu (Lucas Machado)...

Pointer to pointer or reference to pointer
The way I understand it Reference To pointer as function parameter eg. void RP(int *&rpMem) {} rpMem is actually an alias for the pointer outside the function right? So I would access it exactly with the same syntax just like outside pointer right? e.g. void RP(int &*rpMem) { *rpMem = 125; rpMem++; } int Mem = 123; int *pMem = &Mem; // pMem = for example 5000 *pMem = 124; // Mem = 124; RP(pMem); // Mem = 125, pMem = 5004 Is the above correct? A <a@a.a> wrote: > e.g. > > void RP(int &*rpMem) > { > *rpMem = 125; > rpMem++; &g...

pointer vs pointer to pointer
AIM: To write a queue with 3 operations. WHAT I GOT: It works PROBLEM: Have a question: Why do "pointer to pointer" in enqueue() and "a pointer" to deleteElement() both work fine ? Will enqueue() work fine if I pass just "a pointer" to it ? Will deleteElement() work fine if I pass "pointer to pointer" ? /* A queue implementataion with the operations that I need: * (1) Add element to the front of the queue * (2) remove an element with a unique ID (string constant) * (3) compare 2 elements (string comparison) * (4) print queue * ...

Matlab, pointers and pointers to pointers
Matlab stores matrices using simple pointers in order to allocate memory. Using pointers to pointers, according to my experience, we could obtain the following benefits: - code would run faster (I think up to 70%) - memory would be allocated in a better way Why this solution is not used? There are some limitations? Luigi Luigi: <SNIP longing for pointers - not to heaven - to memory... > Why this solution is not used? There are some limitations... <luigi> a fact of life that we all have to live with: it IS just NOT happening... -or- at least it is not happening since 1984... d...

Pointer-to-pointer-to-pointer question
The code example below shows the dynamic allocation of a 2D array. I must admit that it took quite a while for me to get there (I already have another posting to that effect), but I am glad that I finally got it working. Now here's the problem: I am able to get the 2D array dynamically allocated correctly as long as I am doing it "in-line" (i.e. without invoking any function). The moment I try to do it in another function, I get a core dump. Any help will be appreciated. Since this function is expected to update a pointer-to-pointer type, I am actually passing the pointer-...

Pointer to Pointer or not?
Hi I am creating my own Queue class to learn about Queues and pointers. I have come across a question of two styles and I don't know if there are any dangers associated with them. I coded my remove function as follows template <class T> bool adsQ<T>::Remove(T* theData) { Qnode<T>* removeNode = 0; if (true == isEmpty()) { //cout << "False" << endl; return false; } else { /* What I am trying to achive here is to change the data pointed to by theData to the data pointed to by pData.*/ *theData =*(pHead->pData); //Data exchan...

pointer of pointer
Hello, I have to make an array which size of the lines depends of the line. I am sure I am not clear so here is an exemple of what I mean : a is an array of n lines each line contain a different number of elements I have tried to implement something like this a=PTRARR(n) FOR i=0,n-1 DO BEGIN a(i)=Ptr_New ENDFOR First I am not sure it is the best way to compute this, second if yes I don't how to implemente the value of the "a(i,j)" element. If somebody can help me... Best regards, Claire Hey Claire, If you absolutely must have each element of "a" be an array...

pointer to a pointer
My situation: I have a function that takes a pointer to an FSref as an argument. In the body of the function is a function call that also takes a pointer to an FSRef. I need to pass my original FSRef, but since I have only a pointer to it, I am assuming I need to dereference it twice when I call the second function. However, using something like &&myFSRef in the second function doesn't work. Can anyone tell me the proper way to do this? Thanks. In article <1105802448.cd52b3255e6c95476ce23f7be215a6a3@teranews>, Steven Daedelus <sdaedelus@ira.gov> w...

More on pointers to pointers.
I suspect I'm missing a broader concept here. Okay, given the following code: #include <stdio.h> int main(void) { char *ptr[] = {"Garbage", "test", "work"}; char **arg; arg = ptr; printf("The string is: %s\n", ptr[1]); return 0; } Why am I not allowed to do something like: arg = &ptr; ? I guess even more to the point, why is this legal? arg = &(*ptr) ; Chad Chad said: > I suspect I'm missing a broader concept here. Okay, given the following > code: > > #include <stdio.h> > > in...

pointer to pointer
hi could someone tell me a good website that explains pointer to pointers well. Not just simple stuff like 2d arrays passing , or pointing to another int variab.le jagguy wrote: > hi > could someone tell me a good website that explains pointer to pointers well. > Not just simple stuff like 2d arrays passing , or pointing to another int > variab.le > > Not sure that there is one - how hard can it be really. *p returns a reference to whatever p points to. If p points to a pointer, **p returns a reference to whatever that pointer points to. There's one for func...

pointers to pointers
Hi, i understood what pointers are and all stuff, and now i'm at the part with pointers to pointers and my book doesn't really help on this issue. let be: int a,*p,**q; how to make use of **q,*q and q ? Which who's address and/or who's value contains. I would like some examples like p=&a;// p contains the address of a and *p contains it's value but regarding **q,*q respectively q. Thanks. apropo wrote: > Hi, > i understood what pointers are and all stuff, and now i'm at the part > with pointers to pointers and my book doesn't really help on...

pointer to pointer
I have only used pointer to a pointer while manipulating arrays of arrays. I have not seen any C++ libraries that use pointer to a pointer as a function parameter. But I have seen it used in COM. If we want the function to create a new object and allow the passed in pointer to point to the object created we can pass a pointer to the reference. Is there anything special about COM that it needs pointer to a pointer. Is this becuase that COM can be used from C as well and we don't have references in C. In what other circumstances pointer to pointer can be used. Why don't we never see poi...

Pointers pointers.
I thought I could assign an array of chars to a pointer to pointer. However, when I do the following: #include <stdio.h> int main(void) { char buff[] ="test"; char **output = &buff; return 0; } I get: $gcc -g ptr.c -o ptr ptr.c: In function `main': ptr.c:5: warning: initialization from incompatible pointer type What am I doing wrong here? Chad Chad wrote: > I thought I could assign an array of chars to a pointer to pointer. > However, when I do > the following: > > #include <stdio.h> > > int main(void) { > char buf...

Pointers to pointers
How can you use a "pointer to a pointer" as a two dimensional array using 'new' and 'delete' rather than 'malloc' and 'free'? Thanks, Jonas Jonas Cord wrote: > How can you use a "pointer to a pointer" as a two dimensional array > using 'new' and 'delete' rather than 'malloc' and 'free'? Pretty much the same. int main() { int** data; data = new int*[100]; for (int i = 0; i < 100; ++i) data[i] = new int[100]; //use it for (int i = 0; i < 100; ++i) delete []...

Pointers for these pointers...?
Hi Everyone: I'm trying to develop a property list to include as metadata about my object classes. i.e. I want each class I'm developing to include a PropertyList which will contain ObjectProperty pointers. ObjectProperty is a class containing the typeid.name() of a type as it's ObjectType as well as an ObjectName and ObjectDescription. Basically 3 strings of metadata describing each of a class' member variables (and hopefully functions) so that the class can report to a query from another class what properties it has available for access at run time. Here is what I have and t...

pointer to pointer
Its just a very simple and basic program to learn exactly what is described in comments here. Can you provide a better (and short) exercise ? /* A program to learn how to use a pointer to a pointer. Here we take an array of char pointers. A char* in the array, of course, points * to some char. Array has only one element. We change the value of char pointed by array's element using a function. * * VERSION 0.0 */ #include <stdio.h> void replace_char_value(char* [], char); int main(void) { char* arrc[2] = {0}; char c = 'c'; arrc[0] = &c;...

pointer of pointer
Hi I have a structure, B_t is another structure typedef struct{ int len; unsigned char code[12]; B_t *b; }A_t Now I need to pass A_t into a function to evaluate I use pointer of pointer void evaluate(A_t **a) My question is how to evaluate the component of this structure (*a)->b??? seems not right Thanks a lot! <qianz99@gmail.com> wrote in message news:1178915812.306611.242380@y80g2000hsf.googlegroups.com... > Hi > > I have a structure, B_t is another structure > > typedef struct{ > int len; > unsigned char code[12]; > B_t *b; > }A_t > >...

Pointer to pointer Vs References to Pointer
Q . When to use use pointer-to-pointer and reference-to-pointer to modify a pointer passed to a function ? According to me Which is better : double pointers OR Reference to Pointer ? There is no clear advantage and depends on programmer =91s choice or habit . As Nilesh mentioned =94 Reference to pointer=94 makes code easy But Pointer to pointer makes code easy to understand. So one can use any one . Why Pointer to Pointer is generally used ? 1. Pointer to pointer can be used in C and C++ but reference to pointer is limited to C++. a. Generally people start learning programming from C . So they get used to pointer to pointer. b.Pointer to Pointer usage makes project porting in C or C++ easy. 2. Generally libraries uses pointer to pointer approach like COM uses pointer to pointer for CoCreateInstance or QueryInterface. Fourm : Could you please let me know if these are the only reasons or i am missing something? Thanks Vikrant Example #include "stdafx.h" void Ref2Poi(int * &p) { *p =3D 10; } void Poi2Poi( int ** p) { **p =3D 10; } int _tmain(int argc, _TCHAR* argv[]) { int i =3D 13; int j =3D 14; int *p =3D &i; int *q =3D &j; Ref2Poi(p); Poi2Poi(&q); return 0; } "bansalvikrant@gmail.com" <bansalvikrant@gmail.com> writes: > Q . When to use use pointer-to-pointer and reference-to-pointer to > modify a pointer passed to a function ? &g...

Pointer to a pointer to a pointer to a member function
Hi, I'm having a problem compiling the following snippet with MSVC++ 7.1 and I'm not sure if it is a compiler bug? (or I am being stupid) struct Vector3 { float x, y, z; }; void blah() { static Vector3 (Vector3::*function)(float); static Vector3 (Vector3::**_function)(float) = &function; /*static*/ Vector3 (Vector3::***__function)(float) = &_function; *__function = &function; } If I uncomment the 'static' qualifier it then compiles fine? (Or if I change the return type of the function pointers to an atomic type such as &#...

pointer to an array vs pointer to pointer
Consider the following program x.c: #include <stdlib.h> #include <stdio.h> int main() { int x[10]; int **pp = &x; pp = NULL; // just to get rid of compiler warning. return EXIT_SUCCESS; } When I compile this program under gcc 3.4.3 as gcc -std=c99 -pedantic -Wall -Wextra x.c it merely generates the warning x.c: In function `main': x.c:7: warning: initialization from incompatible pointer type I thought the line int **pp = &x; is in error because of different pointer types involved in the assignment - '&x' is a point...

Invalid instruction pointer
I have been working on a problem with an installed product for approximately a year now. After much investigation including careful review of the code and repeat of ANSI hardware testing, we have been unable to recreate the problem in house. However, through analysis of the symptoms we have come to believe that something is causing the instruction pointer in this embedded application to be pointed to the wrong code address. My question is what external events can affect a microprocessor in such a way that it essentially gets "lost" in execution? We are reasonably certain that an ...

Invalid pointer dereference, or not?
Hi all, I was quite baffled to see this (simplified) program run without segfaults, and without valgrind complaining about invalid memory reads. <code> #include <iostream> using namespace std; class A { public: A() { cout << "A()" << endl; } ~A() { cout << "~A()" << endl; } void print() const { cout << "Hello World" << endl; } }; int main() { A* a; a->print(); // Should segfault, shouldn't it? a = new A(); a->print(); delete a; a->print(); // Should segfault, shouldn't it? ...

Invalid pointer operation
I get the error message on this line of the FormClose: BudgetsList.Free; This is an TObjectList which is so declared (together with the TMonthly class whose instances then are added to the list): var BudgetsList: TObjectList; oMonthly: TMonthly; It is used as follows:: BudgetsList:= TObjectList.Create(true); do while .... oMonthly:= TMonthly.Create(...); BudgetsList.Add(oMonthly); end; As soon as I close the form I get the Invalid pointer operation error; I insist in closing the form and after two or three attempts it closes.Any idea ? Stark wro...

Web resources about - Invalid pointer - Munmap_chunk - comp.lang.awk

Resources last updated: 3/7/2016 12:37:23 AM