small patch for tv

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

small patch for tv

by Dmitriy Budashny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi  there
I've found some strange issue with tv while using stumpwm. tv was crashing while I was trying to load some table, so I got such output to my console:
### log begins here ###
=ERROR REPORT==== 22-Oct-2009::16:31:05 ===
Error in process <0.571.0> with exit value: {function_clause,[{lists,nthtail,[6,[]]},{tv_pg_gridfcns,resize_grid,3},{tv_pg,loop,1}]}

Internal error... restarting. 
10>  
=ERROR REPORT==== 22-Oct-2009::16:31:06 ===
Error in process <0.578.0> with exit value: {function_clause,[{lists,nthtail,[6,[]]},{tv_pg_gridfcns,resize_grid,3},{tv_pg,loop,1}]}

Internal error... restarting. 
### log ends here ###

So it continued restarting over and over again. The problem was with call to lists:nthtail(6,[]) which raised exception:
** exception error: no function clause matching lists:nthtail(6,[])
So I've made small changes to tv_pg_gridfcns.erl file. Patch attached.

--
wbr, dym



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

tv_pg_gridfcns.erl.patch (1K) Download Attachment

Re: small patch for tv

by Dmitriy Budashny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My last letter was written w/o testing for other problems, I've found there were other calls to lists:nthtail/2.
I've attached a new patch file in this letter

2009/10/22 Dmitriy Budashny <dmitriy.budashny@...>
Hi  there
I've found some strange issue with tv while using stumpwm. tv was crashing while I was trying to load some table, so I got such output to my console:
### log begins here ###
=ERROR REPORT==== 22-Oct-2009::16:31:05 ===
Error in process <0.571.0> with exit value: {function_clause,[{lists,nthtail,[6,[]]},{tv_pg_gridfcns,resize_grid,3},{tv_pg,loop,1}]}

Internal error... restarting. 
10>  
=ERROR REPORT==== 22-Oct-2009::16:31:06 ===
Error in process <0.578.0> with exit value: {function_clause,[{lists,nthtail,[6,[]]},{tv_pg_gridfcns,resize_grid,3},{tv_pg,loop,1}]}

Internal error... restarting. 
### log ends here ###

So it continued restarting over and over again. The problem was with call to lists:nthtail(6,[]) which raised exception:
** exception error: no function clause matching lists:nthtail(6,[])
So I've made small changes to tv_pg_gridfcns.erl file. Patch attached.

--
wbr, dym



--
wbr, dym



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

tv_pg_gridfcns.erl.patch (3K) Download Attachment

Re: small patch for tv

by Dmitriy Budashny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Guys, could you please have a look at this problem?
Maybe my patch is look like a workaround for a problem, but I just wanted to
point you at the existing situation.
Thanks in advance
PS: I didn't use new git-based mechanism of proposing patches, because as I
said it looks like a workaround for me and not a solution.

On Fri, Oct 23, 2009 at 10:39 AM, Dmitriy Budashny <
dmitriy.budashny@...> wrote:

> My last letter was written w/o testing for other problems, I've found there
> were other calls to lists:nthtail/2.
> I've attached a new patch file in this letter
>
> 2009/10/22 Dmitriy Budashny <dmitriy.budashny@...>
>
> Hi  there
>> I've found some strange issue with tv while using stumpwm. tv was crashing
>> while I was trying to load some table, so I got such output to my console:
>> ### log begins here ###
>> =ERROR REPORT==== 22-Oct-2009::16:31:05 ===
>> Error in process <0.571.0> with exit value:
>> {function_clause,[{lists,nthtail,[6,[]]},{tv_pg_gridfcns,resize_grid,3},{tv_pg,loop,1}]}
>>
>> Internal error... restarting.
>> 10>
>> =ERROR REPORT==== 22-Oct-2009::16:31:06 ===
>> Error in process <0.578.0> with exit value:
>> {function_clause,[{lists,nthtail,[6,[]]},{tv_pg_gridfcns,resize_grid,3},{tv_pg,loop,1}]}
>>
>> Internal error... restarting.
>> ### log ends here ###
>>
>> So it continued restarting over and over again. The problem was with call
>> to lists:nthtail(6,[]) which raised exception:
>> ** exception error: no function clause matching lists:nthtail(6,[])
>> So I've made small changes to tv_pg_gridfcns.erl file. Patch attached.
>>
>> --
>> wbr, dym
>>
>
>
>
> --
> wbr, dym
>



--
wbr, dym

Re: Re: small patch for tv

by Max Lapshin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Dec 1, 2009 at 9:43 AM, Dmitriy Budashny
<dmitriy.budashny@...> wrote:
> PS: I didn't use new git-based mechanism of proposing patches, because as I
> said it looks like a workaround for me and not a solution.

Dmitry, how do you think, erlang team, will apply your patch, if they
have already migrated to git?
Maybe it is the time to stop using CVS?

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


Re: Re: small patch for tv

