Closed Bug 556309 Opened 10 years ago Closed 3 years ago

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

Categories

(Core :: Plug-ins, defect, minor)

defect
Not set
minor

Tracking

()

RESOLVED INCOMPLETE
mozilla1.9.3a5

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity, memory-leak)

Attachments

(1 file, 2 obsolete files)

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);
Attached patch if we do it, others will do it (obsolete) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #436218 - Flags: review?(jst)
1540   STRINGZ_TO_NPVARIANT(strdup(value.str().c_str()), *result);
Attached patch with the straggler (obsolete) — Splinter Review
Attachment #436218 - Attachment is obsolete: true
Attachment #436219 - Flags: review?(jst)
Attachment #436218 - Flags: review?(jst)
Attachment #436219 - Flags: review?(jst) → review+
Attachment #436219 - Attachment is obsolete: true
Attachment #440535 - Flags: review+
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
Closed: 10 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).
Resolving old bugs which are likely not relevant any more, since NPAPI plugins are deprecated.
Status: REOPENED → RESOLVED
Closed: 10 years ago3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.