[sylpheed:34749] Crash in MSVC debug-mode

Gisle Vanem gvanem at broadpark.no
Thu Aug 25 02:33:21 JST 2011


I'm trying to build Sylpheed using MSVC in debug-mode (-MDd -D_DEBUG).
But it doesn't work so well. It crashes on startup; from WinDbg:

ntdll!RtlpWaitForCriticalSection+0x8c
ntdll!RtlEnterCriticalSection+0x46
MSVCR100D!_lock_file(struct _iobuf * pf = 0x77c4fd00)+0x4f
MSVCR100D!fgets(char * string = 0x0012be7c "???", int count = 0n8192, struct _iobuf * str = 0x77c4fd00)+0x199
sylpheed!prefs_read_config(struct _PrefParam * param = 0x006b3c70, char * label = 0x00660964 "Common", char * rcfile = 
x00d05a10 "f:\Documents and Settings\Gisle Vanem\Programdata\Sylpheed\sylpheedrc", char * encoding = 0x00000000 "")+0x190
sylpheed!prefs_common_read_config(void)+0x5d
sylpheed!main(int argc = 0n1, char ** argv = 0x00c4aa98)+0x1e0
..

I think I see why:

void prefs_read_config(PrefParam *param, const gchar *label,
         const gchar *rcfile, const gchar *encoding)
{
...
 if ((fp = g_fopen(rcfile, "rb")) == NULL) {
  if (ENOENT != errno) FILE_OP_ERROR(rcfile, "fopen");
  return;
 }
 ...
 while (fgets(buf, sizeof(buf), fp) != NULL) {

-----------------

The 'fp' comes from Glib build in non-debug mode and the local
fgets() is in debug-mode. How can we code around this? Is there no
g_fgets()?

--gv 



More information about the Sylpheed mailing list