After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653052 - gmessages.c: fatal_log_func gets wrong data
gmessages.c: fatal_log_func gets wrong data
Status: VERIFIED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-06-20 21:24 UTC by John Ralls
Modified: 2013-02-10 04:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program to demonstrate bug (1.53 KB, text/plain)
2011-06-21 05:20 UTC, John Ralls
  Details
Pass correct data to fatal log handlers (3.21 KB, patch)
2011-10-16 20:25 UTC, Matthias Clasen
committed Details | Review

Description John Ralls 2011-06-20 21:24:42 UTC
In g_logv(), line 520ff in gmessages.c:
	      gchar *msg;
              va_list args2;

              G_VA_COPY (args2, args1);
              msg = g_strdup_vprintf (format, args2);
              va_end (args2);
	      log_func (log_domain, test_level, msg, data);

              if ((test_level & G_LOG_FLAG_FATAL)
                && !(test_level & G_LOG_LEVEL_ERROR))
                {
                  masquerade_fatal = fatal_log_func
                    && !fatal_log_func (log_domain, test_level, msg, data);
                                                                       ^
               }

	      g_free (msg);
	    }

Shouldn't the fatal_log_func parameter "data" (indicated) be "fatal_log_data"?
Comment 1 Matthias Clasen 2011-06-21 00:15:43 UTC
It looks like you are right. But I would appreciate a testcase that reproduces a problem from this.
Comment 2 John Ralls 2011-06-21 05:20:53 UTC
Created attachment 190335 [details]
Test program to demonstrate bug

Here ya go.
Comment 3 Matthias Clasen 2011-10-16 20:25:15 UTC
The following fix has been pushed:
6ab1c77 Pass correct data to fatal log handlers
Comment 4 Matthias Clasen 2011-10-16 20:25:18 UTC
Created attachment 199144 [details] [review]
Pass correct data to fatal log handlers

This was pointed out by John Ralls in bug 653052.
He also provided the test case.