Liste des Groupes | Revenir à co vms |
On 2025-06-05, Arne Vajhøj <arne@vajhoej.dk> wrote:$ mmk cleanOn 6/5/2025 10:55 AM, Arne Vajhøj wrote:Does this _exact_ code work on Alpha ?Updates fail with:>
>
TDS DBLIB error: Unable to allocate sufficient memory
TDS OS error: error 0
TDS error in dbcmd
>
But I suspect that is a bug in my code.
Mysterious.
>
stat = dbfcmd(con, "INSERT INTO t1 VALUES(%d, '%s')", f1, f2esc);
>
fails.
>
char buf[1000];
sprintf(buf, "INSERT INTO t1 VALUES(%d, '%s')", f1, f2esc);
stat = dbcmd(con, buf);
>
works.
>
And DBLIB.C contains:
>
RETCODE
dbfcmd(DBPROCESS * dbproc, const char *fmt, ...)
{
va_list ap;
char *s;
int len;
RETCODE ret;
>
tdsdump_log(TDS_DBG_FUNC, "dbfcmd(%p, %s, ...)\n", dbproc, fmt);
CHECK_CONN(FAIL);
CHECK_NULP(fmt, "dbfcmd", 2, FAIL);
>
va_start(ap, fmt);
len = vasprintf(&s, fmt, ap);
va_end(ap);
>
if (len < 0) {
dbperror(dbproc, SYBEMEM, errno);
return FAIL;
}
>
ret = dbcmd(dbproc, s);
free(s);
>
return ret;
}
>
????
>
If yes, try building your test code with compiler optimisation disabled.
If that doesn't work, try building the library itself with compiler
optimisation disabled.
32-bit or 64-bit build ?It's the traditional DEC C compiler interface, so all the pointers would
Any compiler build warnings either in the library or your test code ?
(Try setting warnings to fatal to abort the build if you get a lot of
output during building).
I am trying to eliminate the possibility you may have stumbled across
a compiler bug.
Simon.
Les messages affichés proviennent d'usenet.