Author Topic: EMERGENCY REQUEST: fix erange errors on long paths  (Read 5660 times)

0 Members and 1 Guest are viewing this topic.

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
EMERGENCY REQUEST: fix erange errors on long paths
The Steam version of this game installs to a long-ass file path.

We are about to get a flood of people trying to install FSO, because the Steam version doesn't work at ALL out of the box.

When they try to run FSO in their long-ass file path, they are going to get ERANGE errors and get ****ed.

Can we fix this error and get a new build up in the launcher ASAP?

 

Offline niffiwan

  • 211
  • Eluder Class
Re: EMERGENCY REQUEST: fix erange errors on long paths
IIRC m!m mentioned he had code for this in one of his github branches.  If we can find it and get some intense testing done in the next few days then we should stand a decent chance of quickly getting this into a 3.7.2RC3 (Of course, I do not speak alone for the SCP... but surely this is a worthy cause.)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline NGTM-1R

  • I reject your reality and substitute my own
  • 213
  • Syndral Active. 0410.
Re: EMERGENCY REQUEST: fix erange errors on long paths
Seconding this. The Steam release is a huge opportunity for us, but only if FSO works well for them.
"Load sabot. Target Zaku, direct front!"

A Feddie Story

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: EMERGENCY REQUEST: fix erange errors on long paths
It's pretty clear the flood of error reports has already begun.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline m!m

  • 211
Re: EMERGENCY REQUEST: fix erange errors on long paths
Sorry to dissapoint you but my solution depends on the compresed VP branch which is not ready for trunk yet (it is also based off the SDL branch which would be another problem.
Maybe it could be an option to patch the cfile system to be able to handle longer paths otherwise.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: EMERGENCY REQUEST: fix erange errors on long paths
No worries, I might see if I can do a simple bump to the char[] size.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline niffiwan

  • 211
  • Eluder Class
Re: EMERGENCY REQUEST: fix erange errors on long paths
Double post... here's some code that I hope will do the job:  https://github.com/niffiwan/fs2open.github.com/commits/longer_paths

I've bumped MAX_PATH_LEN to 256 (from 128), other #defines like #CFILE_MAX_PATH_LEN are already at 256 or higher.  There's not much point going much higher since Windows only supports MAX_PATH of 260 anyway (including the drive letter and NUL, yes 260 is technically not 100% correct, but if explorer, cmd.exe and powershell prompt can't handle it...).  I also checked through the code for the magic number 128 (far too many of them) and I think I've updated all the relevant ones to use MAX_PATH_LEN.

For testing, so far I've played Surrender Belisarius and The Blade Itself (BP) and both seemed to work fine with root FSO install dir 201 chars long (note that subdirs take up a fair portion of the allowed path length).  A lot more testing will be needed though :)

Lastly, have some executables for testing...(still building...). http://www.mediafire.com/download/od3zovwl2qwcdgm/longpath.7z

It'd be great for this to get as much testing as possible. Play missions from as many mods as possible, just from the techroom should be fine, and watch out for errors, warning, or missing stuff (like textures, glowmaps, scripts failing, etc).
« Last Edit: June 07, 2014, 12:40:18 am by niffiwan »
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: EMERGENCY REQUEST: fix erange errors on long paths
Let's clarify... Please only test on mods that you are 150% sure have no missing files and no missing dependencies. This probably means to think twice about testing on really old mods, or mods that you've changed the mod.ini to a newer MediaVPs version than what it officially supports. False positives won't make this go faster.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: EMERGENCY REQUEST: fix erange errors on long paths
I did a test on a very long filepath that I confirmed to generate erange errors on 3.7.2RC2 and it worked successfully in my tests with the retail assets and the 2014 MediaVPs (and BP2, although that mod.ini was modified to point to the 2014 MVPs a long time ago). Didn't see any instances of 127/128 magic numbers related to file paths that you missed in your patch, niffiwan.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: EMERGENCY REQUEST: fix erange errors on long paths
OK - it's committed to trunk, and should be in the next nightly. If anyone encounters any issues, please let me know!
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: EMERGENCY REQUEST: fix erange errors on long paths
want to clarify something, the game as installed by steam does not work for a great many people due to this bug existing in retail.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: EMERGENCY REQUEST: fix erange errors on long paths
want to clarify something, the game as installed by steam does not work for a great many people due to this bug existing in retail.

I don't think the Steam version of this game is failing to work due to the ERANGE error, though I could be wrong.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: EMERGENCY REQUEST: fix erange errors on long paths
It doesn't matter where the error comes from. What matters is making sure that it's fixed on our end.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: EMERGENCY REQUEST: fix erange errors on long paths
He is talking about the steam 'won't run' error which is not the topic of this thread.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: EMERGENCY REQUEST: fix erange errors on long paths
I thought it was the same error, a bug that has been around since retail.

if that is not the case then I apologize for the derail.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: EMERGENCY REQUEST: fix erange errors on long paths
Steam problem appears to be caused by missing registry entries, not long file paths (otherwise, people wouldn't be able to run FSO from their steam install path; as long as they don't use the MediaVPs, that apparently works fine).
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.