[PATCH] EXC_BAD_ACCESS in SC_execute

Поиск
Список
Период
Сортировка
От Jade Koskela
Тема [PATCH] EXC_BAD_ACCESS in SC_execute
Дата
Msg-id CAN5Zvqw5M--vSJyrYEoxRx8i=QZJ5pe9csZzfyC_e5EXXTQbqA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] EXC_BAD_ACCESS in SC_execute  ("Inoue, Hiroshi" <inoue@tpf.co.jp>)
Список pgsql-odbc
Hello,

I am looking into dmp files which we collect when our application crashes. Using google breakpad/stackwalking I am generating the stacktrace. The crash looks like this:

Crash reason:  EXC_BAD_ACCESS / 0x0000000d
Crash address: 0x0

Thread 10 (crashed)
 0  psqlodbcw.so!SC_Execute    + 0x10bd

I couldn't get the source line so I had to dig through the assembly.
I was able to determine the error is happening on line statement.c line 2191 (from the latest version in the repository).

numcols = QR_NumResultCols(tres);
   (this expands to)
numcols = tres->fields->num_fields  

The crash happens on the dereference of fields. It could be a null pointer, I'm not sure because I can't reproduce the error.
Apparently EXC_BAD_ACCESS can be SIGSEGV or SIGBUS.
I have generated a patch to handle the null pointer case.
Вложения

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: psqlodbc build with libpq on OS X
Следующее
От: Jade Koskela
Дата:
Сообщение: debugging symbols