[FLASH-USERS] Bug in Flash3.0

Geoff Bicknell geoff at mso.anu.edu.au
Wed Apr 30 18:24:43 EDT 2008


We have been having problems with FLASH3.0 hanging on our SGI Altix 
computer here at ANU. David Singleton, who is a consultant in the ANU 
Supercomputer Facility, had a look at this problem for us and 
identified it as arising from an additional character being written 
by strcpy. David's comments and proposed fix are below.

Geoff Bicknell

--------------------------------------------------------------------------------
I think there is a bug in 3.0 that cause segfaults on our Altix
system. On our system, setup_buildstats.c has the line:

      strcpy(build_machine, "Linux ac 
2.6.16.53-0.16.PTF.285195.0-default #1 SMP Tue Oct 2 16:57:49 UTC 
2007 ");

That string contains 80 characters (which is what make_bstats sets up)
and build_machine is 80 characters long.  But strcpy will also
write a trailing '\0', an 81st character, which wipes out whatever
comes after build_machine in memory.  The patch is below.  I haven't
checked if there are any other problematic C string library calls.

David


# diff -w -u object/make_bstats object/make_bstats.NEW
--- object/make_bstats  2008-04-28 18:05:38.417096200 +1000
+++ object/make_bstats.NEW      2008-04-30 22:23:46.411828237 +1000
@@ -4,8 +4,8 @@

  rm -f setup_buildstats.F90

-max_str_len=80
-long_len=400
+max_str_len=79
+long_len=399

  BUILD_DATE=`date | cut -c 1-$max_str_len`
  BUILD_DIR=`pwd | cut -c 1-$max_str_len`



-- 
================================================================================
Professor Geoffrey Bicknell, Associate Director (Academic)
Research School of Astronomy & Astrophysics, Australian National University,
Mt Stromlo Observatory, Cotter Rd., Weston ACT 2611, AUSTRALIA
T:+61 (0)2 6125 0245 M: +61 (0)402 302 802  F: +61 (0)2 6125 0260
W: http://www.mso.anu.edu.au/~geoff
================================================================================
(ANU CRICOS #00120C)



More information about the flash-users mailing list