IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#348 closed defect (fixed)

psFitsReadTable() segfaults on valid input

Reported by: jhoblitt Owned by: robert.desonia@…
Priority: highest Milestone:
Component: types Version: 0.5.0
Severity: major Keywords:
Cc:

Description

The code example below causes a segfault.

#include <pslib.h>

int main () {

psFits *f;
psArray *table;

f = psFitsAlloc("./phot.db");

move to first table
psFitsMoveExtNum(f, 1, false);

table = psFitsReadTable(f);

}

(gdb) bt
#0 ffgcls2 (fptr=0x63a250, colnum=0, firstrow=1, firstelem=1,

nelem=548682037311, nultyp=1, nulval=0x7fbfffeb9e "", array=0x7fbfffed20,
nularray=0x7fbfffeb9e "", anynul=0x7fbfffed1c, status=0x7fbfffee90)
at getcols.c:694

#1 0x00000000004443f1 in ffgcls (fptr=0x63a250, colnum=11, firstrow=1,

firstelem=1, nelem=1, nultyp=1, nulval=0x7fbfffeb9e "",
array=0x7fbfffed20, nularray=0x7fbfffeb9e "", anynul=0x7fbfffed1c,
status=0x7fbfffee90) at getcols.c:113

#2 0x000000000042d1b5 in ffgcv (fptr=0x63a250, datatype=6422690, colnum=11,

firstrow=548682037312, firstelem=63, nelem=63, nulval=0x0, array=0x0,
anynul=0x7fbfff7800, status=0x7fbfffee90) at getcol.c:796

#3 0x0000002a957c3600 in psFitsReadTableRow (fits=0x63c440, row=0)

at psFits.c:1214

#4 0x0000002a957c3fdf in psFitsReadTable (fits=0x63c440) at psFits.c:1451
#5 0x0000000000404fea in main ()

Attachments (1)

phot.db (236.2 KB ) - added by jhoblitt 21 years ago.
example fits file

Download all attachments as: .zip

Change History (7)

by jhoblitt, 21 years ago

Attachment: phot.db added

example fits file

comment:1 by jhoblitt, 21 years ago

psFitsReadTableRow() also segfaults on the same file.

comment:2 by robert.desonia@…, 21 years ago

Status: newassigned

comment:3 by jhoblitt, 21 years ago

Priority: highhighest

comment:4 by robert.desonia@…, 21 years ago

Resolution: fixed
Status: assignedclosed

Found the problem; I wasn't properly allocating a buffer for reading a string
element of a table.

Fix is in CVS.

-rdd

comment:5 by jhoblitt, 21 years ago

Keywords: VERIFIED added

Confirmed. I an unable to produce a segfault.

comment:6 by Paul Price, 20 years ago

Keywords: VERIFIED removed

Bugs have been fixed... closing.

Note: See TracTickets for help on using tickets.