mtest-gmonitor.py segfauls in latest lp:ntrack revno. 235

Bug #692703 reported by Alexander Sack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ntrack
Fix Released
High
Unassigned

Bug Description

after building like:
../configure --prefix=....
make
make check
make install

... mtest-gmonitor.py segfaults because no backend is found

====
python gobject/test/mtest-gmonitor.py
no backend found in: ../../modules/.libs/ /home/asac/local_ntrack/lib/ntrack/modules/
no backend found finale.
no rfds func found, but called
Segmentation fault
===
Program received signal SIGSEGV, Segmentation fault.
ntrack_monitor_register (self=0x0, callback=0x616e60 <__ntrack_monitor_callback>, data=0x8372980) at ../../common/ntrackmonitor.c:69
69 if (self->pack_size <= self->pack_len + 1) {
(gdb) bt
#0 ntrack_monitor_register (self=0x0, callback=0x616e60 <__ntrack_monitor_callback>, data=0x8372980) at ../../common/ntrackmonitor.c:69
#1 0x00616c99 in ntrack_g_source_new () at ../../glib/ntrack-gsource.c:219
#2 0x00616dbf in ntrack_g_source_add_full (priority=0, func=0x612f90 <_event_callback>, data=0x82f4518, notify=0) at ../../glib/ntrack-gsource.c:244
#3 0x00616e54 in ntrack_g_source_add (func=0x612f90 <_event_callback>, data=0x82f4518) at ../../glib/ntrack-gsource.c:232
#4 0x00612ef6 in ntrack_g_monitor_init (self=0x82f4518) at ../../gobject/ntrack-gmonitor.c:105
#5 0x004c35df in g_type_create_instance () from /usr/lib/libgobject-2.0.so.0
#6 0x004a7885 in ?? () from /usr/lib/libgobject-2.0.so.0
#7 0x00612e76 in ntrack_g_monitor_constructor (gtype=136966472, n_properties=0, properties=0x0) at ../../gobject/ntrack-gmonitor.c:57
#8 0x004a5e27 in g_object_newv () from /usr/lib/libgobject-2.0.so.0
#9 0x004a6508 in g_object_new () from /usr/lib/libgobject-2.0.so.0
#10 0x00612c07 in ntrack_g_monitor_get () at ../../gobject/ntrack-gmonitor.c:143
#11 0x0060ecd7 in _wrap_ntrack_g_monitor_get (self=0x0) at pyntrack-gmonitor.c:85
#12 0x080ddd39 in call_function (f=<unknown at remote 0x829f148>, throwflag=0) at ../Python/ceval.c:3734
#13 PyEval_EvalFrameEx (f=<unknown at remote 0x829f148>, throwflag=0) at ../Python/ceval.c:2412
#14 0x080dfbb2 in PyEval_EvalCodeEx (co=0xb7fcc5c0, globals=
    {'glib': <module at remote 0xb7f9356c>, 'pyntrack': <module at remote 0xb7f93adc>, 'monitor': None, '__builtins__': <module at remote 0xb7f93074>, '__file__': '../gobject/test/mtest-gmonitor.py', 'monitor_event': <function at remote 0x8335a3c>, '__package__': None, 'gobject': <module at remote 0xb7f93674>, '__name__': '__main__', '__doc__': None}, locals=
...
===

Related branches

Revision history for this message
Alexander Sack (asac) wrote :

needs to be fixed before release ...

many things seem to be at problem here:

 1. the "look for backend in multiple directories" seems to be broken. hence it doesnt even find the backend after a make instal

 2. ntrack.c module loading code assumes quite static directory structures to look for backends.

 3. ntrack.c module loading code has no way to find the cmdline used to run the script. Hence, it has no way to guess the $builddir directory of the run binary if its != cwd

 4. the mtest-gmonitor.py is not even copied to $builddir hierarchy ... hence even a well implemented mechanism that would expect the source copy to be available in the $builddir would fail.

... lets see how robust i can make this while allowing executation from the $builddir and the $installdir

Changed in ntrack:
importance: Undecided → High
milestone: none → 010
status: New → Confirmed
Revision history for this message
Alexander Sack (asac) wrote :

this should now be fixed in lp:ntrack... since reported

 + we introduced ntrack_init (int *argc, char**argv) which is used to guess the modules/.libs directory location in smart way for in-source backend resolution
 + this is only supported with --enable-maintainer mode (which was introduced as a sideeffect)
 + common, glib, gobject tests make use of ntrack_init directly
 + qt4 and pyntrack have a init wrapper that calls the underlying ntrack_init accordingly
 + fix a bug in modules dir list crawler that looked only at every 2nd path in the hard coded list
 + last but not least a generic-py-wrapper for using .py as test cases in-source/build tree was introduced and is now used to ensure that you can comfortably mtest-gmonitor.py
 -> fixes this bug.

Changed in ntrack:
status: Confirmed → Fix Committed
Revision history for this message
Alexander Sack (asac) wrote :
Download full text (5.6 KiB)

here all commits that had somehow remotely to do with fixing this in the end:

------------------------------------------------------------
revno: 256
fixes bug(s): https://launchpad.net/bugs/692703
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 01:26:57 +0100
message:
  gobject: ship a python wrapper as mtest-gmonitor-py as part of check_PROGRAMS
  - introduce a convenience -py wrapper that sets PYTHONPATH properly for in-source builds
  - final fix for lp:692703
------------------------------------------------------------
revno: 255
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 01:17:16 +0100
message:
  BUILD: enable maintainer mode by default so make dist doesnt fail
------------------------------------------------------------
revno: 254
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:54:17 +0100
message:
  gobject: add license for gobject/pyntrack-module.c
------------------------------------------------------------
revno: 253
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:50:29 +0100
message:
  gobject: explicitly link tests against libntrack.la since they now use ntrack_init directly
------------------------------------------------------------
revno: 252
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:50:17 +0100
message:
  glib: explicitly link tests against libntrack.la since they now use ntrack_init directly
------------------------------------------------------------
revno: 251
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:48:23 +0100
message:
  common: enable MAINTAINER_MODE define in common/Makefile.am for ntrack.c
------------------------------------------------------------
revno: 250
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:43:03 +0100
message:
  gobject: extend python monitor test to make use of ntrack_init
------------------------------------------------------------
revno: 249
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:41:36 +0100
message:
  object: rename pyntrack-module exception type to NtrackException
------------------------------------------------------------
revno: 248
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:26:21 +0100
message:
  gobject: add a wrapped ntrack_init func to pyntrack module that sys.argv as argument
------------------------------------------------------------
revno: 247
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:07:35 +0100
message:
  modules: link ntrack-libnl1.la and ntrack-libnl2.la against ../common/libntrack.la to make python module loader happy
------------------------------------------------------------
revno: 246
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Tue 2010-12-21 00:05:13 +0100
message:
  modules: drop trailing / from ntrackmodulesdir definition
------------------------------------------------...

Read more...

Revision history for this message
Alexander Sack (asac) wrote :
Changed in ntrack:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.