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)
-----------------------------------------------------------------------------------------
}
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).
As a consequence
1) documentation became incorrect (at least
http://www.erlang.org/doc/man/driver_entry.html where extended_marker
is still allowed to be 0);
2) example from http://www.erlang.org/doc/tutorial/c_portdriver.html
doesn't work anymore;
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.)
Cheers!
--
Sergei Golovan
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
Yaws is already fixed on master at github: https://github.com/klacke/yaws .
--steve
Den 15 dec 2011 16:45 skrev "Sergei Golovan" <sgol...@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.
> ----
...
/Kenneth, Erlang/OTP Ericsson
I must've missed this in highlights. Ok then, lets fix the applications.
_______________________________________________
You must rebuild it with Erlang R15B to work.
Cheers!
--
Sergei Golovan
Works now ... may thanks.
I've also copied the package author.
Regards,
Zabrane
On Dec 16, 2011, at 7:39 AM, Andrew Tunnell-Jones wrote:
> On Fri, Dec 16, 2011 at 5:32 AM, Zabrane Mickael <zabr...@gmail.com> wrote:
>>
>> After installing R15B (OSX 10.6.8), this module no longer works for me:
>> https://github.com/alexeyr/erlang-sqlite3
>>
>> 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"}},
>>
>> The driver seems to include the MAJOR/MINOR markers:
>> https://github.com/alexeyr/erlang-sqlite3/blob/master/c_src/sqlite3_drv.c
>>
>> Any Help?
>>
>
> Line 27 should have ERL_DRV_EXTENDED_MINOR_VERSION in place of
> ERL_DRV_EXTENDED_MAJOR_VERSION.
>
> — Andrew
Yours, Alexey Romanov
http://www.erlang.org/doc/man/erl_driver.html#rewrites_for_64_bits
/Sverker, Erlang/OTP
Yours, Alexey Romanov
No. Between major versions (going forward) it is supposed to suffice
with recompiling.
>
> /Tony
>
>
>
> On 25 jan 2012, at 07:17, Alexey Romanov wrote:
>
> > Thank you! I'll try to fix it this or next month, when I have time.
> >
> > Yours, Alexey Romanov
> >
> >
> >
> > On Fri, Dec 16, 2011 at 5:46 PM, Sverker Eriksson
> > <sve...@erix.ericsson.se> wrote:
> >>
> >>> You must rebuild it with Erlang R15B to work.
> >>>
> >>
> >> Not just rebuild:
> >>
> >> http://www.erlang.org/doc/man/erl_driver.html#rewrites_for_64_bits
> >>
> >>
> >> /Sverker, Erlang/OTP
> >>
> >>
> >>
> >> _______________________________________________
> >> erlang-questions mailing list
> >> erlang-q...@erlang.org
> >> http://erlang.org/mailman/listinfo/erlang-questions
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-q...@erlang.org
> > http://erlang.org/mailman/listinfo/erlang-questions
>
> "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"
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions
--
/ Raimo Niskanen, Erlang/OTP, Ericsson AB