IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 20 years ago

Closed 20 years ago

#779 closed defect (fixed)

psMetadataIterator does not work with a regex

Reported by: Paul Price Owned by: David.Robbins@…
Priority: high Milestone:
Component: types Version: unspecified
Severity: normal Keywords:
Cc:

Description

63 psMetadataIterator *iterator =
psMetadataIteratorAlloc(arguments, PS_LIST_HEAD, "-header$");
(gdb)
(gdb) n
65 while ((item = psMetadataGetAndIncrement(iterator))) {
(gdb) p *iterator
$1 = {iter = 0xa2f4e1c, regex = 0xa2f4e8c}
(gdb) n
66 if (item->type != PS_DATA_STRING) {
(gdb) p *item
$2 = {id = 0, name = 0xa325a04 "\234z5\n\234g2\n¼M2\n\n»Ê?ï¾­Þ(\227Ê?q",

type = 170917652, data = {B = false, S8 = 0 '\0', S16 = 0, S32 = 0,

S64 = -2401053092612145152, U8 = 0 '\0', U16 = 0, U32 = 0,
U64 = 16045690981097406464, F32 = 0, F64 = -1.1885953953520806e+148,
list = 0x0, md = 0x0, V = 0x0},

comment = 0x60 <Address 0x60 out of bounds>}

Generated new test for psMetadataIterator:

price@mithrandir:/home/mithrandir/price/mhpcc/psLib/test/types>./tap_psMetadataIterator
1..42
# psMetadataIterator tests
ok 1 - iter = 8a66054
ok 2 - item = 8a5f3c4
ok 3 - item->name = SIMPLE
ok 4 - item->comment = Basic FITS?
ok 5 - item->data.V = TRUE
ok 6 - item = 8a602ac
ok 7 - item->name = COMMENT
ok 8 - item->comment = This is a
ok 9 - item->data.V =
ok 10 - item = 8a61884
ok 11 - item->name = FILENAME
ok 12 - item->comment = File name
ok 13 - item->data.V = abcdefg123456.fits
ok 14 - item = 8a62714
ok 15 - item->name = COMMENT
ok 16 - item->comment = comment
ok 17 - item->data.V =
ok 18 - item = 8a63544
ok 19 - item->name = DATE-OBS
ok 20 - item->comment = Observing date, UTC
ok 21 - item->data.V = 1978-11-29
ok 22 - item = 8a643e4
ok 23 - item->name = COMMENT
ok 24 - item->comment = block
ok 25 - item->data.V =
ok 26 - item = 8a65214
ok 27 - item->name = COMMENT
ok 28 - item->comment = This is another comment
ok 29 - item->data.V =
ok 30 - iter = 8a66054
ok 31 - item = 8a64454
not ok 32 - item->name = TDÄB„R¦
# Failed test (tap_psMetadataIterator.c:main() at line 112)
Segmentation fault (core dumped)

Will investigate on Monday.

Change History (1)

comment:1 by Paul Price, 20 years ago

Resolution: fixed
Status: newclosed

Rewrote the regex-specific portions of psMetadata to properly use regex in
iteration. The main problem was in directly casting the cursor to a
psMetadataItem, rather than the data that the cursor pointed to.
tap_psMetadataIterator now passes all tests (a total of 242, after expansion to
check forwards, backwards, jumping in halfway, etc).

Note: See TracTickets for help on using tickets.