by Dmitriy Budashny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Dec 1, 2009 at 9:00 AM, Max Lapshin <max.lapshin@...> wrote:

> On Tue, Dec 1, 2009 at 9:43 AM, Dmitriy Budashny
> <dmitriy.budashny@...> wrote:
> > PS: I didn't use new git-based mechanism of proposing patches, because as
> I
> > said it looks like a workaround for me and not a solution.
>
> Dmitry, how do you think, erlang team, will apply your patch, if they
> have already migrated to git?
>
Actually I didn't see any changes were done on the exact file, so I don't
see any difference to pull it from git or to take it from the released
archive file. (correct me if I've mistaken)
Btw, yes I can branch from git, made a patch there, send a link. But
1) I didn't see any attention before, so I don't know if the other mail will
be not directing towards /dev/null
2) I think about my patch as a workaround for problem which points to the
exact places in code which do the harm
And answer to your question: no I don't think so. But if I will see any
words about `redo it in git`, I'll do so w/o any probs.


> Maybe it is the time to stop using CVS?
>

Ehhh, is there any context for such a question?
--
wbr, dym

Re: Re: small patch for tv

by Dan Gudmundsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have seen your email but havn't had time to look at the patch yet, sorry.
Git-patches are preferred in the future, it's simpler and we hopefully
won't forget them,
but even with git-patches we must have time to take a look them.

/Dan

On Tue, Dec 1, 2009 at 8:44 AM, Dmitriy Budashny
<dmitriy.budashny@...> wrote:

> On Tue, Dec 1, 2009 at 9:00 AM, Max Lapshin <max.lapshin@...> wrote:
>
>> On Tue, Dec 1, 2009 at 9:43 AM, Dmitriy Budashny
>> <dmitriy.budashny@...> wrote:
>> > PS: I didn't use new git-based mechanism of proposing patches, because as
>> I
>> > said it looks like a workaround for me and not a solution.
>>
>> Dmitry, how do you think, erlang team, will apply your patch, if they
>> have already migrated to git?
>>
> Actually I didn't see any changes were done on the exact file, so I don't
> see any difference to pull it from git or to take it from the released
> archive file. (correct me if I've mistaken)
> Btw, yes I can branch from git, made a patch there, send a link. But
> 1) I didn't see any attention before, so I don't know if the other mail will
> be not directing towards /dev/null
> 2) I think about my patch as a workaround for problem which points to the
> exact places in code which do the harm
> And answer to your question: no I don't think so. But if I will see any
> words about `redo it in git`, I'll do so w/o any probs.
>
>
>> Maybe it is the time to stop using CVS?
>>
>
> Ehhh, is there any context for such a question?
> --
> wbr, dym
>

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


Re: Re: small patch for tv

by Björn Gustavsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Dec 1, 2009 at 8:44 AM, Dmitriy Budashny
<dmitriy.budashny@...> wrote:
> On Tue, Dec 1, 2009 at 9:00 AM, Max Lapshin <max.lapshin@...> wrote:
>
>> On Tue, Dec 1, 2009 at 9:43 AM, Dmitriy Budashny

> Btw, yes I can branch from git, made a patch there, send a link. But
> 1) I didn't see any attention before, so I don't know if the other mail will
> be not directing towards /dev/null

Except for obviously wrong or inappropriate patches, we will include
everything in the 'pu' branch. See
http://wiki.github.com/erlang/otp/submitting-patches

> 2) I think about my patch as a workaround for problem which points to the
> exact places in code which do the harm

By submitting in your patch in git, it will be much easier for everyone
else to testing your patch and the patch will be listed in "What's cooking in
erlang/otp", so it will not be forgotten.

If you also could provide some instructions how to reproduce the problem,
it would help to find the real problem (please put all information in the commit
message)

> And answer to your question: no I don't think so. But if I will see any
> words about `redo it in git`, I'll do so w/o any probs.

Please redo it in git. :)

Actually, I would suggest copying nthtail/2 from lists and modify it
like this (NOT TESTED):

safe_nthtail(_, []) -> [];
safe_nthtail(1, [_|T]) -> T;
safe_nthtail(N, [_|T]) when N > 1 ->
    safe_nthtail(N - 1, T);
safe_nthtail(0, L) when is_list(L) -> L.

rather than traversing the list twice.

--
Björn Gustavsson, Erlang/OTP, Ericsson AB

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


Parent Message unknown Re: Re: small patch for tv

by Björn Gustavsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/12/1 Dmitriy Budashny <dmitriy.budashny@...>:
> 2009/12/1 Björn Gustavsson <bgustavsson@...>
>
> git fetch git://github.com/dym/otp.git tv_nthtail_fix
>

Thanks! Pulled and included in the 'pu' branch.

I cannot reproduce the problem. I assume it has something
to do with your window manager.

We'll let it in cook in the 'pu' branch for a while.

Unless someone finds any problem with the fix or a better
way to correct the bug, I think we should include this fix
in the R13B04 release.

--
Björn Gustavsson, Erlang/OTP, Ericsson AB

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