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 739678 - Crash instantiating a Javascript defined GObject from C
Crash instantiating a Javascript defined GObject from C
Status: RESOLVED DUPLICATE of bug 681254
Product: gjs
Classification: Bindings
Component: general
1.42.x
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2014-11-05 17:35 UTC by Bastien Nocera
Modified: 2014-11-08 02:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test.js (2.03 KB, application/x-javascript)
2014-11-05 17:35 UTC, Bastien Nocera
Details

Description Bastien Nocera 2014-11-05 17:35:49 UTC
Created attachment 290044 [details]
test.js

Using gjs and gom from master, run the attached test.js. It crashes when instantiating an "Item" object (a search result).

$ gdb --args gjs test.js
(gdb) run
Starting program: /home/hadess/Projects/gnome-install/bin/gjs test.js
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe560c700 (LWP 12709)]
[New Thread 0x7fffe4e0b700 (LWP 12710)]
[New Thread 0x7fffe2f64700 (LWP 12711)]
[New Thread 0x7fffe2209700 (LWP 12712)]
0
http://www.gnome.org
New item ID: 12 URL: http://www.gnome.org
[Thread 0x7fffe2209700 (LWP 12712) exited]
[New Thread 0x7fffe1a08700 (LWP 12713)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b7dca2 in gjs_object_custom_init (instance=0x71cb00, klass=0x702b20) at gi/object.cpp:2486
2486	    object = (JSObject*) object_init_list->data;
(gdb) bt
  • #0 gjs_object_custom_init
    at gi/object.cpp line 2486
  • #1 g_type_create_instance
    at gtype.c line 1870
  • #2 g_object_new_internal
    at gobject.c line 1774
  • #3 g_object_new_valist
    at gobject.c line 2034
  • #4 g_object_new
    at gobject.c line 1617
  • #5 item_data_ensure_resource
    at ./gom/gom-resource-group.c line 407
  • #6 gom_resource_group_get_index
    at ./gom/gom-resource-group.c line 684
  • #7 gom_repository_find_one_sync
    at ./gom/gom-repository.c line 754
  • #8 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #9 ffi_call
    at ../src/x86/ffi64.c line 525
  • #10 gjs_invoke_c_function
    at gi/function.cpp line 997
  • #11 function_call
    at gi/function.cpp line 1319
  • #12 js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct)
    from /lib64/libmozjs-24.so
  • #13 Interpret(JSContext*, js::RunState&)
    from /lib64/libmozjs-24.so
  • #14 js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::ExecuteType, js::AbstractFramePtr, JS::Value*)
    from /lib64/libmozjs-24.so
  • #15 js::Execute(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value*)
    from /lib64/libmozjs-24.so
  • #16 JS::Evaluate(JSContext*, JS::Handle<JSObject*>, JS::CompileOptions, unsigned short const*, unsigned long, JS::Value*)
    from /lib64/libmozjs-24.so
  • #17 JS::Evaluate(JSContext*, JS::Handle<JSObject*>, JS::CompileOptions, char const*, unsigned long, JS::Value*)
    from /lib64/libmozjs-24.so
  • #18 gjs_eval_with_scope
    at gjs/jsapi-util.cpp line 1325
  • #19 gjs_context_eval
    at gjs/context.cpp line 646
  • #20 main
    at gjs/console.cpp line 140
2481	    JSContext *context;
2482	    JSObject *object;
2483	    ObjectInstance *priv;
2484	    jsval v, r;
2485	
2486	    object = (JSObject*) object_init_list->data;
2487	    priv = (ObjectInstance*) JS_GetPrivate(object);
2488	
2489	    if (priv->gtype != G_TYPE_FROM_INSTANCE (instance)) {
2490	        /* This is not the most derived instance_init function,
(gdb) p object_init_list 
$1 = (GSList *) 0x0
Comment 1 Giovanni Campagna 2014-11-08 02:10:32 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 681254 ***