swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] [BUG] swfc segfaults when compiled as 64 bit under OS


From: Charlie Sharpsteen
Subject: [Swftools-common] [BUG] swfc segfaults when compiled as 64 bit under OS X
Date: Fri, 7 May 2010 14:16:56 -0700

Hi

I have seen this issue reported to the list a few times- but noone
seems to have come up with a fix for it yet.  I am running OS X 10.6.3
with an x86_64 kernel and it is a pain to build and maintain 32-bit
versions of dependency libraries for swftools.  I did a little bit of
legwork to suss out the cause of this problem that is described below.

I first compiled from the latest swftools source, checked out from:

  git://git.swftools.org/swftools

Environment variables set before running configure were:

  export CFLAGS="-arch x86_64 -g -O0 -w -pipe"
  export CXXFLAGS="-arch x86_64 -g -O0 -w -pipe"
  export CPPFLAGS="-I/usr/X11R6/include"
  export LDFLAGS="-L/usr/X11R6/lib"
  export MAKEFLAGS="-j1"
  export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

The resulting swfc in src/ segfaulted when attempting the trivial compilation:

  echo ".flash .end" | src/swfc - -C
  Segmentation fault (core dumped)


A post mortem examination of the core in gdb revealed that the fatal
error occurred in src/swfc.c at line 131 when strlen(text) is called.
Rerunning swfc under gdb shows that text contains a pointer to an
out-of-bounds memory address when readToken is called:

  Breakpoint 1, readToken () at swfc.c:126
  126       type = file[pos].type;

  p file[pos]
  $1 = {
    type = COMMAND,
    text = 0x408e41 <Address 0x408e41 out of bounds>,
    line = 1,
    column = 1
  }

I think the problem may occur during the creation of the file
structure in the generateTokens function which is at the end of
parser.lex-- however, I am at the limits of my knowledge at this point
and can't track any further.

I checked the failing command:

  echo ".flash .end" | src/swfc - -C

Against the same source built on an ubuntu amd64 VM and it worked just fine.


Any help on resolving this issue would be much appreciated!

-Charlie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]