Closed Bug 240036 Opened 20 years ago Closed 20 years ago

throwing invalid address causes internal error when tables locked

Categories

(Bugzilla :: User Accounts, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: kniht, Assigned: bugreport)

References

()

Details

Attachments

(2 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030630 Galeon/1.3.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030630 Galeon/1.3.8

if you specify an invalid address to the watch list it spews out an internal
error mssage


Reproducible: Always
Steps to Reproduce:
Attached file internal error msg (obsolete) —
This is the error message that was generated.
Attached file internal error msg
sorry, saved the wrong file the first time.
Attachment #145700 - Attachment is obsolete: true
yep
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.18
Attached patch Patch (obsolete) — Splinter Review
This was caused by calling DBNameToIDAndCheck() with tables locked.  When
DBNameToIDAndCheck throws an error, it fails to specify that tables should be
unlocked and the footer then dies.
Assignee: myk → bugreport
Status: NEW → ASSIGNED
Attachment #145742 - Flags: review?(justdave)
Yeah, sounds about right. I'm wondering

  - how this didn't bite us before
  - which callsite is exercising this callsite

Looking. Hmmm, wow. This comes all the way through 

  - the RelationSet constructor being called with a list of invalid IDs
  - mergeFromString calling DBNameToIdAndCheck with an invalid ID
  - DBNameToIdAndCheck throwing a user error

as to why this hasn't bit us before, I'm not entirely sure, given that at least
DBNameToIdAndCheck is called in a number of places. Perhaps there's validation
done before calling it, though.
Comment on attachment 145742 [details] [diff] [review]
Patch

Tested here and works as expected.

My only question is whether unlocking tables can have any adverse effect, given
that this function is used in a large number of callsites.
Attachment #145742 - Flags: review+
Since throwerror never returns to anything that writes to the DB, unlocking
should be fine.  Whatever operation originally wanted the DB locked would have
been abandoned at this point.
Flags: approval?
Comment on attachment 145742 [details] [diff] [review]
Patch

don't most other callsites use something that makes the meaning obvious like
"abort" or "unlock" in place of the 1 in the second param?
Flags: approval?
*** Bug 240366 has been marked as a duplicate of this bug. ***
Comment on attachment 145742 [details] [diff] [review]
Patch

review- per comment 8.	Just did a grep of the directory, and indeed, all the
other call sites use the string "abort" for the third param instead of a 1.
Attachment #145742 - Flags: review?(justdave) → review-
Attached patch v2Splinter Review
Attachment #145742 - Attachment is obsolete: true
Attachment #146686 - Flags: review?(justdave)
Attachment #146686 - Flags: review?(justdave) → review+
Flags: approval?
Flags: approval? → approval+
checked in
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
*** Bug 233124 has been marked as a duplicate of this bug. ***
A similar effect occurs if you enter non-numerical values for estimated hours.
So while you're at it, maybe you could change line 131 as well in a similar 
manner like

-ThrowUserError("need_numeric_value");
+ThrowUserError("need_numeric_value", "abort");

?
Marc, you should open a new bug for that.
Ok, we now have bug 246778 to address similar instances of this bug.
*** Bug 217344 has been marked as a duplicate of this bug. ***
Attachment #145700 - Attachment mime type: text/plain → text/html
Summary: invalid address causes internal error → throwing invalid address causes internal error when tables locked
Blocks: 276967
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: