EX4 from build 220 crashing on build 223, and vice versa

 

I've got two copies of MetaTrader, one on build 220 and one on build 223. If I create an EA using build 220, the .ex4 file works fine on build 220 of MT4 but causes build 223 to crash. And, similarly, if I create an EA using build 223, then the .ex4 file works fine on build 223 but crashes build 220 of MT4.


Example EAs attached (with one called build220.ex4 and the other called build222.ex4, because build 222 of MetaEditor/MetaLang is supplied with build 223 of MT4). In both cases the EA consists of nothing but the template code generated by MetaEditor - i.e. the init(), deinit() and start() functions are all blank. The problem isn't related to something the EA is doing.


I've seen more sporadic and less severe versions of this problem on other people's computers. It doesn't seem to be an entirely universal problem. Doesn't seem to affect scripts or indicators at all. On build 220 the crash seems to come when the start() function is called. On build 223 it seems to be during some sort of pre-loading of the .ex4, before even init() is called.


Has anyone else seen anything similar to this? Is it known to be related to e.g. a particular Windows update? Or is there a known workaround - other than putting the .mq4 file into experts so that the EA automatically gets recompiled when MT4 starts?

Files:
 

jjc

> the .ex4 file works fine on build 223 but crashes build 220 of MT4

Thats expected

> the .ex4 file works fine on build 220 of MT4 but causes build 223 to crash

That is not - I have many EA's built with 220 that run fine on 222 and 223

You may have a partially corrupt installation

Did the Editor crash a while ago, with a memory dump report?

-BB-

 
BarrowBoy:

You may have a partially corrupt installation

Did the Editor crash a while ago, with a memory dump report?

Many thanks for the response.


I can't remember a crash within the editor. And I actually have multiple installations of build 220. Generating an EA from any of them leads to a crash on build 223. (And I can't think what a "corrupt installation" could consist of given that Metalang.exe seems to be an entirely standalone application.) I've got a feeling that this may be a recent phenomenon, perhaps tied to something which has come down via Windows Update.


In case it helps someone towards a "eureka" moment:


  • I have an .ex4 file which I compiled about 6 weeks ago using build 220. This does continue to work fine on build 223.
  • If I now take the .mq4 source code for that old file and recompile it using build 220, the resulting .ex4 causes build 223 to crash.
  • If I take an absolutely clean Windows installation (Server 2003), copy build 220 of Metalang (and nothing else) onto it, compile the old source code, and then copy the .ex4 back onto my main machine, that also crashes build 223.


WTF?

 
jjc:

In case it helps someone towards a "eureka" moment:

Something very, very strange is going on.


If I set my computer's clock back a month (to April 14th) while compiling the ex4 file, an .ex4 compiled on build 220 then works on build 223. There's got to be something important about a timestamp on the file or built in to the file. I was right about it being a "recent phenomenon" - but absolutely not in the way that I thought.


But why? What possible reason can there be for this behaviour? Is this deliberate, as a way of forcing people to upgrade, or is it something like an indirect bug caused by the Themida code protection supposedly used by MT4?

 

Every time they create a new build, if you experience this crash...


all you have to do is...

1. update the MQL4 platform

2. open EA in newly updated MetaEditor

3. Compile


the newly compiled EA will work fine now!!!

 
seawolf:

Every time they create a new build, if you experience this crash... 

all you have to do is...

1. update the MQL4 platform

2. open EA in newly updated MetaEditor

3. Compile

the newly compiled EA will work fine now!!!

Well, yes, but compiling EAs for personal consumption obviously isn't a problem.


What is a problem is having clients on different builds of MT4 from 220 onwards. This incompatibility means that I either (a) have to give clients a different .ex4 file for each MT4 build, or (b) remember to play around with my computer clock before compiling on build 220, in order to create a single .ex4 file which works on all builds from 220 onwards, or (c) give everyone the .mql4 source code as well as the compiled .ex4. It's very annoying.

Reason: