You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the attached dataset COASTS.gdb.zip, FileGDB_API-RHEL7-64gcc83 crashes on the following test program (adapted from samples/Querying/Querying.cpp) during the second iteration on EnumRows::Next(), if Table::Search() requests the binary field SE_ANNO_CAD_DATA
test_fgdb.cpp:
#include<string>
#include<iostream>
#include<fstream>
#include<FileGDBAPI.h>usingnamespacestd;usingnamespaceFileGDBAPI;intmain()
{
// Open the geodatabase.
fgdbError hr;
wstring errorText;
Geodatabase geodatabase;
if ((hr = OpenGeodatabase(L"COASTS.gdb", geodatabase)) != S_OK)
{
wcout << "An error occurred while opening the geodatabase." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
// Open the COAST_PROTECTION_STRUCT_LINE table.
Table table;
if ((hr = geodatabase.OpenTable(L"COAST_PROTECTION_STRUCT_LINE", table)) != S_OK)
{
wcout << "An error occurred while opening the table." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
// Query
EnumRows attrQueryRows;
// Will crash on Next() iterations// Crashes on second Next() iteration if requesting the binary field SE_ANNO_CAD_DATA:
wstring columns = L"OBJECTID, ASSET_ID, SE_ANNO_CAD_DATA";
// Works fine if not requesting SE_ANNO_CAD_DATA:// wstring columns = L"OBJECTID, ASSET_ID, STRUCTURE_TYPE, CONSTRUCTION, LAST_MODIFIED, Shape_Length";if ((hr = table.Search(columns, L"", true, attrQueryRows)) != S_OK)
{
wcout << "An error occurred while performing the attribute query." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
// Iterate through the returned rows.
Row attrQueryRow;
// First iteration works, crash on secondwhile (attrQueryRows.Next(attrQueryRow) == S_OK)
{
int assetId;
attrQueryRow.GetInteger(L"ASSET_ID", assetId);
int objectId;
attrQueryRow.GetOID(objectId);
wcout << objectId << "," << assetId << endl;
}
attrQueryRows.Close(); // Close the EnumRowsreturn0;
}
Thread 1 "test_fgdb" received signal SIGSEGV, Segmentation fault.
0x00007ffff6ee39c0 in SqlSelectCommand::CreateObjects() () from /home/even/FileGDB_API-RHEL7-64gcc83/lib/libFileGDBAPI.so
(gdb) bt
#0 0x00007ffff6ee39c0 in SqlSelectCommand::CreateObjects() () from /home/even/FileGDB_API-RHEL7-64gcc83/lib/libFileGDBAPI.so
#1 0x00007ffff6ee3dd4 in SqlSelectCommand::Next() () from /home/even/FileGDB_API-RHEL7-64gcc83/lib/libFileGDBAPI.so
#2 0x00007ffff6da969d in FileGDBAPI::EnumRows::Next(FileGDBAPI::Row&) () from /home/even/FileGDB_API-RHEL7-64gcc83/lib/libFileGDBAPI.so
#3 0x00005555555568dd in main ()
The text was updated successfully, but these errors were encountered:
rouault
added a commit
to rouault/gdal
that referenced
this issue
Feb 2, 2022
Coming from qgis/QGIS#45760
With the attached dataset COASTS.gdb.zip, FileGDB_API-RHEL7-64gcc83 crashes on the following test program (adapted from samples/Querying/Querying.cpp) during the second iteration on EnumRows::Next(), if Table::Search() requests the binary field SE_ANNO_CAD_DATA
test_fgdb.cpp:
compile and run:
gdb traceback:
The text was updated successfully, but these errors were encountered: