Re/Unresolved bug?

Xavier sabu at pure-elite.org
Sat Jun 28 04:14:17 EDT 2003


Greetings everyone,

Surely you all will excuse my ignorance if I have found a bug/fault which
is/has/had been un/resolved.  While tinkering around with some of my code,
after finishing about 300 lines of fugly code, I decided to start my nightly
debugging session.. this time it was rather weird what I got in return.  I
got a 'Segmentation fault' after execution of my script on my slackware 8.1
server, running kernel 2.4.19 with Python 2.2.1.  And on my Sentinix
(sentinix.org) box, running 2.4.20-grsec with Python 2.2.3 it doesn't
segfault but instead just closes down scarily.

Here are the examples of the script executions on both machines:

<start of slackware 8.1/linux 2.4.19 python 2.2.1 execution>
# ./t
./t:163: SyntaxWarning: name 'VERBOSE' is assigned to before global
declaration
  def main():
Segmentation fault

(root at boxen)-(03:48am Sat Jun 28)-(root)
# ./t
./t:163: SyntaxWarning: name 'VERBOSE' is assigned to before global
declaration
  def main():
Segmentation fault
(root at boxen)-(03:48am Sat Jun 28)-(root)
# python
Python 2.2.1 (#1, Apr 11 2002, 15:27:15)
[GCC 2.95.3 20010315 (release)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

# gdb python
GNU gdb 5.2
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-slackware-linux"...(no debugging symbols
found)...
(gdb) run t
Starting program: /usr/bin/python2.2 t
(no debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...
t:163: SyntaxWarning: name 'VERBOSE' is assigned to before global
declaration
  def main():
(no debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0807f022 in PyErr_NormalizeException ()
<end>

and on my Sentinix boxen with 2.4.20-grsec + Python 2.2.3:

<start>
root at tixdev:~# /usr/local/bin/python2.3 t
t:163: SyntaxWarning: name 'VERBOSE' is assigned to before global
declaration
  def main():
root at tixdev:~#
<end>

As you can see, with python 2.2.3 it just dies out without printing the full
exception, but also gives no 'Segmentation fault'.

Here is what I have:

A global variable on line 108:

<start>
VERBOSE = '0'
<end>

Now, we fast forward to my global statement .. on line 208:

<start>
   global VERBOSE
<end>

Then of course VERBOSE finally gets used on line 227:

<start>
     if VERBOSE == '1': COUNT = COUNT + 1
<end>

And then on line 234:

<start>
   if VERBOSE == '1': print "\n/> routekill has killed the routes on %s IP
addresses." % (COUNT)
<end>

So, do you guys know what's up with this? Thanks a lot.

-- Xavier.

oderint dum mutuant







More information about the Python-list mailing list