GNOME Bugzilla – Bug 794419
gstmeta test crashes on sparc
Last modified: 2018-11-03 12:45:16 UTC
Same with 1.12.3 and 1.12.4. gstmeta.log says: Running suite(s): GstMeta 75%: Checks: 4, Failures: 0, Errors: 1 /var/tmp/portage/media-libs/gstreamer-1.12.4/work/gstreamer-1.12.4/tests/check/gst/gstmeta.c:237:E:general:test_meta_test:0: (after this point) Received signal 10 (Bus error) FAIL gst/gstmeta (exit status: 1) gdb says: Program received signal SIGBUS, Bus error. 0xf7f01008 in _priv_gst_registry_chunks_load_plugin () from /var/tmp/portage/media-libs/gstreamer-1.12.4/work/gstreamer-1.12.4-.sparc32/gst/.libs/libgstreamer-1.0.so.0 (gdb) bt
+ Trace 238479
Could you try 1.13.91 (= 1.14rc2) too by any chance? There were some changes in that area.
https://bugs.gentoo.org/636558#c6 Test results of 1.13.91: FAIL: gst/gstmeta FAIL: gst/gstsystemclock FAIL: gst/gstelement
Can you rebuild with debug symbols, and probably no optimization ? The backtrace don't say much here.
0x00011ba0 in test_meta_test (__i__=0) at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/tests/check/gst/gstmeta.c:239 239 meta->pts = 1000; (gdb) bt
+ Trace 238482
I think the problem is that the buffer is allocated with 4 byte alignment, but the variable that should be assigned here is 8 byte long. Will test that tomorrow or so.
I misunderstood the argument to gst_buffer_new_and_alloc() as alignment, so no progress from my side. The point is: one can't simply allocate an anonymous buffer of a given size and then cast it to a pointer of a given type as it breaks possible alignment added to the struct. It will kill performance on architectures that support unaligned accesses (x86) and kill the process on others (sparc).
The first backtrace is for a different crash than the second. Can you check the address of meta and meta->pts in the second backtrace? In theory meta should be properly aligned, it is allocated with g_slice_alloc() in gstbuffer.c:gst_buffer_add_meta. For the first one, a new backtrace would be needed but the registry serialization/deserialization code tries to keep alignment correct everywhere. There might be places where that is not done correctly though. See also https://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=40c5396c244c4ffa39f209fd39c5723297235523 , which is not part of 1.12.4.
Since I had strange results in gdb I added some printf() statements, which gave this: Running suite(s): GstMeta meta 0x29394 meta->pts 0x2939c Which is the same strange thing, these addresses are very likely totally bogus, I expect something on the heap to be at much higher addresses.
Is valgring supported on Sparc ?
no, sadly not.
How about ASAN? Also could you follow the meta in the unit test otherwise, by adding some printfs in gst_buffer_add_meta() after the allocation, etc?
I think I already did, this is the code how I have it at the moment: /* add some metadata */ meta = GST_META_TEST_ADD (buffer); fail_if (meta == NULL); printf("meta %p\n", meta); fflush(stdout); printf("meta->pts %p\n", &(meta->pts)); fflush(stdout); /* fill some values */ meta->pts = 1000;
Re-opening, as I see various information has been provided over time; anything else he can try to provide as info; ASAN?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/280.