Panel crash

edscott wilson garcia edscott at lunar-linux.org
Sat Nov 8 15:50:36 CET 2003


On Sat, 2003-11-08 at 03:54, Jasper Huijsmans wrote:
> ...
> > 
> > Do you have any idea how to improve the panel in a way that crashes
> > produce more information for debugging?
> >
> 
> I think there may be a way to print a stack trace after a crash. I  
> believe xffm does something like that.

Instead of using g_assert_not_reached(), xffm uses assert_not_reached().
There is a call for assert_not_reached() in the signal handler to trap
segv. In libs/constants.h (tod is a convenience function to print time
of day):

/* custom assert_not_reached() for xffm */
#ifdef __GNUC__
#define assert_not_reached()		G_STMT_START{						\
   {												\
	FILE *f=fopen(g_strconcat(g_get_home_dir(),LOG_FILE,NULL),"a");				\
	chdir(g_strconcat(g_get_home_dir(),CORE_DIR,NULL));					\
	fprintf(f,"%s%s Core dump --> file %s: line %d (%s): should not be
reached\n",		\
			tod(),(g_get_prgname())?g_get_prgname():"?",				\
			__FILE__,								\
			__LINE__,								\
			__PRETTY_FUNCTION__);							\
	fclose(f);										\
	abort();										\
   };					}G_STMT_END
#else /* !__GNUC__ */
#define assert_not_reached()		G_STMT_START{						\
   {												\
	FILE *f=fopen(g_strconcat(g_get_home_dir(),LOG_FILE,NULL),"a");				\
	chdir(g_strconcat(g_get_home_dir(),CORE_DIR,NULL));					\
	fprintf(f,"%s%s Core dump --> file %s: line %d (not GNUC): should not
be reached\n",	\
			tod(),(g_get_prgname())?g_get_prgname():"?",				\
			__FILE__,								\
			__LINE__);								\
	fclose(f);										\
	abort();										\
   };					}G_STMT_END
#endif /* __GNUC__ */




> 
> Anyway, what I'd really like to see is a way to prevent plugins from  
> crashing the panel. That may be rather difficult, though.
> 
> 	Jasper
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://moongroup.com/mailman/listinfo/xfce4-dev
> 




More information about the Xfce4-dev mailing list