Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Maintenance & Feedback » JJ2+ Issue Tracker

Bug Report Freezing with long filename on command line

French French's Avatar

JCF Member

Joined: Jul 2013

Posts: 26

French is doing well so far

May 2, 2020, 12:57 PM
French is offline
Unhappy Freezing with long filename on command line

Yet another f***ing bug.
  • If I run JJ2+ with a file path with more than 62 characters, it freezes (i.e. stops responding) when loading the level.
  • With JJ2 vanilla, I can get it work with a path length up to 128 characters (might be less if the tileset filename is longer than the level filename). When exceeding this limit, JJ2+ crashes the same way as JJ2 vanilla, i.e. with a fatal application error. (Uh, actually vanilla may crash with an access violation error instead, but not JJ2+… Never mind.)

62 characters is a bit short for me, you know, as my JJ2 folder is a subsubfolder of the ‘Program Files (x86)’ folder on my main disk partition. Then ‘Save & Run’ from JCS triggers the bug.

From Windows cmd, with my JJ2+ folder as working directory:
  • this works:
    Code:
    Jazz2.exe .\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Easter1.j2l
  • this makes the game freeze (just one backslash more):
    Code:
    Jazz2.exe .\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Easter1.j2l

I hope this helps.
Attached Images
File Type: png freezing.png (255.4 KB, 0 views)
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

May 2, 2020, 05:24 PM
Violet CLM is offline
Yeah, this is an annoying one. JJ2 stores (most? all?) strings in fixed-length character buffers, which mostly cap out at 32 or 64 characters. People tend to keep JJ2 close to the root to limit the issue, e.g. C:\Games\Jazz2 or D:\Games\Jazz2. I made some progress at fixing this a while back, but it involves finding every reference to the strings anywhere in the game and replacing all of them, and I never finished the job... thanks for the reminder.
__________________
French French's Avatar

JCF Member

Joined: Jul 2013

Posts: 26

French is doing well so far

May 3, 2020, 03:37 PM
French is offline
Okay. But how do you explain that JJ2+ now needs a shorter filepath?

BTW, it seems not to work if the filepath contains spaces and is contained in a single argument, i.e. it is put between quotes on the command line. You must omit the quotes. It is very weird. I have no idea about how it is possible. (It is not new to JJ2+.)

So JJ2 vanilla used C-style strings and you try to use C++ ones instead, this is the idea?

Last edited by French; May 3, 2020 at 03:37 PM. Reason: Typo
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

May 3, 2020, 05:04 PM
Violet CLM is offline
Right, C vs. C++ strings. The code in question is very old and I didn't write any of it, so I can't comment on how or why it differs from vanilla JJ2 on this front.
__________________
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Aug 19, 2022, 08:11 PM
Violet CLM is offline
Fix will be available in 5.10.
__________________
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 08:29 AM.