https://bugs.winehq.org/show_bug.cgi?id=56941
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |o.dierick@piezo-forte.be
--- Comment #4 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- Hello,
(In reply to Alois Schlögl from comment #3)
In my case, these have are not propagated
HOME PWD QT_ACCESSIBILITY QT_FONT_DPI QT_SCALE_FACTOR XDG_SESSION_TYPE
-- code from dlls/ntdll/unix/env.c --- /*********************************************************************** * is_special_env_var * * Check if an environment variable needs to be handled specially when * passed through the Unix environment (i.e. prefixed with "WINE"). */ static BOOL is_special_env_var( const char *var ) { return (STARTS_WITH( var, "PATH=" ) || STARTS_WITH( var, "PWD=" ) || STARTS_WITH( var, "HOME=" ) || STARTS_WITH( var, "TEMP=" ) || STARTS_WITH( var, "TMP=" ) || STARTS_WITH( var, "QT_" ) || STARTS_WITH( var, "VK_" ) || STARTS_WITH( var, "XDG_SESSION_TYPE=" )); } (...) if (is_special_env_var( p )) length += 4; /* prefix it with "WINE" */ (...) if (is_special_env_var( p )) /* prefix it with "WINE" */ { *envptr++ = strcpy( dst, "WINE" ); strcat( dst, p ); } (...) /* skip Unix special variables and use the Wine variants instead */ if (!strncmp( str, "WINE", 4 )) { if (is_special_env_var( str + 4 )) str += 4; else if (!strcmp( str, "WINEDLLOVERRIDES=help" )) { MESSAGE( overrides_help_message ); exit(0); } } else if (is_special_env_var( str )) continue; /* skip it */ -- end of code ---
(In reply to tinozzo123 from comment #0)
I say "~32000", because the issue starts occurring a little before 32760 characters. However, my counting method was imprecise (I simply typed `set` in `wine cmd`, then counted the characters), and there's also the fact that the EA app also sets its own environment variables.
(In reply to tinozzo123 from comment #2)
individual path to the library (e.g. `XDG_DATA_DIRS` and `QT_PLUGIN_PATH`, on my end the former is larger than 20000 characters by itself).
QT_PLUGIN_PATH meets the STARTS_WITH( var, "QT_" ) condition to is_special_env_var(), so it's one of the variable that gets mangled.
I wonder if adding those 4 "WINE" character to special variables when the environment is near the 32768 limit makes it overflow or something. Maybe WINE should not blindly add those characters but check if the size permits it.
I guess PATH, HOME and PWD are present on every system so that makes for at least 12 characters, and you have to add the wine-generated PATH, HOME and PWD.
Of course, this doesn't tell which of Wine or the application is failing.
However, simply blacklisting the longest variable is not a proper solution IMO, as it may be one variable that is required for proper operation, and smaller ones, not required for wine or system operation, should be removed instead. Then it would be up to the user to decide which variable to remove, and it would have to be done before launching the wine command.
Have you tried to launch the EA App with a script that sets a cleaner environment for wine before launching the command?
Regards.