Opened 13 years ago

Closed 13 years ago

Last modified 11 months ago

#2558 closed defect (fixed)

Problem with GP32 port.

Reported by: SF/wonst719 Owned by: SF/chrilith
Priority: normal Component: Port: GP32
Keywords: Cc:
Game:

Description

I tried to update port for the GP32 against latest
SVN version (revision 21665). It compiles well, but
it crashes
when it tries to open config file useing hashed open.
So I hacked into it, and...

config-manager.cpp Line 140: in
ConfigManager::loadFile(...)
file.cpp Line 206: in File::open(...)
hashmap.h Line 322: in HashMap::contains(Key &)
hashmap.h Line 302: in HashMap::lookup(Key &)
func.h Line 31: in EqualTo::operator()(const String
&, const String &)
str.cpp Line 255: in String::operator ==(const String
&)
str.h Line 81: in String::c_str()
CRASH

...the result is a hand-maded trace log. (I can't use
GDB / debugger with GP32)
I tried to put address checking in c_str() method. I
usually get address 0x0c******,
but this case I got 0xea000058. This prevents the
GP32 port form working. I wonder if
this happens because of compiler bug...?

Ticket imported from: #1466270. Ticket imported from: bugs/2558.

Change History (8)

comment:1 by fingolfin, 13 years ago

I have no idea if this is due to a compiler bug,
and obviously have no way to find out either :-).

Some questions: * You write "str.h Line 81: in
String::c_str()" -> did you mean "71"? If not,
your str.h differs from mine.

* When you say you checked the "address", about
which address are you talking, precisely? The
value of the "this" pointer? The value of "_str"?

* What values do "this", "_str", "_len" have upon
the crash?

* If possible tell us the string passed to the
lookup() method.

* If possible, tell us the string values of the
two strings passed to the equal operator.

* Did you try removing your config file?

-> I am not sure if all this helps, it's all a bit
like fumbling in the dark, but at least the info
might help narrow down the issue.

comment:2 by SF/wonst719, 13 years ago

* Oh. I made some mistake on the log. :-) c_str() was at
line 71, not 81.

* The address I meant was "this" pointer. That position
(0xea000058) is definitely not in the GP32 memory area.

* The string passed to the lookup() method and equal
operator was "scummvm.ini".

* I can't get values what "_str", "_len" have... "this"
already points to invalid position.

* I tried removing the config file. But the result was
same.

Hope this answer helps...

comment:3 by fingolfin, 13 years ago

Owner: set to SF/chrilith

comment:4 by fingolfin, 13 years ago

Sounds as if this this might be the same problem
that is troubling the PalmOS port (see
<http://logs.scummvm.org/log.php?log=scummvm.log.
09Apr2006>, and search for PalmOS).

bascially, we are using two globals in
common/file.cpp, which maybe don't get inited
properly, namely static StringIntMap
_defaultDirectories; static FilesMap _filesMap;

Chrilith, care to comment? How did you fix this?

If this is indeed the problem, we should change
the code, to help you two guys. One possibility
would be to change the two vars to be pointers,
and then use "new" to allocate storage once they
are accessed for the first time. Not elegant, but
hopefully works.

Though I am a bit surprised, the old version of
file.cpp contained StringList
File::_defaultDirectories; and that seemed to
work, at least I never saw complaints from either
of you two... Hmm, there the variable is a static
class member, does that make a difference, I
wonder... ?

comment:5 by SF/wonst719, 13 years ago

Resolution: fixed
Status: newclosed

comment:6 by SF/wonst719, 13 years ago

Thanks. The change on file.cpp made GP32 port to start.

comment:7 by digitall, 11 months ago

Component: --Unset--Ports

comment:8 by digitall, 11 months ago

Component: PortsPort: GP32
Note: See TracTickets for help on using tickets.