Re: BUG #15229: Crash when using PQgetvalue

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15229: Crash when using PQgetvalue
Дата
Msg-id 30331.1528131355@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #15229: Crash when using PQgetvalue  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #15229: Crash when using PQgetvalue  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> I am getting a segmentation fault in the below code when attempting to use
> PQgetvalue. I am not 100 percent this is a bug and not a problem on my end
> but I have done a lot of debugging and not found an answer.

Strange.  Your code looks fine by eye, and just to be sure I
copied-and-pasted it and ran it here.  No problems.

A couple of theories that could maybe account for the facts are

(1) corrupted copy of libpq.dll ... where did you get that from?

(2) somewhere earlier in your program, there are macro definitions
causing misinterpretation of rows/cols/PQgetvalue.

PQgetvalue does range-check its arguments, so it's hard to see how it
could crash internally, but maybe somehow it's handing back a NULL and
that's crashing printf?

Another idea is that if PQgetvalue does somehow think the arguments
are out of range, it will try to print a warning to stderr, and
I'v heard of that crashing on Windows.  We'd still be left trying
to explain why it thinks the arguments are out of range, but that
would narrow down the problem.

Can you get a stack trace to identify exactly where the crash is?

            regards, tom lane


В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15229: Crash when using PQgetvalue
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: JDBC Driver42.2.2 throws error when dealing with money datatype