[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Scanner segfault: Works fine on i686, but fails on x86_64
From: |
Glenn Golden |
Subject: |
Scanner segfault: Works fine on i686, but fails on x86_64 |
Date: |
Thu, 13 Feb 2014 16:40:58 -0700 |
User-agent: |
Mutt/1.5.22 (2013-10-16) |
--
Greetings Flexoids,
I'm trying to debug a flex scanner segfault issue in a very old program (not
mine) about which I know essentially nothing of its internals, just trying to
build it. To add to the fun, I know very little about flex.
The good news is that the scanner builds and works just fine when built and
run a 32b i686 box. The segfaults occurs only when it is built and run on an
x86_64.
The segfault occurs at the scanner line "*yy_cp = (yy_hold_char);". Goolging
suggests that this is a common point of failure, related (I think?) to
overrunning a buffer which is expected to be null-terminated but isn't.
However, I was unable to make any further headway in determining more than
this (and not even sure the above is correct.)
Also googled for complaints about similar 32b/64b flex issues in general, i.e.
anything that might give a hint as to why a particular scanner might work for
32b but not 64b. No joy on that either.
Could someone here perhaps cast an expert eye at it, suggest some things to
try in order to narrow down the issue? Any help would be greatly appreciated.
Attached are three relevant files:
spewage.txt: Scanner build lines (flex, and subsequent gcc), and the output
from a gdb session in which it segfaults.
xtpanel_scan.l: Scanner definition
test.xt: The scanner input file on which the segfault occurs.
If anything else would be useful, just let me know.
TIA,
Glenn
spewage.txt
Description: Text document
xtpanel_scan.l
Description: Text document
test.xt
Description: Text document