From rich.neswold@REDACTED Wed Jun 15 14:10:54 2005 From: rich.neswold@REDACTED (Rich Neswold) Date: Wed, 15 Jun 2005 07:10:54 -0500 Subject: Bug with localtime_r()? Message-ID: <14cf844b05061505102c7c367c@mail.gmail.com> Hello, I'm running R10B-5 on my NetBSD 2.0.2 system. I noticed that erlang:localtime() was returning UTC time. It turns out that 'configure' detects localtime_r() on my system and uses it. However, on NetBSD, the man page says: "localtime_r() does not imply initialization of the local time conversion information; the application may need to do so by calling tzset(3)." Looking through the BEAM source, I couldn't find any reference to tzset(3) so I added it to the emulator initialization. The man page didn't seem to imply that each thread needed to call it, so I didn't try to put tzset() in the process initialization code. I rebuilt my OTP installation using the following patch, and now the localtime functions work: --- erts/emulator/sys/unix/sys.c.orig 2005-06-14 23:25:38.000000000 -0500 +++ erts/emulator/sys/unix/sys.c 2005-06-14 23:28:11.000000000 -0500 @@ -33,6 +33,10 @@ #include #include +#ifdef HAVE_LOCALTIME_R +#include +#endif + #if !defined(USE_SELECT) # ifdef HAVE_POLL_H @@ -428,6 +432,9 @@ if (isatty(0)) { tcgetattr(0,&initial_tty_mode); } +#ifdef HAVE_LOCALTIME_R + tzset(); +#endif } -- Rich AIM : rnezzy ICQ : 174908475 From rich.neswold@REDACTED Thu Jun 16 17:52:31 2005 From: rich.neswold@REDACTED (Rich Neswold) Date: Thu, 16 Jun 2005 10:52:31 -0500 Subject: Bug with localtime_r()? In-Reply-To: <14cf844b05061505102c7c367c@mail.gmail.com> References: <14cf844b05061505102c7c367c@mail.gmail.com> Message-ID: <14cf844b05061608525dff3bf@mail.gmail.com> On 6/15/05, Rich Neswold wrote: > I rebuilt my OTP installation using the following patch, and now the > localtime functions work: Sorry for the extra traffic, but I wasn't subscribed to the -patches mailing list (I am now.) I missed the replies (if any) to my patch and there doesn't appear to be an archive for -patches. If there was an response, could the author please resend it to me directly? I'll then be caught up and subscribed. Thanks! -- Rich AIM : rnezzy ICQ : 174908475 From raimo@REDACTED Fri Jun 17 09:25:20 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 17 Jun 2005 09:25:20 +0200 Subject: Bug with localtime_r()? References: <14cf844b05061505102c7c367c@mail.gmail.com>, <14cf844b05061608525dff3bf@mail.gmail.com> Message-ID: Sorry, there was no response, but here it comes! We did not manage to get it into R10B-6 about to be released, but it will be in the next release. We have to make some modifications and test thoroughly that it does not break anything on any of our commercial platforms. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From daniel.neri@REDACTED Fri Jun 17 10:16:28 2005 From: daniel.neri@REDACTED (=?ISO-8859-1?Q?Daniel_N=E9ri?=) Date: Fri, 17 Jun 2005 10:16:28 +0200 Subject: Bug with localtime_r()? In-Reply-To: <14cf844b05061608525dff3bf@mail.gmail.com> References: <14cf844b05061505102c7c367c@mail.gmail.com> <14cf844b05061608525dff3bf@mail.gmail.com> Message-ID: <3036fece0506170116e09e7b9@mail.gmail.com> On 16/06/05, Rich Neswold wrote: > there doesn't appear to be an archive for -patches. There is an archive, but it's not linked from the contact page: http://www.erlang.org/ml-archive/erlang-patches/ It's also available on Gmane (HTTP or NNTP): http://news.gmane.org/gmane.comp.lang.erlang.patches/ Regards, -- Daniel N?ri daniel.neri@REDACTED From rich.neswold@REDACTED Fri Jun 17 16:04:33 2005 From: rich.neswold@REDACTED (Rich Neswold) Date: Fri, 17 Jun 2005 09:04:33 -0500 Subject: Bug with localtime_r()? In-Reply-To: References: <14cf844b05061505102c7c367c@mail.gmail.com> <14cf844b05061608525dff3bf@mail.gmail.com> Message-ID: <14cf844b050617070413334aa8@mail.gmail.com> On 17 Jun 2005 09:25:20 +0200, Raimo Niskanen wrote: > We did not manage to get it into R10B-6 about to be released, but > it will be in the next release. We have to make some modifications > and test thoroughly that it does not break anything on any of our > commercial platforms. Sounds good! Thanks! -- Rich AIM : rnezzy ICQ : 174908475 From rich.neswold@REDACTED Fri Jun 17 16:05:50 2005 From: rich.neswold@REDACTED (Rich Neswold) Date: Fri, 17 Jun 2005 09:05:50 -0500 Subject: Bug with localtime_r()? In-Reply-To: <3036fece0506170116e09e7b9@mail.gmail.com> References: <14cf844b05061505102c7c367c@mail.gmail.com> <14cf844b05061608525dff3bf@mail.gmail.com> <3036fece0506170116e09e7b9@mail.gmail.com> Message-ID: <14cf844b050617070517ad801f@mail.gmail.com> On 6/17/05, Daniel N?ri wrote: > On 16/06/05, Rich Neswold wrote: > > there doesn't appear to be an archive for -patches. > > There is an archive, but it's not linked from the contact page: > > http://www.erlang.org/ml-archive/erlang-patches/ I'll hang on to this link. Thank you! -- Rich AIM : rnezzy ICQ : 174908475 From ViktorPracht@REDACTED Tue Jun 21 17:37:22 2005 From: ViktorPracht@REDACTED (Viktor Pracht) Date: Tue, 21 Jun 2005 17:37:22 +0200 (MEST) Subject: Bug in erl_term_len() Message-ID: <32460.1119368242@www49.gmx.net> Hello The erl_interface function erl_term_len() reports a wrong size for functions with parameters (it doesn't count the byte that specifies the arity). Here's a patch: --- erl_marshal(original).c 2005-04-07 08:11:42.000000000 +0200 +++ erl_marshal.c 2005-06-21 17:08:31.808018328 +0200 @@ -545,7 +545,7 @@ for (i = 0; i < ERL_CLOSURE_SIZE(ep); i++) len += erl_term_len_helper(ERL_CLOSURE_ELEMENT(ep,i), dist); } else { - len = 1 + 4 + 16 + 4 + 4; + len = 1 + 1 + 4 + 16 + 4 + 4; len += erl_term_len_helper(ERL_FUN_MODULE(ep),dist); len += erl_term_len_helper(ERL_FUN_INDEX(ep),dist); len += erl_term_len_helper(ERL_FUN_UNIQ(ep),dist); - Viktor Pracht -- Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis ++ Jetzt anmelden & testen ++ http://www.gmx.net/de/go/promail ++