[Bug 410736] New: User ID check in J-Pilot fails on every sync when it is > = 2^31 on 64-bit systems, prompting the user on each sync
https://bugzilla.novell.com/show_bug.cgi?id=410736 Summary: User ID check in J-Pilot fails on every sync when it is >= 2^31 on 64-bit systems, prompting the user on each sync Product: openSUSE 11.0 Version: Final Platform: x86-64 OS/Version: openSUSE 11.0 Status: NEW Severity: Normal Priority: P5 - None Component: Mobile Devices AssignedTo: zoz@novell.com ReportedBy: slawrance@yahoo.com QAContact: qa@suse.de Found By: Customer The user ID check in J-Pilot unfortunately fails on every sync on a two's-complement 64-bit system when the user ID is >= 2^31. The user ID in the Palm and in the data structures is unsigned, but it's signed in some local variables and in the logs. The user ID on the Palm appears to be a 32-bit number, but on x86_64, a negative number loaded from the configuration gets loaded into a 64-bit integer with two's complement. Instead of the 32 most significant bits being 0, they are 1. When the integer check from the Palm with the last-known value is compared, the comparison fails. This was difficult to detect from the logs, which wrote out the 64-bit integers using a 32-bit printf() format argument. I fixed this by forcing unsigned wherever user IDs and computer IDs were referenced (computer ID had a similar potential issue). Ideally, the IDs should be locked to uint32_t, but my patch to simply use unsigned everywhere worked for me, so I didn't bother with the data type change. In J-Pilot 0.99.9-198.1, I would always see the attached screen shot with the following messages logged: Last Synced Username-->"Steven Lawrance" Last Synced UserID-->"-1093343998" This Username-->"Steven Lawrance" This User ID-->-1093343998 Username is "Steven Lawrance" User ID is -1093343998 lastSyncPC = 111726531 This PC = 111726531 After my fix, which I attached as a patch, the first sync produced the following message and the same attached warning message: Last Synced Username-->"Steven Lawrance" Last Synced UserID-->"18446744072616207618" This Username-->"Steven Lawrance" This User ID-->3201623298 Username is "Steven Lawrance" User ID is 3201623298 lastSyncPC = 111726531 This PC = 111726531 After that first sync, subsequent syncs worked without the user warning :-). Furthermore, the ~/.jpilot/jpilot.rc file's user_id is no longer negative on my 64-bit system (I suspect that this will still be negative on a 32-bit system, but that should be okay). Username is "Steven Lawrance" User ID is 3201623298 lastSyncPC = 111726531 This PC = 111726531 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=410736 User slawrance@yahoo.com added comment https://bugzilla.novell.com/show_bug.cgi?id=410736#c1 --- Comment #1 from Steven Lawrance <slawrance@yahoo.com> 2008-07-20 16:32:42 MDT --- Created an attachment (id=228945) --> (https://bugzilla.novell.com/attachment.cgi?id=228945) Patch to use unsigned integers for user and computer ID in all places instead of signed The configuration file loading and saving, however, still uses a signed long, but that should be okay because any positive unsigned 32-bit number will still be positive in a 64-bit signed integer. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=410736 User slawrance@yahoo.com added comment https://bugzilla.novell.com/show_bug.cgi?id=410736#c2 --- Comment #2 from Steven Lawrance <slawrance@yahoo.com> 2008-07-20 16:33:33 MDT --- Created an attachment (id=228946) --> (https://bugzilla.novell.com/attachment.cgi?id=228946) Screen shot of the user ID mismatch warning that I used to get on every sync before my patch -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=410736 User slawrance@yahoo.com added comment https://bugzilla.novell.com/show_bug.cgi?id=410736#c3 --- Comment #3 from Steven Lawrance <slawrance@yahoo.com> 2008-07-20 16:34:51 MDT --- Created an attachment (id=228947) --> (https://bugzilla.novell.com/attachment.cgi?id=228947) Updated spec file for jpilot-0.99.9-198.2, which includes my patch -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=410736 User slawrance@yahoo.com added comment https://bugzilla.novell.com/show_bug.cgi?id=410736#c4 --- Comment #4 from Steven Lawrance <slawrance@yahoo.com> 2008-07-21 08:28:01 MDT --- Apparently, I still get the following message on the first sync after restarting J-Pilot. I'll need to probably go ahead with the approach of using uint32_t for user ID and computer ID. I can send an updated patch shortly after making that change in the near future.. Last Synced Username-->"Steven Lawrance" Last Synced UserID-->"18446744072616207618" This Username-->"Steven Lawrance" This User ID-->3201623298 Username is "Steven Lawrance" User ID is 3201623298 lastSyncPC = 111726531 This PC = 111726531 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=410736 User slawrance@yahoo.com added comment https://bugzilla.novell.com/show_bug.cgi?id=410736#c5 Steven Lawrance <slawrance@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #228945|0 |1 is obsolete| | --- Comment #5 from Steven Lawrance <slawrance@yahoo.com> 2008-07-22 00:52:25 MDT --- Created an attachment (id=229233) --> (https://bugzilla.novell.com/attachment.cgi?id=229233) Latest version of the patch, which fixes the warning on the first sync I now have a new version of the patch, which clears out the most significant bits above the 32 least significant bits with a cast to uint32_t. It works for me now :-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=410736 Danny Kukawka <dkukawka@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dkukawka@novell.com AssignedTo|zoz@novell.com |nadvornik@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=410736 Vladimir Nadvornik <nadvornik@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Priority|P5 - None |P3 - Medium -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com