Re: [Dbi-interbase-devel] Bug hunting, Nailed it...
Status: Beta
Brought to you by:
edpratomo
From: Edwin P. <ed....@co...> - 2000-10-06 10:45:28
|
Flemming Frandsen wrote: > > Ok, I managed to get a stacktrace out of the dying apache and I've been > tinkering with it a bit tonight, the short story is: > > I found the bug and iced it (yay!). > > The sqlda needs to be zeroed before using it: > (hint: the memset line is new) > > #define IB_alloc_sqlda(sqlda, n) \ > { \ > short len = n; \ > if (sqlda) { \ > safefree(sqlda);sqlda = NULL; \ > } \ > if (!(sqlda = (XSQLDA*) safemalloc(XSQLDA_LENGTH(len)))) { \ > do_error(sth, 2, "Fail to allocate XSQLDA"); \ > } \ > memset(sqlda,0,XSQLDA_LENGTH(len)); \ Thanks, Flemming. Changes have been committed. > Ed: Could you *please* change the mailing list settings to "reply to > list"? I'd like to, but I don't know how. The project admin always lead me to http://lists.sourceforge.net/mailman/admin/dbi-interbase-devel where I am supposed to enter a password, which is not the same as my sourceforge's password. And as I remember, I've never set any password for the mailman :-( > > BTW is there ANY good reason for this to be a macro in stead of a > function? There's no special reason. One can write a function which accepts the address of sqlda and does the same thing. And there's still the ordinary reason, macro is faster because there's no stack operation such that in function. Rgds, Edwin. |