[jp] Segfault while synchronising DatebookDB

Robert CHERAMY robert at cheramy.net
Sun Mar 9 15:15:04 EST 2003


Hi,

I get a segfault of jpilot-sync while synchronising DatebookDB.
There is no check of a NULL return from malloc in utils.c:2555 (cvs
version), function pdb_file_read_record_by_id , and it seems I have a
non valid record, asking for to much memory...

Here is my gdb output, if you need something else, just ask :

$ gdb jpilot-sync
GNU gdb 5.3-debian
(...)
(gdb) run -d
Starting program: /share/local/src/jpilot/jpilot-sync -d
Debug messages on.
opening dir /share/local//lib/jpilot/plugins/
found plugin libexpense.so
opened plugin [/share/local/lib/jpilot/plugins/libexpense.so]
This plugin is version (0.99).
getting plugin_get_name
Expense: plugin_get_name
getting plugin_get_menu_name
getting plugin_get_help_name
getting plugin_get_db_name
plugin name is [Expense 0.99]
found plugin libsynctime.so
opened plugin [/share/local/lib/jpilot/plugins/libsynctime.so]
This plugin is version (0.99).
getting plugin_get_name
getting plugin_get_menu_name
getting plugin_get_help_name
getting plugin_get_db_name
plugin name is [SyncTime 0.99]
found plugin libkeyring.so
opened plugin [/share/local/lib/jpilot/plugins/libkeyring.so]
This plugin is version (0.99).
getting plugin_get_name
KeyRing: plugin_get_name
getting plugin_get_menu_name
getting plugin_get_help_name
getting plugin_get_db_name
plugin name is [KeyRing 0.01]
opening dir /home/tibob/.jpilot/plugins/
plugin: [Expense 0.99] was loaded
plugin: [SyncTime 0.99] was loaded
plugin: [KeyRing 0.01] was loaded
calling plugin_startup for [Expense 0.99]
Expense: plugin_startup
Expense: base_dir = [/share/local/]
calling plugin_startup for [KeyRing 0.01]
KeyRing: plugin_startup
KeyRing: base_dir = [/share/local/]
setting PILOTRATE=[9600]
pref port=[/dev/ttyUSB1]
num_backups=12
****************************************
 Syncing on device /dev/ttyUSB1
 Press the HotSync button now
****************************************
sync:calling load_plugins
opening dir /share/local//lib/jpilot/plugins/
found plugin libexpense.so
opened plugin [/share/local/lib/jpilot/plugins/libexpense.so]
This plugin is version (0.99).
getting plugin_get_name
Expense: plugin_get_name
getting plugin_get_menu_name
getting plugin_get_help_name
getting plugin_get_db_name
plugin name is [Expense 0.99]
found plugin libsynctime.so
opened plugin [/share/local/lib/jpilot/plugins/libsynctime.so]
This plugin is version (0.99).
getting plugin_get_name
getting plugin_get_menu_name
getting plugin_get_help_name
getting plugin_get_db_name
plugin name is [SyncTime 0.99]
found plugin libkeyring.so
opened plugin [/share/local/lib/jpilot/plugins/libkeyring.so]
This plugin is version (0.99).
getting plugin_get_name
KeyRing: plugin_get_name
getting plugin_get_menu_name
getting plugin_get_help_name
getting plugin_get_db_name
plugin name is [KeyRing 0.01]
opening dir /home/tibob/.jpilot/plugins/
sync:calling plugin_pre_sync for [Expense 0.99]
Expense: plugin_pre_sync
sync:calling plugin_pre_sync for [KeyRing 0.01]
KeyRing: plugin_pre_sync
Username is "Robert CHERAMY"
User ID is 1001
lastSyncPC = 903668173
This PC = 903668173
Last Username = [Robert CHERAMY]
Last UserID = 1001
Username = [Robert CHERAMY]
userID = 1001
lastSyncPC = 903668173
passwordLength = 0
userPassword =
[09021345070413440c08135a3215135dd217ead3b5df556322e9a14a994b0f88]
Doing a fast sync.
fast_sync_application DatebookDB
Syncing DatebookDB
read next record for DatebookDB returned 64
id 15602911, index 628, size 64, attr 0x40, category 0
found a deleted record on palm
pi_file_modify_record
read next record for DatebookDB returned 12
id 15602912, index 629, size 12, attr 0x40, category 0
found a deleted record on palm
pi_file_modify_record
read next record for DatebookDB returned 0
id 15602900, index 687, size 0, attr 0xc0, category 0
found a deleted record on palm
pdb_file_delete_record_by_id
read next record for DatebookDB returned 0
id 15602467, index 688, size 0, attr 0xc0, category 0

(...)

found a deleted record on palm
pdb_file_delete_record_by_id
read next record for DatebookDB returned 0
id 15602894, index 777, size 0, attr 0xc0, category 0
found a deleted record on palm
pdb_file_delete_record_by_id
read next record for DatebookDB returned 0
id 15602835, index 778, size 0, attr 0xc0, category 0
found a deleted record on palm
pdb_file_delete_record_by_id
fast_sync_local_recs
deleted or modified pc record
pdb_file_read_record_by_id

Program received signal SIGSEGV, Segmentation fault.
0x40389063 in memcpy () from /lib/libc.so.6
(gdb) backtrace
#0  0x40389063 in memcpy () from /lib/libc.so.6
#1  0x0805d464 in pdb_file_read_record_by_id (DB_name=0x80600b1
"DatebookDB",
    uid=15602835, bufp=0x0, sizep=0xbffedb6c, idxp=0xbffedb70,
    attrp=0xbffedb74, catp=0xbffedb78) at utils.c:2556
#2  0x08057c36 in fast_sync_local_recs (DB_name=0x80600b1 "DatebookDB",
sd=9,
    db=1) at sync.c:2101
#3  0x080587fa in fast_sync_application (DB_name=0x80600b1 "DatebookDB",
sd=9)
    at sync.c:2346
#4  0x08054f9e in jp_sync (sync_info=0x8064620) at sync.c:739
#5  0x08053fad in sync_once (sync_info=0xbffff100) at sync.c:279
#6  0x0805c980 in setup_sync (flags=3221150628) at utils.c:2219
#7  0x0804fc66 in main (argc=2, argv=0xbffff7a4) at jpilot-sync.c:161

Regards,
-- 
tibob



More information about the Jpilot mailing list