Submit a Story  :  IRAF Links  :  Past Polls  :  Calendar  :  Advanced Search  
     iraf.net
FAQ
 Forum FAQForum FAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bug in imcombine

 
Post new topic   Reply to topic    iraf.net Forum Index -> Applications
View previous topic :: View next topic  
Author Message
callen



Joined: 01 Feb 2006
Posts: 11

PostPosted: Wed Feb 15, 2006 8:28 pm    Post subject: bug in imcombine Reply with quote

hi all... I guess this is the place to make a bug report?

I have found a problem in imcombine, I have been trying to track it down as I found it in a copy of the imcombine code (which I compiled to a library in order to use from another task). But the bug is in the original too and though I'd love to have more information it occurs to me I should report it before looking more because of course you're likely to understand it better.

Basically:

imcombine seg faults for us when

combine=sum
reject=none
weight= exposure

AND NCOMBINE is different in each image.

Reject doesn't seem key but weight, combine and the NCOMBINE value in the header seem to be the crucial factors generating the seg fault.

----


Stack Trace:

#0 0x081608a7 in icaver_ ()
#1 0x08138620 in iccomr_ ()
#2 0x08137aa1 in icombr_ ()
#3 0x080ec4ed in icombe_ ()
#4 0x08082257 in timcoe_ ()
#5 0x0804ab78 in sysruk_ ()
#6 0x0827823b in irafmn_ ()
#7 0x081cb5bc in main ()
#8 0x42015704 in __libc_start_main () from /lib/tls/libc.so.6

Basically it's dying in the averager when told not to average but do a sum, which is indicated with a flag.

.... ?

Here is to hoping you turn this puzzle into a simple explanation. I'd appreciate information about how you've done any fix to imcombine so I can also change the version we use as a library.

thanks in any case, cheers,
craig
Back to top
View user's profile Send private message
callen



Joined: 01 Feb 2006
Posts: 11

PostPosted: Wed Feb 15, 2006 10:41 pm    Post subject: clarification Reply with quote

re: NCOMBINE being different.

what I mean is the seg fault occurs for us with two input images if their NCOMBINE header value is different (e.g. these input were outputs of previous combines... part of a scripted test case)
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Tue Feb 21, 2006 5:55 pm    Post subject: Reply with quote

Hi Craig,
I'm sure Frank will have a closer look at this once he has a moment, but on the assumption the stack trace may be bogus because of a memory corruption elsewhere. have a look at the suggestions made in

http://iraf.net/phpBB2/viewtopic.php?t=84968

for using ElectricFence to trap errors sooner. I'm also assuming this is a linux system, if not the let us know. Is this a data-specific bug or do you see it with any two images with different NCOMBINE keywords? Is this within a script use or
can you reproduce it with a command-line call to IMCOMBINE just as easily? FITS images only or .imh fail as well??

Cheers,
-Mike
Back to top
View user's profile Send private message
callen



Joined: 01 Feb 2006
Posts: 11

PostPosted: Fri Feb 24, 2006 5:47 am    Post subject: clarifications Reply with quote

Mike,

thanks ... it is on linux, and it seems to be any images. It showed up in a test script with test data, but I've reproduced it with other images just by changing the NCOMBINE in the header.

I'll try with electric fence

-craig
Back to top
View user's profile Send private message
callen



Joined: 01 Feb 2006
Posts: 11

PostPosted: Mon Feb 27, 2006 10:59 pm    Post subject: update Reply with quote

fwiw, the call stack remained the same when involving efence.
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Tue Feb 28, 2006 5:02 am    Post subject: Reply with quote

Hi Craig,
Frank will of course have to verify the fix, but I was able to easily reproduce the problem. What appears to be happening is that in the ic_combine() routine a list of "image index pointers" is maintained (the 'id' pointer if you look at the code), however these are never actually set prior to the ic_average() call with the given combination of parameters. Specifically, the 'keepids' variable remains false.
Anyway, one workaround is to set the 'grow' parameter to some value greater than 1.0, but I believe the code change needed is to edit the case statement on line 229 of icomb.gx to read

case AVERAGE, SUM:

Most of this message is aimed at Frank but I assume it makes some sense to you as well. You'll need to figure out how this translates to your library code. Hope it helps.

Cheers,
-Mike
Back to top
View user's profile Send private message
valdes
IRAF Guru


Joined: 11 Nov 2005
Posts: 676

PostPosted: Tue Feb 28, 2006 11:04 pm    Post subject: Reply with quote

I agree with the fix that Mike proposed. I filed the following bug log.

NUMBER: 552
MODULE: imcombine
SYSTEM: V2.12.2
DATE: Tue Feb 28 14:07:30 MST 2006
FROM: valdes

BUG: When the combine option is sum and weighting is selected an exception
occurs. The sum option was added as a later feature and a
flag needed for weighting was not set. There is no workaround to
combine weighting and summing directly. One can use "average" and
the scale the result to the equivalent of a sum.

STATUS: Fixed for V2.12.3.

Frank
Back to top
View user's profile Send private message
callen



Joined: 01 Feb 2006
Posts: 11

PostPosted: Wed Mar 01, 2006 6:47 pm    Post subject: thanks Reply with quote

that definitely helped and was the cause of our segfault.

I guess I don't fully understand your comment Frank, "There is no workaround to
combine weighting and summing directly" but I can check it out more to see if it means what I'm guessing, which is that the weight won't be taken into account and the pixels will be directly summed...

in either case thanks greatly! what a pain this one was.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iraf.net Forum Index -> Applications All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2009 phpBB Group
 Copyright © 2005-2011 iraf.net
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.14 seconds