<div>Thanks! It wasn't a ghost in the machine after all.</div><div> </div><div>I was running Ubuntu 11.10 when this happened.<br><br></div><div class="gmail_quote">On Mon, Apr 2, 2012 at 9:00 AM, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>></span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">On Sat, 24 Mar 2012 15:03:41 -0500, Jack Cosgrove <<a href="mailto:jackcosgrove@gmail.com">jackcosgrove@gmail.com</a>><br>

wrote:<br>
<div class="im">> Update on this: I received further crashes with the code alteration I<br>
> produced. Upon further inspection it seemed that the error was occurring<br>
> not because the iterator had proceeded past the end of the raw_apis<br>
> string list, but rather because the iterator was initialized at a<br>
> location not within the range of the string list. That's consistent with<br>
> the behavior I observed, in that the crash would only occur the first<br>
> time function arguments were suggested after application startup. If the<br>
> location of the "it" iterator could be properly initialized somehow,<br>
> such as through the workaround user behavior in my first message, then<br>
> all subsequent function argument suggestions worked correctly.<br>
><br>
> With this code starting after line 658 in qsciapis.cpp<br>
><br>
> if (it < prep->raw_apis.begin())<br>
>             it = prep->raw_apis.begin();<br>
><br>
> I can avoid crashes. However the first time that function arguments<br>
> should be suggested nothing happens. All subsequent suggestions work<br>
> correctly.<br>
><br>
> Thanks to Phil and Gedalia for taking the time to help me.<br>
<br>
</div>I was able to reproduce this - it seems to be a Linux specific problem,<br>
and maybe even a compiler bug. My best workaround is to add...<br>
<br>
    prep->raw_apis.begin();<br>
<br>
...to the end of the autoCompletionSelected() method, just after the call<br>
to qLowerBound().<br>
<span class="HOEnZb"><font color="#888888"><br>
Phil<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Tue, 2012-03-20 at 12:20 +0000, Phil Thompson wrote:<br>
>> On Sat, 17 Mar 2012 12:58:48 -0500, Jack Cosgrove<br>
>> <<a href="mailto:jackcosgrove@gmail.com">jackcosgrove@gmail.com</a>><br>
>> wrote:<br>
>> > Hi,<br>
>> ><br>
>> > I am encountering crashes when I try to use autocomplete to fill in<br>
>> > function arguments using the Python lexer. For example, given an API<br>
>> > entry of "foo.bar(foo, bar)", I will always be prompted for foo and<br>
>> > bar,<br>
>> > but if I accept the autocompletion for "bar" and then type an opening<br>
>> > parenthesis my app crashes.<br>
>> ><br>
>> > Attached is a small example demonstrating this behavior. Type in<br>
"fo",<br>
>> > accept the suggestion, then ".", accept "bar", then "(" to replicate.<br>
>> ><br>
>> > However, if you type in "fo", accept, then ".bar(", then delete the<br>
>> > "(",<br>
>> > you can then type "(" again and encounter the function argument<br>
>> > suggestion. After this happens the first time the application never<br>
>> > crashes, even if replicating the first procedure on a new line.<br>
>> ><br>
>> > Thanks to all who reply for your help!<br>
>><br>
>> I can't reproduce this with current versions of QScintilla and Qt. What<br>
>> versions are you using?<br>
>><br>
>> Phil<br>
</div></div></blockquote></div><br>