From: Roland S. <ro...@xi...> - 2005-08-17 14:48:44
|
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. |