tom connolly rob liddel scott lucas. © 2008 tom connolly, rob liddel, and scott lucas this...

23
Tom Connolly Rob Liddel Scott Lucas

Upload: coral-little

Post on 13-Jan-2016

217 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Tom ConnollyRob Liddel

Scott Lucas

Page 2: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

© 2008 Tom Connolly, Rob Liddel, and Scott LucasThis presentation is Copyrighted by Tom Connolly,

Rob Liddel, and Scott LucasThis presentation is distributed under the Creative

Commons Attribution License 3.0:

http://creativecommons.org/licenses/by/3.0

You are free to Reuse and Remix, provided that you give credit to the authors

Page 3: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Agenda

IntroductionProcessBug DiscussionFirst Impressions of Open SourceConclusion

Page 4: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Introduction

GoalImmerse ourselves in an open source

communityBe able to accomplish something and

contribute in a meaningful wayTo understand the scope of a established open

source project and the difficulty inherent to entering

Page 5: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

ProcessDecide on a project Enter the community

Download the source code

Join the mailing listDiscover and discuss

possible bugsSquash the bugsContribute fixes back

to the community

Page 6: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and
Page 7: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Improve Print() in JavaBug #0007886

C++ version of Print()Starts by printing class name and addressUseful when debugging

Java version of Print()Class name and address are not as useful when

debuggingNeed information about the Java objects

Page 8: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Process

Found and examined the Print() function Upon rereading the description, saw that

a .patch file was supplied and that the problem had already been solved

Learned about .patch filesReviewed .patch changes and confirmed that

the changes were correct

Page 9: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Solution/CommentsSolution Comments

In actuality, the solution was already solved

Nothing additional needed to be done

Bugs that have been fixed need to be marked appropriately

Time would have been better allocated working on a new bug

Page 10: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Consolidate getline functionsBug #0006446

Multiple “my_getline” functions are declared in various .cxx files

Place function in separate file

Page 11: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Process

Located the different my_getline functionsExamine discrepancies between different

versions of the functionCreate the new my_getline functionUpdate existing files and test

Page 12: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Solution/CommentsSolution Comments

Reached by examining various versions of the function

Simple to implement, given that it is already written

Tough to fix existing code

Currently testing the fix

Early identification of issue would have saved time

Page 13: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Fix QVtkWidgetBug #0007065

Uses key presses as intReferences an array of size 256Only checked for non negative valuesPotential for array reference with too large a

number

Page 14: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Process

Found and examined the ascii_to_key_sym() function

Examined array being referencedReplaced logic to check for both upper and

lower boundsTested the changes for expected outcomes

Page 15: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Solution/CommentsSolution Comments

Relatively basic Could have been avoided if initial implementation had been better tested

Shows importance of bounds checking for both upper and lower bounds

Page 16: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Fix Boundary representationBug #0007760

vtkImplicitPlaneRepresentation Edges Property Not Set Important for when a plane intersects with

boundaryBug submission provided a proposed solution

Lack of function understanding led to question of if this would actually work

Required extensive testing that is ongoing

Page 17: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Process

Found and located area of proposed changeExamined structure of related actorsMade proposed changeTested

Page 18: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Solution/CommentsSolution Comments

Implement proposed correction

Test with various scenarios

Difficult to fix a bug if you do not know what you think you are fixing works

Still not assured that the fix works all of the time

Page 19: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Stop vtkVariant CrashesBug #0006851vtkObject* o = NULL;

vtkVariant v(o); // <- crashesAlso a

vtkVariant v(NULL);gives me a compiler warningwarning: passing NULL to non-pointer argument 1 of ‘vtkVariant::vtkVariant(long int)’

Page 20: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

ProcessContact the reporter of the bug to request

additional information.Turns out that the reporter abandoned the

approach which led to this bug and took a different route. However he was still interested in a fix.

Locate possible crash locations in vtkVariant.cxx

Implement fixes and testForward results to reporter

Page 21: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Solution/CommentsSolution CommentsThe fix was as simple as

adding a conditional statement which checked to see if the constructor parameter was a null pointer

Unfortunately, the testing files do not directly test the vtkVariant.cxx file, so the bug is not caught by automatic testing

Makes one wonder how often implementations are dropped due to simple mistakes

If subversion is used to save previous testing files, this sort of problem becomes a matter of matching the bug’s report date with the version of the source code. Source control becomes key for large, long term projects

Page 22: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

First Impressions of Open Source

Accessing the source code is simple, but fixing foreign code is tough

Lack of experience lowered overall efficiencyThe current design of VTK’s bug tracking is

unfriendly to newcomers

Page 23: Tom Connolly Rob Liddel Scott Lucas. © 2008 Tom Connolly, Rob Liddel, and Scott Lucas This presentation is Copyrighted by Tom Connolly, Rob Liddel, and

Conclusion

Experience we have gained will increase our efficiency in the future open source projects we work on

Organization and communication are keyStrength in numbers