patchgnats - Patches: patch #4511, patch to fix gnats crash when...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4511: patch to fix gnats crash when trying to lock a PR not in the index

Submitter:  None
Submitted:  Wed 12 Oct 2005 06:53:51 PM UTC
   
 
Category:  None Priority:  7 - High
Status:  Done Privacy:  Public
Assigned to:  amanou Originator Email:  -email is unavailable-
Open/Closed:  Closed

Fri 23 Dec 2005 05:26:47 AM UTC, comment #2: 

Rolled in to CVS.

Chad C. Walstrom <chewie>
Group administrator
Mon 17 Oct 2005 04:34:27 PM UTC, comment #1: 

Gnats PR that this patch fixes is: pending/504

Anonymous
Wed 12 Oct 2005 06:53:51 PM UTC, original submission:  

How to reproduce the problem:
(my system has hundreds of PRs, but no PR by the number 2)

./pr-edit --lock=alex@alex --process=28665 2

Cannot allocate 4294967294 bytes after allocating 6172172 bytes

$ ./gnatsd
200 gnats GNATS server 4.0.5.0-JNPR ready.
user alex *
210-Now accessing GNATS database 'default'
210 User access level set to 'edit'
gnatsd: user 'alex' connected to database default
lock 2 alex 1234

Cannot allocate 4294967294 bytes after allocating 6279808 bytes

Reason for the crash is that function getCategoryFromIndex gets caled from get_pr_path, when the PR has been found not to be in the index!

Attached is a diff to the head branch of gnats. It only involves files under gnats/ds-file/ : index.h index.c pr.c                                          
                                                                               
The patch does the following:                                                  
deprecates 3 functions which are useless nowdays:                                     
- getCategoryFromIndex                                                         
- findPrCategoryBinary
- findPrCategory                                       
                                                                               
Modifies get_pr_path so that it does nothing when a PR is not found in the index, instead of calling getCategoryFromIndex.
Also removed the 4rth argument from get_pr_path since it's now unneeded.
With my fix, get_pr_path will return NULL and the error is handed correctly later on. (the user gets the message: "No PR 2 listed in the index")

Thanks,
Alex Manoussakis

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #7982:  gnats-head.diff added by None (5KiB - text/x-patch - Patch to fix gnats crash when trying to lock a PR not in the index)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 7 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-23 chewie Open/ClosedOpen Closed
2005-11-07 chewie Assigned toNone amanou
2005-11-07 amanou StatusNone Done
    Carbon-Copy- Added amanou
    Carbon-Copy- Added chewie
2005-10-12 None Attached File- Added gnats-head.diff, #5317
    Carbon-Copy- Added amm2 --AT-- andrew --DOT-- cmu --DOT-- edu

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code