Menu

#6 fc5 86-64 segfault (v0.6.6)

open
nobody
None
5
2007-04-13
2007-04-13
wirser
No

after modifying units.h to remove " error: extra qualification" program gives "./fft -nosmooth -software -fullscreen -log
Final Frontier Trader
version 0.66
by TomT64
------------

PHYSFS initialized successfully
Loading Preferences
Segmentation fault"

running gdb backtrace produces the following output

[none@localhost fftrader]$ gdb ./fft
GNU gdb Red Hat Linux (6.3.0.0-1.134.fc5rh)
Copyright 2004 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 "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1".

(gdb) r
Starting program: /home/none/build/fftrader/fft
[Thread debugging using libthread_db enabled]
[New Thread 46912496270080 (LWP 7807)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912496270080 (LWP 7807)]
0x0000000000409283 in stripString (str=@0x7fff8ce4b1b0) at fftfile.cpp:45
45 while (isWhiteSpace(str[end - 1]) && end > 0) end--;
(gdb) bt
#0 0x0000000000409283 in stripString (str=@0x7fff8ce4b1b0) at fftfile.cpp:45
#1 0x000000000040a9c0 in ReadDoc (fp=0x5783e0) at fftfile.cpp:100
#2 0x000000000040ae34 in Preferences::Load (this=0x578330) at fftfile.cpp:1211
#3 0x0000000000414834 in Preferences (this=0x578330, fn=Variable "fn" is not available.
) at fftfile.cpp:1172
#4 0x000000000042dbf3 in main (argc=Variable "argc" is not available.
) at main.cpp:133
(gdb)

Discussion

  • wirser

    wirser - 2007-05-06

    Logged In: YES
    user_id=1537631
    Originator: YES

    upon further investigation I made one change which allows game to start

    [none@localhost fftrader]$ diff fftfile.cpp~ fftfile.cpp
    45c45
    < while (isWhiteSpace(str[end - 1]) && end > 0) end--;
    ---
    > while (isWhiteSpace(str[end <-1]) && end > 0) end--;

    as you see all I did was add an "<" to the first "end".
    I am not sure if this is the right logic but it allows game to start and be played

     
  • Anonymous

    Anonymous - 2009-11-28

    Alternatively, and probably more in the vein of the original logic, switch the order of the conditions:
    diff fftfile.cpp~ fftfile.cpp
    45c45
    < while (isWhiteSpace(str[end - 1]) && end > 0) end--;
    ---
    > while (end > 0 && isWhiteSpace(str[end -1])) end--;

     

Log in to post a comment.

MongoDB Logo MongoDB