<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><html>On Mar 20, 2008, at 3:06 PM, Steven Weiss wrote:</html><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><font face="Arial" size="2">Hi Jennifer,</font></div><div><font face="Arial" size="2"></font> </div><div><font face="Arial" size="2">1. Actually I generate a number of different files and it crashes on different ones at different places, so the time step debug wont help.</font></div></span></blockquote>My suggestion would be to break it up into smaller pieces -- straighten out your code path -- that's the only way to isolate where the problems are. There aren't many shortcuts for debugging.<br><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><font face="Arial" size="2">2. Not sure what you mean by data type? Its a text or string thats its falling over on when trying to write to file.</font></div></span></blockquote>I guess 'data format' would be a better word -- netcdf, grib, grib2, binary ... There are some known problems with netcdf in 2.0.a1. </div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><font face="Arial" size="2">3. I'm not familiar with<span class="Apple-converted-space"> </span><font face="Times New Roman" size="3">'limit coredumpsize unlimited'  where/how do I set this?</font></font></div></span></blockquote>I put the command just like that in my .tcshrc file, but you can enter it at the unix command line too in order to get core files.</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div>4. OK, will play with gdb to see what I can get out of it.</div></span></blockquote></div><div>Good luck! </div><div><br></div><div>Jennifer</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div> </div><div><font face="Arial" size="2">Regards</font></div><div><font face="Arial" size="2">Steven</font></div><blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left-color: rgb(0, 0, 0); border-left-width: 2px; border-left-style: solid; margin-right: 0px; "><div style="font: normal normal normal 10pt/normal arial; ">----- Original Message -----</div><div style="background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(228, 228, 228); font: normal normal normal 10pt/normal arial; background-position: initial initial; "><b>From:</b><span class="Apple-converted-space"> </span><a title="jma@COLA.IGES.ORG" href="mailto:jma@COLA.IGES.ORG">Jennifer Adams</a></div><div style="font: normal normal normal 10pt/normal arial; "><b>To:</b><span class="Apple-converted-space"> </span><a title="GRADSUSR@LIST.CINECA.IT" href="mailto:GRADSUSR@LIST.CINECA.IT">GRADSUSR@LIST.CINECA.IT</a></div><div style="font: normal normal normal 10pt/normal arial; "><b>Sent:</b><span class="Apple-converted-space"> </span>Thursday, March 20, 2008 8:47 PM</div><div style="font: normal normal normal 10pt/normal arial; "><b>Subject:</b><span class="Apple-converted-space"> </span>Re: grads-2.0.a1 segmentation fault</div><div><br></div><br><div>On Mar 20, 2008, at 1:50 PM, Steven Weiss wrote:<br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi Jennifer,</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Yes, I am looping around the time variable and calling a number of nested</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">functions that return a string variable which I print to a file.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The problem is that its inconsistent so its hard to put the debug code in.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The script is approx 1000 lines.</div></blockquote><div>At the very least you could put something in to say what time step you're at.</div><br><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">There is no core.</div></blockquote>Use 'limit coredumpsize unlimited' to get core files. On a mac, they get put in /cores <br><blockquote type="cite"><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I will have to try see if I can catch it.</div></blockquote>Can't really help without more specific info. What data type are you using??</div><div><br><blockquote type="cite"><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-style-span" style="-webkit-text-stroke-width: -1px; ">Is there no possibility that you can run in debug mode e.g. grads --debug?</span></div></blockquote>What would you have 'grads --debug' do for you? </div><div><br></div><div>You can try running grads inside the GNU debugger... </div><div>> gdb grads</div><div>...</div><div>(gdb) set args -lbc 'myscript.gs'</div><div>(gdb) run</div><div><br></div><div>... then, when it seg faults, use the 'where' command to find out what caused the crash. </div><div><br></div><div>Jennifer</div><div><br></div><div><br></div><div><br></div><div><blockquote type="cite"><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Regards</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Steven</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">----- Original Message -----</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">From: "Jennifer Adams" &lt;<a href="mailto:jma@COLA.IGES.ORG">jma@COLA.IGES.ORG</a>></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">To: &lt;<a href="mailto:GRADSUSR@LIST.CINECA.IT">GRADSUSR@LIST.CINECA.IT</a>></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Sent: Thursday, March 20, 2008 6:28 PM</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Subject: Re: grads-2.0.a1 segmentation fault</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Mar 20, 2008, at 8:10 AM, Steven Weiss wrote:</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi,</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'm running grads 2.0.a1 on Suse Linux and every so often I get a</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">segmentation fault. Its very inconsistent. The only thing I can see</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">is that</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">it is always during writing out a file. i.e. rc= write (filename,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">variable).</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">From looking at the file, the variable data is normally only half</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">written</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and the problem is not always in the same place.</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">How can I go about identifying what the problem is?</div></blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Well ...</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I can't fix I bug I can't reproduce, so you have to find a way to get</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">GrADS to seg fault reliably. Try putting some debugging statements in</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">your script so you'll know where it's dying, e.g. if it happens</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">during a loop. There are some known problems in 2.0.a1 that have</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">already been addressed ... what data type are you using?</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">If you've got a core file, you can try using gdb (gnu debugger) to</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">see where it died:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">> gdb grads</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">...</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(gdb) core your.core.filename</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Then gdb will say where in the GrADS code it was when it seg faulted.</div><div style="min-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Jennifer</div></blockquote></blockquote></div><br><div><span class="Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; orphans: 2; widows: 2; "><span class="Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; orphans: 2; widows: 2; "><span class="Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; orphans: 2; widows: 2; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></span></div><br></blockquote></span><br class="Apple-interchange-newline"></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></span> </div><br></body></html>