Missing patch in R13B02-1 for fixing build time segmentation fault

View: New views
4 Messages — Rating Filter:   Alert me  

Missing patch in R13B02-1 for fixing build time segmentation fault

by Akira Kitada :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm resubmitting Michael Turner's patch which seemingly missed in
R13B02(-1) release.
The original report is below.
I confirmed this patch fixes the build issue in R13B02-1.

Please consider including this in the next release.

Thanks,
Akira

---------- Forwarded message ----------
From: Michael Turner <leap@...>
Date: Wed, Jul 29, 2009 at 5:34 PM
Subject: [erlang-bugs] R12B01 erl_misc_utils.c stack-trashing bug, + a patch
To: erlang-bugs@...



Was trying to build on a i386_unknown_freebsd4.10, with a gcc about 10
years old.  The build died in /lib/parsetools/src.  gdb revealed
revealed a trashed stack.

The source of the problem became clear after narrowing it down to a
function in erl_misc_utils.c.  There are assignments to mib[0] and
mib[1], with mib declared size zero. (Yes.  sizeof (mib) == 0.  The
first time I've ever seen that.  And the last, I hope.)

Dimension of 2 for mib[] seemed appropriate in context.  The build
continued after that fix.

==========

--- otp_src_R13B01/erts/lib_src/common/erl_misc_utils.c.~1~     Wed Jul 29
00:53:30 2009
+++ otp_src_R13B01/erts/lib_src/common/erl_misc_utils.c Tue Jul 28
22:17:45 2009
@@ -172,7 +172,7 @@ erts_cpu_info_update(erts_cpu_info_t *cp
 #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && (defined(HW_NCPU)
\
                                                       || defined(HW_AVAILCPU))
    {
-       int mib[0];
+       int mib[2];
       size_t len;

#ifdef HW_NCPU


________________________________________________________________
erlang-bugs mailing list. See http://www.erlang.org/faq.html
erlang-bugs (at) erlang.org

________________________________________________________________
erlang-patches mailing list. See http://www.erlang.org/faq.html
erlang-patches (at) erlang.org


Re: Missing patch in R13B02-1 for fixing build time segmentation fault

by Rickard Green :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hmm, I was sure that I had included this patch in an earlier release,
but obviously I had not. Sorry. I will be included in R13B03.

Regards,
Rickard
--
Rickard Green, Erlang/OTP, Ericsson AB.

Akira Kitada wrote:

> Hi,
>
> I'm resubmitting Michael Turner's patch which seemingly missed in
> R13B02(-1) release.
> The original report is below.
> I confirmed this patch fixes the build issue in R13B02-1.
>
> Please consider including this in the next release.
>
> Thanks,
> Akira
>
> ---------- Forwarded message ----------
> From: Michael Turner <leap@...>
> Date: Wed, Jul 29, 2009 at 5:34 PM
> Subject: [erlang-bugs] R12B01 erl_misc_utils.c stack-trashing bug, + a patch
> To: erlang-bugs@...
>
>
>
> Was trying to build on a i386_unknown_freebsd4.10, with a gcc about 10
> years old.  The build died in /lib/parsetools/src.  gdb revealed
> revealed a trashed stack.
>
> The source of the problem became clear after narrowing it down to a
> function in erl_misc_utils.c.  There are assignments to mib[0] and
> mib[1], with mib declared size zero. (Yes.  sizeof (mib) =0.  The
> first time I've ever seen that.  And the last, I hope.)
>
> Dimension of 2 for mib[] seemed appropriate in context.  The build
> continued after that fix.
>
> =======
> --- otp_src_R13B01/erts/lib_src/common/erl_misc_utils.c.~1~     Wed Jul 29
> 00:53:30 2009
> +++ otp_src_R13B01/erts/lib_src/common/erl_misc_utils.c Tue Jul 28
> 22:17:45 2009
> @@ -172,7 +172,7 @@ erts_cpu_info_update(erts_cpu_info_t *cp
>  #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && (defined(HW_NCPU)
> \
>                                                        || defined(HW_AVAILCPU))
>     {
> -       int mib[0];
> +       int mib[2];
>        size_t len;
>
> #ifdef HW_NCPU
>
>
> ________________________________________________________________
> erlang-bugs mailing list. See http://www.erlang.org/faq.html
> erlang-bugs (at) erlang.org
>


________________________________________________________________
erlang-patches mailing list. See http://www.erlang.org/faq.html
erlang-patches (at) erlang.org


Re: Re: Missing patch in R13B02-1 for fixing build time segmentation fault

by Håkan Mattsson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Sep 24, 2009 at 4:14 PM, Rickard Green
<rickard.s.green@...> wrote:
>  I will be included in R13B03.

I suspect that you do not fit into the next release. But you can always
try by including an experimental version of yourself without beard. ;-)

/Håkan

________________________________________________________________
erlang-patches mailing list. See http://www.erlang.org/faq.html
erlang-patches (at) erlang.org


Re: Missing patch in R13B02-1 for fixing build time segmentation fault

by Dan Gudmundsson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Rickard might have forgotten a t in a word but you forgot a meta-t
between Olddir Newdir.  I dont know what is worse :-)


2009/9/24, Håkan Mattsson <hakan@...>:

> On Thu, Sep 24, 2009 at 4:14 PM, Rickard Green
> <rickard.s.green@...> wrote:
>>  I will be included in R13B03.
>
> I suspect that you do not fit into the next release. But you can always
> try by including an experimental version of yourself without beard. ;-)
>
> /Håkan
>
> ________________________________________________________________
> erlang-patches mailing list. See http://www.erlang.org/faq.html
> erlang-patches (at) erlang.org
>
>

________________________________________________________________
erlang-patches mailing list. See http://www.erlang.org/faq.html
erlang-patches (at) erlang.org