switch (dp->extended_marker) { - case 0: - /* - * This may be an old driver that has been recompiled. If so, - * at least the fields that existed in extended driver version - * 1.0 should be zero. If not, a it is a bad driver. We cannot - * be completely certain that this is a valid driver but this is - * the best we can do with old drivers... - */ - if (dp->major_version != 0 - || dp->minor_version != 0 - || dp->driver_flags != 0 - || dp->handle2 != NULL - || dp->process_exit != NULL) { - /* Old driver; needs to be recompiled... */ - return ERL_DE_LOAD_ERROR_INCORRECT_VERSION; - } - break; case ERL_DRV_EXTENDED_MARKER: if (ERL_DRV_EXTENDED_MAJOR_VERSION != dp->major_version || ERL_DRV_EXTENDED_MINOR_VERSION < dp->minor_version) { --------------------------------------------------------------------------- --------------
makes R15B return error "incorrect driver version" for so-called old drivers (which don't initialize fields extended_marker, major_version and minor_version in their ErlDrvEntry structure, or initialize them as zeros).
3) many existing applications break (YAWS and ejabberd definitely, I suspect many others too, because example in tutorial don't use extended_marker).
So, will this change be permanent (the documentation and all applications are to be fixed), or this change will be considered too disruptive and old drivers will be allowed back in R15B01?
(By the way, the error message is a bit misleading, especially after the driver was recompiled using R15B.)
On Thu, Dec 15, 2011 at 10:44 AM, Sergei Golovan <sgolo...@gmail.com> wrote:
> 3) many existing applications break (YAWS and ejabberd definitely, I > suspect many others too, because example in tutorial don't use > extended_marker).
Den 15 dec 2011 16:45 skrev "Sergei Golovan" <sgolo...@gmail.com>:
> Hi!
> Appears that erl_driver API has been changed in R15B. The following > change in erts/emulator/beam/erl_bif_ddll.c (R15B with respect to > R14B04)
This should be no surprise since it is clearly mentioned in the release highlights and in the Readme file. It is also in the documentation, but as you point out there might be some remaining issues there, thanks for that. The change imicrotonal and will stay like this. We thought it was better to require the use of version number in drivers so that we can detect old drivers and refuse loading them, rather than just trying to run which might result in strange errors later during runtime.
> This should be no surprise since it is clearly mentioned in the release > highlights and in the Readme file. It is also in the documentation, but as > you point out there might be some remaining issues there, thanks for that. > The change imicrotonal and will stay like this. We thought it was better to > require the use of version number in drivers so that we can detect old > drivers and refuse loading them, rather than just trying to run which might > result in strange errors later during runtime.
I must've missed this in highlights. Ok then, lets fix the applications.
I got the following error: [...] SUPERVISOR REPORT==== 15-Dec-2011::19:27:52 === Supervisor: {local,reactiv_sup} Context: start_error Reason: {{badmatch,{error,"Error loading sqlite3_drv_darwin_64: Driver compiled with incorrect version of erl_driver.h"}},
> Den 15 dec 2011 16:45 skrev "Sergei Golovan" <sgolo...@gmail.com>:
> > Hi!
> > Appears that erl_driver API has been changed in R15B. The following > > change in erts/emulator/beam/erl_bif_ddll.c (R15B with respect to > > R14B04)
> This should be no surprise since it is clearly mentioned in the release highlights and in the Readme file. It is also in the documentation, but as you point out there might be some remaining issues there, thanks for that. > The change imicrotonal and will stay like this. We thought it was better to require the use of version number in drivers so that we can detect old drivers and refuse loading them, rather than just trying to run which might result in strange errors later during runtime.
Hi I am doing some upgrades of drivers right now. I realized that I sometimes need to be able to compile on pre R15 so I came up with the following scheme in drv_x.c:
#include "erl_driver.h"
// Hack to handle R15 driver used with pre R15 driver #if ERL_DRV_EXTENDED_MAJOR_VERSION == 1 typedef int ErlDrvSizeT; typedef int ErlDrvSSizeT; #endif
Then I re-type x_ctl ...
I think this will work, at least for me ? Or will there be a 1.x that breaks this ?
"Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"
On Wed, Jan 25, 2012 at 02:23:46PM +0100, Tony Rogvall wrote:
> Hi I am doing some upgrades of drivers right now. I realized that I sometimes need to be able to > compile on pre R15 so I came up with the following scheme in drv_x.c:
> #include "erl_driver.h"
> // Hack to handle R15 driver used with pre R15 driver > #if ERL_DRV_EXTENDED_MAJOR_VERSION == 1 > typedef int ErlDrvSizeT; > typedef int ErlDrvSSizeT; > #endif
> Then I re-type x_ctl ...
> I think this will work, at least for me ? Or will there be a 1.x that breaks this ?
No. Between major versions (going forward) it is supposed to suffice with recompiling.
> "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"