Closed Bug 41996 Opened 24 years ago Closed 24 years ago

nsCmdLineService::GetCmdLineValue needs to clone aResult

Categories

(Core Graveyard :: Cmd-line Features, defect, P3)

All
Mac System 8.5
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sfraser_bugs, Assigned: alecf)

Details

(Keywords: crash, Whiteboard: [nsbeta-]fix in hand)

Attachments

(1 file)

nsCmdLineService::GetCmdLineValue returns a char*, but, since its an XPCOM 
interface, it should clone the result.

Currently, the call to this function in LaunchApplicationWithArgs():

  nsXPIDLCString cmdResult;
  rv = cmdLineArgs->GetCmdLineValue(commandLineArg, getter_Copies(cmdResult));

is causing a double deletion.

However, there are a bunch of places that call GetCmdLineValue() without deleting 
the result. These need to be fixed.
cc bruce
BTW, this double deletion is causing various crashes on quit for me.
ohh!! I've been trying to figure this out all evening. Thanks for tracking this 
down simon.. I'm getting lots of assertions/crashes as well.

Nominate for beta2 - this makes the app crash on exit
Keywords: nsbeta2
alecf: can I give this to you? You should fix callers of GetCmdLineValue who 
don't delete the string to do so, after fixing the bug itself.
Assignee: sfraser → alecf
sure :)
-The Mozilla Janitor
Status: NEW → ASSIGNED
Attaching the patch.

Adding crash keyword because I'm realizing this can cause random crashes 
throughout the app as well.

Adding the dogfood keyword because this has been preventing me from running 
purify on mail. (because purify will not report results if the app crashes)
Keywords: crash, dogfood
Whiteboard: fix in hand
this may be causing bug 41339 too. alecf, can you check into M16 too?
Putting on [dogfood+][nsbeta2-] radar.
Whiteboard: fix in hand → [dogfood+][nsbeta-]fix in hand
fix is in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
fix checked into the branch as well.
i hereby apply rubberstamp verification. :-) spoke w/simon --this is a codelevel
fix that's tricky to verify for an enduser (dunno why this was labelled dogfood,
so removing that kw).
Status: RESOLVED → VERIFIED
Keywords: dogfood
Whiteboard: [dogfood+][nsbeta-]fix in hand → [nsbeta-]fix in hand
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: