Closed Bug 148897 Opened 22 years ago Closed 22 years ago

LDAP auth dialog box has bizarre text (egcs 1.1.2 codegen bug)

Categories

(MailNews Core :: LDAP Integration, defect, P2)

x86
Linux
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0.1

People

(Reporter: dmosedale, Assigned: dmosedale)

References

Details

(Whiteboard: [ADT2 RTM] [ETA 06/21])

Attachments

(1 file)

Configure an LDAP server to have a Bind DN currently only the 5/3/2002 and newer
trunk builds have this option).  In a nightly build, one sees:

"Please enter your password for authPromptText."

In a debug build, one sees the expected thing, where authPromptText is instead
the hostname of the LDAP server.

I'm fairly sure (though not yet 100%) this is not a packaging problem, because
if there were packing problems here, other strings would be busted too, I think.
Blocks: 148891
Status: NEW → ASSIGNED
Keywords: nsbeta1
Priority: -- → P3
Target Milestone: --- → mozilla1.0.1
Discussed in mail news bug meeting.  Decided to plus this bug.
Keywords: nsbeta1nsbeta1+
Whiteboard: [ADT2 RTM]
Priority: P3 → P2
OK, problem still exists in a debug tree built with egcs 1.1.2, so this is
neither a packaging nor an optimizer problem.  Looks like codegen.  Time to bust
out the debugger and disassemble...
Summary: LDAP auth dialog box has bizarre text (apparent egcs 1.1.2 optimizer bug) → LDAP auth dialog box has bizarre text (apparent egcs 1.1.2 codegen bug)
Attached patch patch, v1Splinter Review
Fix incorrect array length calculation & add temporary variable to work around
egcs bug.
Summary: LDAP auth dialog box has bizarre text (apparent egcs 1.1.2 codegen bug) → LDAP auth dialog box has bizarre text (egcs 1.1.2 codegen bug)
Comment on attachment 88385 [details] [diff] [review]
patch, v1

r=bryner
Attachment #88385 - Flags: review+
Comment on attachment 88385 [details] [diff] [review]
patch, v1

sr=bienvenu
Attachment #88385 - Flags: superreview+
This exact same patch (literally, the same patch file) also must be applied to
xpfe/components/autocomplete/src/nsLDAPAutoCompleteSession.cpp.  |patch -l|
should be used.
Fix checked into both of these files on the trunk.  Still needs to land on the
branch.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Are you sure egcs is the problem here?

-        const PRUnichar *hostArray[1] = { NS_ConvertASCIItoUCS2(host).get() };

That line of code is so bogus. The temporary object there and therefore its
internal buffer may have gone away on the line following it, leaving a dangling
pointer in hostArray. The solution you've used is the correct one. That it
happened to work with other compilers is pure luck.
Attachment #88385 - Flags: approval+
please checkin to the 1.0.1 branch. once there, remove the "mozilla1.0.1+"
keyword and add the "fixed1.0.1" keyword.
jag: the braces used to delimit an array-initializer also count as block scope?
 I didn't think that was the case, and I don't have my copy of Stroustrup handy
to check.  Ah well, either way the bug is fixed.
dding adt1.0.1+ on behalf of the adt for checkin to the 1.0 branch.  Please get
drivers approval before checking in. When you check this into the branch, please
change the mozilla1.0.1+ keyword to fixed1.0.1

Keywords: adt1.0.1adt1.0.1+
It's nothing to do with block scopes. Take for example

  const char* foopy = nsCString("foopy").get();

  printf("%s\n", foopy); // foopy at this point may be a dangling pointer.

See http://lxr.mozilla.org/seamonkey/source/string/doc/string-guide.html
Blocks: 143047
Whiteboard: [ADT2 RTM] → [ADT2 RTM] [ETA 06/21]
jag: Oh, right!  I see now; thanks.  I'll open another bug to fix the bogus
commentary that I've just added.  :-)

Committed to the branch.
Verified with 20020626 branch build on LINUX platform.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: