Olivier Daudel wrote: > Hello Dave, > > I think sig -g is quite OK. > I have a problem with foreach sig -g. > If i use malloc() and free(), it seems to work (may be the algorithmic is > OK). > I have tryed to use hashing on tgid to control if we have already displayed > it. > If i use GETBUF() and FREEBUF(), it crashes. > May be i don't understant some conditions in using GETBUF() and FREEBUF() ? > > Thanks for any suggestion. Hi Olivier, Thanks for the update -- I'll take a look at the patch. I don't understand off-hand why it would crash with GETBUF()/FREEBUF(). Using malloc/free for temporary buffers has always been a potential problem because the command can be interrupted mid-stream, and when that happens, it longjmp()'s back to the main loop, and the memory is leaked. GETBUF() is preferred over the malloc() of temporary per-command buffers because even if you forget to do the FREEBUF(), it will be called automatically prior to the next command. In other words, the buffer returned from any GETBUF() call can only be used for a single command, because the buffer(s) will be subsequently freed in restore_sanity(), which is executed just prior to the next command line being accessed. Anyway, I'll take in your sig command changes, and see what I can do about the foreach part. Thanks again, Dave > > > ------------------------------------------------------------------------------------------------------------------------ > Name: sig.patch > sig.patch Type: unspecified type (application/octet-stream) > Encoding: quoted-printable > > ------------------------------------------------------------------------------------------------------------------------ > -- > Crash-utility mailing list > Crash-utility@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/crash-utility -- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility