aruiz/webp-pixbuf-loader

webp-pixbuf-loader 0.2.0 regression test failure

Closed this issue · 15 comments

gv74 commented

$ meson test
ninja: Entering directory '/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu' ninja: no work to do.
1/5 get file info OK 0.01s
2/5 load 1x1 image FAIL 0.10s killed by signal 11 SIGSEGV
>>> MALLOC_PERTURB_=189 TEST_FILE=/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/tests/t1.webp GDK_PIXBUF_MODULE_FILE=/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/tests/loaders.cache /home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/tests/t1

3/5 load animation FAIL 0.11s killed by signal 11 SIGSEGV
>>> GDK_PIXBUF_MODULE_FILE=/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/tests/loaders.cache MALLOC_PERTURB_=116 TEST_FILE=/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/tests/t3.webp /home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/tests/t3

4/5 load 200x200 image FAIL 0.12s killed by signal 11 SIGSEGV
>>> TEST_FILE=/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/tests/t2.webp MALLOC_PERTURB_=203 GDK_PIXBUF_MODULE_FILE=/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/tests/loaders.cache /home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/tests/t2

5/5 save data FAIL 0.13s killed by signal 11 SIGSEGV
>>> TEST_FILE=/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/tests/t2.webp MALLOC_PERTURB_=34 GDK_PIXBUF_MODULE_FILE=/home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/tests/loaders.cache /home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/tests/t_save



Ok: 1
Expected Fail: 0
Fail: 4
Unexpected Pass: 0
Skipped: 0
Timeout: 0

Full log written to /home/gv74/work/rpm/BUILD/webp-pixbuf-loader-0.2.0/x86_64-redhat-linux-gnu/meson-logs/testlog.txt

Relevant /var/log/messages entries:
[ 257.777098] t2[1846]: segfault at 0 ip 0000000000000000 sp 00007ffedb79abd8 error 14 in t2[5558e836f000+1000]
[ 257.777144] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
[ 257.777484] t1[1845]: segfault at 0 ip 0000000000000000 sp 00007fff40543788 error 14 in t1[558e4a902000+1000]
[ 257.777508] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
[ 257.777622] t3[1847]: segfault at 0 ip 0000000000000000 sp 00007ffd3fd49188 error 14 in t3[558a9db33000+2000]
[ 257.777649] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
[ 257.790624] t_save[1852]: segfault at 0 ip 0000000000000000 sp 00007ffe0d84ed08 error 14 in t_save[5608e125f000+2000]
[ 257.790669] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.

FWIW I can't reproduce this on Fedora Rawhide.. perhaps share some more details of your setup

ma8ma commented

It seems that needs ninja before running tests. That is to say test subcommand compiles test programs only, but not the loader...

gv74 commented

OS: Rocky Linux 8.7 (aka RHEL 8.7)
Build command:
rpmbuild -ba webp-pixbuf-loader.spec 2>&1 | tee build.log
build.log

aruiz commented

OS: Rocky Linux 8.7 (aka RHEL 8.7) Build command: rpmbuild -ba webp-pixbuf-loader.spec 2>&1 | tee build.log build.log

We need the testlog too

aruiz commented

@mikelolasagasti are you having issues in EL8 too?

gv74 commented

We need the testlog too
testlog.txt

aruiz commented

This is really odd, gdk-pixbuf passes size_func and update_func as null... I am inclined to say this is a gdk-pixbuf bug in RHEL8.

Breakpoint 1, begin_load (size_func=0x0, prepare_func=0x7f0f71e9f2c0 <prepared_notify>, update_func=0x0, user_data=0x7ffcbbed2048, error=0x0) at ../io-webp.c:23
23	  WebPContext *context  = g_new0 (WebPContext, 1);
(gdb) 
aruiz commented

This smells like the compiler over optimized things by removing those empty functions and their address point to NULL now.

This is a gdk pixbuf bug in RHEL 8.

static void
noop_size_notify (gint     *width,
		  gint     *height,
		  gpointer  data)
{
}

static void
prepared_notify (GdkPixbuf *pixbuf, 
                 GdkPixbufAnimation *anim, 
                 gpointer user_data)
{
        if (pixbuf != NULL)
                g_object_ref (pixbuf);
        *((GdkPixbuf **)user_data) = pixbuf;
}

static void
noop_updated_notify (GdkPixbuf *pixbuf,
		     int        x,
		     int        y,
		     int        width,
		     int        height,
		     gpointer   user_data)
{
}

static GdkPixbuf *
generic_load_incrementally (GdkPixbufModule *module, FILE *f, GError **error)
{
        GdkPixbuf *pixbuf = NULL;
	gpointer context;

	context = module->begin_load (noop_size_notify, prepared_notify, noop_updated_notify, &pixbuf, error);
aruiz commented

I have submitted a bug to RHEL8 about this:

https://bugzilla.redhat.com/show_bug.cgi?id=2173198

gv74 commented

I have submitted a bug to RHEL8 about this:

https://bugzilla.redhat.com/show_bug.cgi?id=2173198

This is pointless. The generic_load_incrementally() from gdk-pixbuf2 2.36.12 specifically call module->begin_load() as this:
context = module->begin_load (NULL, prepared_notify, NULL, &pixbuf, error);
There are no noop_size_notify and noop_updated_notify functions.

The attached patch declare them in webp-pixbuf-loader and now everything is working for me.

patch.zip

aruiz commented

Can you try 0.2.2? I check if those functions are NULL before calling them now.

gv74 commented

The patch is for 0.2.2.

aruiz commented

Can you reproduce the crash in 0.2.2 though?

gv74 commented

No. You are right. 0.2.2 works fine.
I created the patch for 0.2.0 and assumed that 0.2.2 fail too. This is not the case.
Thank you.

aruiz commented

Phew, I was going crazy wondering how this could happen.

Great, thanks!