getError with STRINGZ_TO_NPVARIANT macro evaluates argument (strdup) more than once

RESOLVED INCOMPLETE

Status

()

Core
Plug-ins
--
minor
RESOLVED INCOMPLETE
8 years ago
11 days ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

(Blocks: 1 bug, {coverity, memory-leak})

Trunk
mozilla1.9.3a5
coverity, memory-leak
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

8 years ago
199 #define STRINGZ_TO_NPVARIANT(_val, _v)                                    \
200 NP_BEGIN_MACRO                                                            \
201     (_v).type = NPVariantType_String;                                     \
202     NPString str = { _val, strlen(_val) };                                \
203     (_v).value.stringValue = str;                                         \
204 NP_END_MACRO

1994 getError(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result)

2002     STRINGZ_TO_NPVARIANT(strdup(SUCCESS_STRING), *result);
2004     STRINGZ_TO_NPVARIANT(strdup(id->err.str().c_str()), *result);
(Assignee)

Comment 1

8 years ago
Created attachment 436218 [details] [diff] [review]
if we do it, others will do it
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #436218 - Flags: review?(jst)
(Assignee)

Comment 2

8 years ago
1540   STRINGZ_TO_NPVARIANT(strdup(value.str().c_str()), *result);
(Assignee)

Comment 3

8 years ago
Created attachment 436219 [details] [diff] [review]
with the straggler
Attachment #436218 - Attachment is obsolete: true
Attachment #436219 - Flags: review?(jst)
Attachment #436218 - Flags: review?(jst)

Updated

8 years ago
Attachment #436219 - Flags: review?(jst) → review+
(Assignee)

Comment 4

8 years ago
Created attachment 440535 [details] [diff] [review]
updated for bitrot
Attachment #436219 - Attachment is obsolete: true
Attachment #440535 - Flags: review+
(Assignee)

Updated

8 years ago
Keywords: checkin-needed
http://tinderbox.mozilla.org/showlog.cgi?log=MozillaTry/1272517934.1272531788.13260.gz&fulltext=1#err4

This fails 7 mochi's when run in try...

158359 ERROR TEST-UNEXPECTED-FAIL | /tests/modules/plugin/test/test_pluginstream_err.html | plugin reported an error - got "", expected "pass"

All the same test. From skimming the code I have no idea what is wrong though.
http://hg.mozilla.org/mozilla-central/rev/1052ee218ba6
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
backed out

TEST-UNEXPECTED-FAIL | /tests/modules/plugin/test/test_pluginstream_err.html | plugin reported an error - got "", expected "pass"

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1272801999.1272802715.25601.gz

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1272799147.1272801551.11845.gz

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1272799147.1272800986.10195.gz
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I don't see the problem, but you could try pushing the pieces of the patch to try separately.
Also worth noting that the failures were only on Windows; other platforms were fine (and I checked that the test was successfully run in the Mac log).

Comment 10

a year ago
Resolving old bugs which are likely not relevant any more, since NPAPI plugins are deprecated.
Status: REOPENED → RESOLVED
Last Resolved: 8 years agoa year ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.