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 794419 - gstmeta test crashes on sparc
gstmeta test crashes on sparc
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.13.91
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
https://bugs.gentoo.org/636558
Depends on:
Blocks:
 
 
Reported: 2018-03-17 10:20 UTC by Rolf Eike Beer
Modified: 2018-11-03 12:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Rolf Eike Beer 2018-03-17 10:20:09 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
  • #0 _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
  • #1 exchange_packets
    from /var/tmp/portage/media-libs/gstreamer-1.12.4/work/gstreamer-1.12.4-.sparc32/gst/.libs/libgstreamer-1.0.so.0
  • #2 plugin_loader_free
    from /var/tmp/portage/media-libs/gstreamer-1.12.4/work/gstreamer-1.12.4-.sparc32/gst/.libs/libgstreamer-1.0.so.0
  • #3 gst_update_registry
    from /var/tmp/portage/media-libs/gstreamer-1.12.4/work/gstreamer-1.12.4-.sparc32/gst/.libs/libgstreamer-1.0.so.0
  • #4 init_post
    from /var/tmp/portage/media-libs/gstreamer-1.12.4/work/gstreamer-1.12.4-.sparc32/gst/.libs/libgstreamer-1.0.so.0
  • #5 g_option_context_parse
    from /usr/lib/libglib-2.0.so.0
  • #6 gst_check_init
    from /var/tmp/portage/media-libs/gstreamer-1.12.4/work/gstreamer-1.12.4-.sparc32/libs/gst/check/.libs/libgstcheck-1.0.so.0
  • #7 main

Comment 1 Tim-Philipp Müller 2018-03-17 11:18:03 UTC
Could you try 1.13.91 (= 1.14rc2) too by any chance? There were some changes in that area.
Comment 2 Rolf Eike Beer 2018-03-17 11:22:10 UTC
https://bugs.gentoo.org/636558#c6

Test results of 1.13.91:

FAIL: gst/gstmeta
FAIL: gst/gstsystemclock
FAIL: gst/gstelement
Comment 3 Nicolas Dufresne (ndufresne) 2018-03-17 13:58:27 UTC
Can you rebuild with debug symbols, and probably no optimization ? The backtrace don't say much here.
Comment 4 Rolf Eike Beer 2018-03-17 22:08:13 UTC
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
  • #0 test_meta_test
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/tests/check/gst/gstmeta.c line 239
  • #1 tcase_run_tfun_fork
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/libs/gst/check/libcheck/check_run.c line 465
  • #2 srunner_iterate_tcase_tfuns
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/libs/gst/check/libcheck/check_run.c line 237
  • #3 srunner_run_tcase
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/libs/gst/check/libcheck/check_run.c line 377
  • #4 srunner_iterate_suites
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/libs/gst/check/libcheck/check_run.c line 205
  • #5 srunner_run_tagged
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/libs/gst/check/libcheck/check_run.c line 740
  • #6 srunner_run
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/libs/gst/check/libcheck/check_run.c line 754
  • #7 srunner_run_all
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/libs/gst/check/libcheck/check_run.c line 692
  • #8 gst_check_run_suite
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/libs/gst/check/gstcheck.c line 1067
  • #9 main
    at /var/tmp/portage/media-libs/gstreamer-1.13.91/work/gstreamer-1.13.91/tests/check/gst/gstmeta.c line 481

Comment 5 Rolf Eike Beer 2018-03-17 22:19:29 UTC
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.
Comment 6 Rolf Eike Beer 2018-03-18 07:57:51 UTC
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).
Comment 7 Sebastian Dröge (slomo) 2018-03-18 08:39:44 UTC
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.
Comment 8 Rolf Eike Beer 2018-03-18 09:03:42 UTC
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.
Comment 9 Nicolas Dufresne (ndufresne) 2018-03-18 12:11:08 UTC
Is valgring supported on Sparc ?
Comment 10 Rolf Eike Beer 2018-03-18 13:01:17 UTC
no, sadly not.
Comment 11 Sebastian Dröge (slomo) 2018-03-19 09:31:50 UTC
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?
Comment 12 Rolf Eike Beer 2018-03-21 19:40:58 UTC
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;
Comment 13 Mart Raudsepp 2018-06-16 20:42:04 UTC
Re-opening, as I see various information has been provided over time; anything else he can try to provide as info; ASAN?
Comment 14 GStreamer system administrator 2018-11-03 12:45:16 UTC
-- 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.