From: Roland S. <ro...@xi...> - 2005-08-16 21:27:03
|
Hi, i tried opensync on an amd64 system. It dies with a segfault=20 in osync_member_initialize when the initialize function of the plugin is called. I tried this with gcc-3.2 -3.3 and -4.0 and always got the same=20 result. I don't know how to track this. It seems to me, that the=20 stack gets somehow overwritten during the call to fs_initialize,=20 but this is only a guess. btw. compiling with -Werror fails because casting void* to int=20 gives a warning on x86_64. opensync_debug.c:65: warning: cast from pointer to integer of different siz= e This is a run of msynctool --sync filefile in gdb roland@alderaan:~/opensync$ gdb ./bin/msynctool GNU gdb 6.3-debian Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you ar= e welcome to change it and/or distribute copies of it under certain condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-linux"...Using host libthread_db library= "/lib/libthread_db.so.1". (gdb) break opensync_member.c:982 No source file named opensync_member.c. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (opensync_member.c:982) pending. (gdb) run --sync filefile Starting program: /home/roland/opensync/bin/msynctool --sync filefile [Thread debugging using libthread_db enabled] [New Thread 46912515451632 (LWP 32346)] Breakpoint 2 at 0x2aaaaad56f94: file opensync_member.c, line 982. Pending breakpoint "opensync_member.c:982" resolved Synchronizing group "filefile" The previous synchronization was unlean. Slow-syncing [Switching to Thread 46912515451632 (LWP 32346)] Breakpoint 2, osync_member_initialize (member=3D0x515750, error=3D0x7fffffc= fb538) at opensync_member.c:982 982 if (!(member->plugindata =3D functions.initialize(member, e= rror))) { (gdb) print *member $1 =3D {id =3D 1, configdir =3D 0x5157e0 "/home/roland/.opensync/group1/1", configdata =3D 0x0, configsize =3D 0, plugin =3D 0x50a2e0, memberfunctions =3D 0x5156f0, group =3D 0x506740, enginedata =3D 0x512a70= , plugindata =3D 0x0, format_sinks =3D 0x50a170, objtype_sinks =3D 0x50a140= , pluginname =3D 0x517760 "file-sync", accepted_objtypes =3D 0x0, filters = =3D 0x0, extension =3D 0x0, loop =3D 0x512b80} (gdb) s fs_initialize (member=3D0x7fffffcfb538, error=3D0x7fffffcfb538) at file_syn= c.c:66 66 { (gdb) print *member $2 =3D {id =3D 0, configdir =3D 0x0, configdata =3D 0x0, configsize =3D 0, = plugin =3D 0x0, memberfunctions =3D 0x0, group =3D 0x0, enginedata =3D 0x0, plugindata = =3D 0x0, format_sinks =3D 0x0, objtype_sinks =3D 0x0, pluginname =3D 0x0, accepted_objtypes =3D 0x0, filters =3D 0x0, extension =3D 0x0, loop =3D 0= x0} (gdb) finish Run till exit from #0 fs_initialize (member=3D0x7fffffcfb538, error=3D0x7fffffcfb538) at file_sync.c:66 0x00002aaaaad56f9c in osync_member_initialize (member=3D0x0, error=3D0x7fffffcfb538) at opensync_member.c:982 982 if (!(member->plugindata =3D functions.initialize(member, e= rror))) { Value returned is $3 =3D (void *) 0x517670 (gdb) print *member Cannot access memory at address 0x0 (gdb) n Program received signal SIGSEGV, Segmentation fault. 0x00002aaaaad56f9f in osync_member_initialize (member=3D0x0, error=3D0x7fffffcfb538) at opensync_member.c:982 982 if (!(member->plugindata =3D functions.initialize(member, e= rror))) { (gdb) Roland |
From: Stefan B. <be...@su...> - 2005-08-17 08:38:30
Attachments:
libopensync-0.17-warnings.patch
|
Moin, On Aug 16, 05 23:26:47 +0200, Roland Stoll wrote: > Hi, > > i tried opensync on an amd64 system. It dies with a segfault > in osync_member_initialize when the initialize function of the > plugin is called. > I tried this with gcc-3.2 -3.3 and -4.0 and always got the same > result. I don't know how to track this. It seems to me, that the > stack gets somehow overwritten during the call to fs_initialize, > but this is only a guess. > > btw. compiling with -Werror fails because casting void* to int > gives a warning on x86_64. > opensync_debug.c:65: warning: cast from pointer to integer of different size I've appended a patch, please try to apply that and see if it's better then. (I currently don't have time to check the latest version, so the patch might not be sufficient) Stefan -- Stefan Behlert |
From: Roland S. <ro...@xi...> - 2005-08-17 09:13:14
|
On Wed, August 17, 2005 10:38, Stefan Behlert said: > Moin, > > On Aug 16, 05 23:26:47 +0200, Roland Stoll wrote: >> Hi, >> >> i tried opensync on an amd64 system. It dies with a segfault >> in osync_member_initialize when the initialize function of the >> plugin is called. >> I tried this with gcc-3.2 -3.3 and -4.0 and always got the same >> result. I don't know how to track this. It seems to me, that the >> stack gets somehow overwritten during the call to fs_initialize, >> but this is only a guess. >> >> btw. compiling with -Werror fails because casting void* to int >> gives a warning on x86_64. >> opensync_debug.c:65: warning: cast from pointer to integer of different >> size > > I've appended a patch, please try to apply that and see if it's better > then. > (I currently don't have time to check the latest version, so the patch > might not be sufficient) > Thank you. This solved the compilation issue. running msynctool --sync on a group with a file-sync still segfaults. I found out, that it works when file_sync.c is compiled without optimizations. Is this a gcc bug maybe? Roland. |
From: Armin B. <arm...@de...> - 2005-08-17 09:21:24
Attachments:
signature.asc
|
Roland Stoll wrote: > On Wed, August 17, 2005 10:38, Stefan Behlert said: > >>Moin, >> >>On Aug 16, 05 23:26:47 +0200, Roland Stoll wrote: >> >>>Hi, >>> >>>i tried opensync on an amd64 system. It dies with a segfault >>>in osync_member_initialize when the initialize function of the >>>plugin is called. >>>I tried this with gcc-3.2 -3.3 and -4.0 and always got the same >>>result. I don't know how to track this. It seems to me, that the >>>stack gets somehow overwritten during the call to fs_initialize, >>>but this is only a guess. >>> >>>btw. compiling with -Werror fails because casting void* to int >>>gives a warning on x86_64. >>>opensync_debug.c:65: warning: cast from pointer to integer of different >>>size >> >>I've appended a patch, please try to apply that and see if it's better >>then. >>(I currently don't have time to check the latest version, so the patch >>might not be sufficient) >> > > > Thank you. This solved the compilation issue. > > running msynctool --sync on a group with a file-sync still segfaults. I > found out, that it works when file_sync.c is compiled without > optimizations. > > Is this a gcc bug maybe? > Maybe its just another assumption i made about the size of variables that are not true any more on x64. Can you please show me a backtrace of this new segfault? Armin > > Roland. > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Opensync-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensync-users |
From: Roland S. <ro...@xi...> - 2005-08-17 09:31:39
Attachments:
bt.txt
|
On Wed, August 17, 2005 11:21, Armin Bauer said: > > > Roland Stoll wrote: >> running msynctool --sync on a group with a file-sync still segfaults. I >> found out, that it works when file_sync.c is compiled without >> optimizations. >> >> Is this a gcc bug maybe? >> > > Maybe its just another assumption i made about the size of variables > that are not true any more on x64. Can you please show me a backtrace of > this new segfault? i have attached a backtrace. After fs_initialize() returns, the value of 'member' in osync_member_initialize() is changed. This happens only if file_sync.c is compiled with -O2 and osync_member_get_config() is called in fs_initialize(). Roland |
From: Roland S. <ro...@xi...> - 2005-08-17 14:48:44
Attachments:
file_read.patch
|
On Wed, August 17, 2005 11:21, Armin Bauer said: > > > Roland Stoll wrote: >> On Wed, August 17, 2005 10:38, Stefan Behlert said: >> >>>Moin, >>> >>>On Aug 16, 05 23:26:47 +0200, Roland Stoll wrote: >>> >>>>Hi, >>>> >>>>i tried opensync on an amd64 system. It dies with a segfault >>>>in osync_member_initialize when the initialize function of the >>>>plugin is called. >>>>I tried this with gcc-3.2 -3.3 and -4.0 and always got the same >>>>result. I don't know how to track this. It seems to me, that the >>>>stack gets somehow overwritten during the call to fs_initialize, >>>>but this is only a guess. >>>> >>>>btw. compiling with -Werror fails because casting void* to int >>>>gives a warning on x86_64. >>>>opensync_debug.c:65: warning: cast from pointer to integer of different >>>>size >>> >>>I've appended a patch, please try to apply that and see if it's better >>>then. >>>(I currently don't have time to check the latest version, so the patch >>>might not be sufficient) >>> >> >> >> Thank you. This solved the compilation issue. >> >> running msynctool --sync on a group with a file-sync still segfaults. I >> found out, that it works when file_sync.c is compiled without >> optimizations. >> >> Is this a gcc bug maybe? >> > > Maybe its just another assumption i made about the size of variables > that are not true any more on x64. Can you please show me a backtrace of > this new segfault? You're right. attached is a patch that solves this problem. gsize is 8 byte on x86_64 and casting (int*) to (gsize*) in osync_file_read() overwrites the stack in fs_initialize which leads to the wrong value of member in osync_member_initialize(). I didn't want to change the interface, so i used a temp. variable. Now i can try to sync something :-) Roland. |