tags 148650 + patch
thanks

[Petter Reinholdtsen]
> Did not have time to rebuild xfs with debug symbols.

Here is valgrind with debug symbols:

# valgrind xfs
==8863== Memcheck, a memory error detector.
==8863== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==8863== Using LibVEX rev 1658, a library for dynamic binary translation.
==8863== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==8863== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation 
framework.
==8863== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==8863== For more details, rerun with: -v
==8863==
==8863== Invalid read of size 1
==8863==    at 0x401E208: strlen (mc_replace_strmem.c:246)
==8863==    by 0x80516C3: SetFontCatalogue (fonts.c:759)
==8863==    by 0x8055299: SetConfigValues (config.c:299)
==8863==    by 0x8052534: main (main.c:144)
==8863==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==8863==
==8863== Process terminating with default action of signal 11 (SIGSEGV)
==8863==  Access not within mapped region at address 0x0
==8863==    at 0x401E208: strlen (mc_replace_strmem.c:246)
==8863==    by 0x80516C3: SetFontCatalogue (fonts.c:759)
==8863==    by 0x8055299: SetConfigValues (config.c:299)
==8863==    by 0x8052534: main (main.c:144)
==8863==
==8863== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 23 from 1)
==8863== malloc/free: in use at exit: 4,467 bytes in 64 blocks.
==8863== malloc/free: 95 allocs, 31 frees, 40,284 bytes allocated.
==8863== For counts of detected errors, rerun with: -v
==8863== searching for pointers to 64 not-freed blocks.
==8863== checked 192,720 bytes.
==8863==
==8863== LEAK SUMMARY:
==8863==    definitely lost: 0 bytes in 0 blocks.
==8863==      possibly lost: 0 bytes in 0 blocks.
==8863==    still reachable: 4,467 bytes in 64 blocks.
==8863==         suppressed: 0 bytes in 0 blocks.
==8863== Reachable blocks (those to which a pointer was found) are not shown.
==8863== To see them, rerun with: --show-reachable=yes
Segmentation fault
#  

This patch solve the problem, and get xfs to return an error to the
log instead of segfaulting.

--- os/config.c.orig    2008-05-16 08:59:37.000000000 +0200
+++ os/config.c 2008-05-16 09:00:39.000000000 +0200
@@ -296,6 +296,10 @@
     int         err,
                 num;

+    if (NULL == font_catalogue) {
+       FatalError("font catalogue is missing/empty\n");
+    }
+
     err = SetFontCatalogue(font_catalogue, &num);
     if (err != FSSuccess) {
        FatalError("element #%d (starting at 0) of font path is bad or has a 
bad font:\n\"%s\"\n",

Happy hacking,
-- 
Petter Reinholdtsen



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to