Opened 3 years ago

Closed 3 years ago

#12416 closed defect (fixed)

AGS: Assert in POSIXFilesystemNode::getChild

Reported by: criezy Owned by: criezy
Priority: normal Component: Engine: AGS
Version: Keywords:
Cc: Game:


A user reported on the forum that while playing Blackwell Deception and Technobabylon he encountered a crash after a while with
scummvm: backends/fs/posix/posix-fs.cpp:132: virtual AbstractFSNode* POSIXFilesystemNode::getChild(const Common::String&) const: Assertion `!n.contains('/')' failed.

I have played a good chunk of Blackwell Deception without seeing that assert yet and this will need to be investigated further.

I also looked at the code and we are calling FSNode::getChild() in two places, both in Common::FSNode getFSNode(const char *path) in stdio_compat.cpp, and as far as I can see the logic there seems correct (it splits the path using '/' to look recursively for subdirs and then the file).

So I don't know what could be triggering the assert.

Change History (3)

comment:1 by criezy, 3 years ago

Summary: Assert in POSIXFilesystemNode::getChildAGS: Assert in POSIXFilesystemNode::getChild

comment:2 by Kirtai, 3 years ago

Tested it and it appears to be fixed in commit b1683699bd213bb2ce1ce7b240523091c4786712.
Thanks again :)

comment:3 by criezy, 3 years ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

Indeed, it is fixed. I forgot I created a bug report.
The issue was with the F12 key trying to generates a screenshot in some games with a path of "/saves/scrnshot.bmp". This "/saves/" prefix indicates it should be created in the savegame directory, but this was not correctly handled.

Note: See TracTickets for help on using tickets.