Script works only with linkStrategy=monolithic option (dispatching bug)

Bug #415265 reported by Anton Gladky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Fix Released
Critical
Václav Šmilauer

Bug Description

When I start the simulation with the attached script, I get:

gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
/home/gladk/.yade-current/gdb_crash_batch-pid13289:1: Error in sourced command file:
ptrace: No such process.
(gdb)

But when I do the same on installation with linkstrategy=monolithic compilation option it works normally.

Revision history for this message
Anton Gladky (gladky-anton) wrote :
Revision history for this message
Václav Šmilauer (eudoxos) wrote :

Can you try running inside gdb?

Revision history for this message
Anton Gladky (gladky-anton) wrote : Re: [Bug 415265] Re: Script works only with linkstrategy=monolithic option

Could you not say how ;) ?
______________________________
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy

2009/8/18 Václav Šmilauer <email address hidden>

> Can you try running inside gdb?
>
> --
> Script works only with linkstrategy=monolithic option
> https://bugs.launchpad.net/bugs/415265
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Yet Another Dynamic Engine: New
>
> Bug description:
> When I start the simulation with the attached script, I get:
>
> gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> /home/gladk/.yade-current/gdb_crash_batch-pid13289:1: Error in sourced
> command file:
> ptrace: No such process.
> (gdb)
>
> But when I do the same on installation with linkstrategy=monolithic
> compilation option it works normally.
>

Revision history for this message
Václav Šmilauer (eudoxos) wrote : Re: Script works only with linkstrategy=monolithic option

$ gdb yade-trunk
(gdb) run /tmp/pr.py
[wait till it crashes]
(gdb) thread apply all bt
(gdb) quit

Revision history for this message
Anton Gladky (gladky-anton) wrote : Re: [Bug 415265] Re: Script works only with linkstrategy=monolithic option

Starting program: /home/gladk/dem/yade/new_build/build/bin/yade-new_build
pr.py
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at
0000000000000158
[New Thread 0x7fc7be1ca7f0 (LWP 29612)]
[New Thread 0x7fc786663950 (LWP 29615)]
Python TCP server listening on localhost:9000, auth cookie is `cesasu'
[New Thread 0x7fc77e88f950 (LWP 29616)]
Running script pr.py
/usr/lib/python2.6/dist-packages/pytz/__init__.py:32: UserWarning: Module
pylab was already imported from /usr/lib/python2.6/dist-packages/pylab.py,
but /usr/lib/python2.6/dist-packages is being added to sys.path
  from pkg_resources import resource_stream
/usr/lib/python2.6/dist-packages/pytz/__init__.py:32: UserWarning: Module
matplotlib was already imported from
/usr/lib/python2.6/dist-packages/matplotlib/__init__.py, but
/usr/lib/python2.6/dist-packages is being added to sys.path
  from pkg_resources import resource_stream
[New Thread 0x7fc77b738950 (LWP 29617)]
[New Thread 0x7fc779d5a950 (LWP 29618)]
[New Thread 0x7fc779559950 (LWP 29619)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fc779559950 (LWP 29619)]
0x00007fc79ae6cd69 in InteractionDispatchers::action (
    .omp_data_i=0x7fc779d59c80)
    at pkg/common/Engine/MetaEngine/InteractionDispatchers.cpp:107
107
I->functorCache.constLaw->go(I->interactionGeometry,I->interactionPhysics,I.get(),rootBody);
(gdb) quit

______________________________
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy

2009/8/18 Václav Šmilauer <email address hidden>

>
> $ gdb yade-trunk
> (gdb) run /tmp/pr.py
> [wait till it crashes]
> (gdb) thread apply all bt
> (gdb) quit
>
> --
> Script works only with linkstrategy=monolithic option
> https://bugs.launchpad.net/bugs/415265
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Yet Another Dynamic Engine: New
>
> Bug description:
> When I start the simulation with the attached script, I get:
>
> gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> /home/gladk/.yade-current/gdb_crash_batch-pid13289:1: Error in sourced
> command file:
> ptrace: No such process.
> (gdb)
>
> But when I do the same on installation with linkstrategy=monolithic
> compilation option it works normally.
>

Revision history for this message
Anton Gladky (gladky-anton) wrote :
Download full text (9.3 KiB)

thread apply all bt

Thread 6 (Thread 0x7f6e43771950 (LWP 29629)):
#0 0x00007f6e650e4d69 in InteractionDispatchers::action
(.omp_data_i=0x7f6e43f71c80) at
pkg/common/Engine/MetaEngine/InteractionDispatchers.cpp:107
#1 0x00007f6e84a67c85 in ?? () from /usr/lib/libgomp.so.1
#2 0x00007f6e87caa3ba in start_thread () from /lib/libpthread.so.0
#3 0x00007f6e834f8fcd in clone () from /lib/libc.so.6
#4 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f6e43f72950 (LWP 29628)):
#0 0x00007f6e84a68b57 in ?? () from /usr/lib/libgomp.so.1
#1 0x00007f6e84a68041 in ?? () from /usr/lib/libgomp.so.1
#2 0x00007f6e650e5485 in InteractionDispatchers::action (this=0x30ac990,
rootBody=<value optimized out>) at
pkg/common/Engine/MetaEngine/InteractionDispatchers.cpp:107
#3 0x00000000004657da in MetaBody::moveToNextTimeStep (this=0x1b20c10) at
/home/gladk/dem/yade/new_build/trunk/core/MetaBody.cpp:93
#4 0x000000000046d4ba in SimulationFlow::singleAction (this=0x18b7230) at
/home/gladk/dem/yade/new_build/trunk/core/SimulationFlow.cpp:18
#5 0x00000000004647dc in ThreadRunner::call (this=<value optimized out>) at
/home/gladk/dem/yade/new_build/trunk/core/ThreadWorker.cpp:71
#6 0x0000000000464888 in ThreadRunner::run (this=0x1c4d630) at
/home/gladk/dem/yade/new_build/trunk/core/ThreadRunner.cpp:23
#7 0x00007f6e87a9f4de in boost::function0<void,
std::allocator<boost::function_base> >::operator() () from
/usr/lib/libboost_thread-gcc42-mt-1_34_1.so.1.34.1
#8 0x00007f6e87a9f162 in ?? () from
/usr/lib/libboost_thread-gcc42-mt-1_34_1.so.1.34.1
#9 0x00007f6e87caa3ba in start_thread () from /lib/libpthread.so.0
#10 0x00007f6e834f8fcd in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f6e45901950 (LWP 29627)):
#0 0x00007f6e834f1742 in select () from /lib/libc.so.6
#1 0x00007f6e45be4504 in ?? () from /usr/lib/libtcl8.5.so.0
#2 0x00007f6e87caa3ba in start_thread () from /lib/libpthread.so.0
#3 0x00007f6e834f8fcd in clone () from /lib/libc.so.6
#4 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f6e48a58950 (LWP 29626)):
#0 0x00007f6e834f1742 in select () from /lib/libc.so.6
#1 0x00007f6e88006618 in ?? () from /usr/lib/libpython2.6.so.1.0
#2 0x00007f6e87fb3dbe in PyEval_EvalFrameEx () from
/usr/lib/libpython2.6.so.1.0
#3 0x00007f6e87fb59a9 in PyEval_EvalCodeEx () from
/usr/lib/libpython2.6.so.1.0
#4 0x00007f6e87f3ba3d in ?? () from /usr/lib/libpython2.6.so.1.0
#5 0x00007f6e87f0cc48 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#6 0x00007f6e87f1d3c0 in ?? () from /usr/lib/libpython2.6.so.1.0
#7 0x00007f6e87f0cc48 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#8 0x00007f6e87fae7c6 in PyEval_CallObjectWithKeywords () from
/usr/lib/libpython2.6.so.1.0
#9 0x00007f6e87fe5dfd in ?? () from /usr/lib/libpython2.6.so.1.0
#10 0x00007f6e87caa3ba in start_thread () from /lib/libpthread.so.0
#11 0x00007f6e834f8fcd in clone () from /lib/libc.so.6
#12 0x0000000000000000 in ?? ()

---Type <return> to continue, or q <return> to quit---
Thread 2 (Thread 0x7f6e508db950 (LWP 29625)):
#0 0x00007f6e87cb17e1 in nanosleep () from /lib/libpthread.so.0
#1 0x00007f6e4baaf1f3 in pyOmega::step (this=0x1d77930) at
py/yadeWrapper/yade...

Read more...

Revision history for this message
Václav Šmilauer (eudoxos) wrote : Re: Script works only with linkstrategy=monolithic option

Thanks. Does it _really_ beahve differently with monolithic/per-class linkage? Is the backtrace any different?

Revision history for this message
Anton Gladky (gladky-anton) wrote : Re: [Bug 415265] Re: Script works only with linkstrategy=monolithic option

With monolithic - no crash at all.
______________________________
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy

2009/8/18 Václav Šmilauer <email address hidden>

> Thanks. Does it _really_ beahve differently with monolithic/per-class
> linkage? Is the backtrace any different?
>
> --
> Script works only with linkstrategy=monolithic option
> https://bugs.launchpad.net/bugs/415265
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Yet Another Dynamic Engine: New
>
> Bug description:
> When I start the simulation with the attached script, I get:
>
> gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> /home/gladk/.yade-current/gdb_crash_batch-pid13289:1: Error in sourced
> command file:
> ptrace: No such process.
> (gdb)
>
> But when I do the same on installation with linkstrategy=monolithic
> compilation option it works normally.
>

Revision history for this message
Anton Gladky (gladky-anton) wrote :
Download full text (3.4 KiB)

With monolithic:

(gdb) run pr.py
Starting program: /home/gladk/dem/yade/current/build/bin/yade-current pr.py
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at
0000000000000158
[New Thread 0x7f95927a97f0 (LWP 31085)]
[New Thread 0x7f95817bf950 (LWP 31088)]
Python TCP server listening on localhost:9000, auth cookie is `skcade'
[New Thread 0x7f9579841950 (LWP 31089)]
Running script pr.py
/usr/lib/python2.6/dist-packages/pytz/__init__.py:32: UserWarning: Module
pylab was already imported from /usr/lib/python2.6/dist-packages/pylab.py,
but /usr/lib/python2.6/dist-packages is being added to sys.path
  from pkg_resources import resource_stream
/usr/lib/python2.6/dist-packages/pytz/__init__.py:32: UserWarning: Module
matplotlib was already imported from
/usr/lib/python2.6/dist-packages/matplotlib/__init__.py, but
/usr/lib/python2.6/dist-packages is being added to sys.path
  from pkg_resources import resource_stream
[New Thread 0x7f95766ea950 (LWP 31090)]
[New Thread 0x7f9574e5b950 (LWP 31091)]
[New Thread 0x7f957465a950 (LWP 31092)]
[Thread 0x7f9574e5b950 (LWP 31091) exited]
/var/lib/python-support/python2.6/IPython/Magic.py:38: DeprecationWarning:
the sets module is deprecated
  from sets import Set

    __ __ ____ ____ _
    \ \ / /_ _| _ \ ___ / ___|___ _ __ ___ ___ | | ___
     \ V / _` | | | |/ _ \ | | / _ \| '_ \/ __|/ _ \| |/ _ \
      | | (_| | |_| | __/ | |__| (_) | | | \__ \ (_) | | __/
      |_|\__,_|____/ \___| \____\___/|_| |_|___/\___/|_|\___|

In [1]: exit
Out[1]: Type exit() to exit.

In [2]: exit()
Do you really want to exit ([y]/n)? y
Bye.
[Thread 0x7f95817bf950 (LWP 31088) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f95927a97f0 (LWP 31085)]
0x0000000000000000 in ?? ()
(gdb) quit
The program is running. Exit anyway? (y or n) y

______________________________
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy

2009/8/18 Anton Gladky <email address hidden>

> With monolithic - no crash at all.
> ______________________________
> [ENG] Best Regards
> [GER] Mit freundlichen Grüßen
> [RUS] С наилучшими пожеланиями
> [UKR] З найкращими побажаннями
>
> Anton Gladkyy
>
>
> 2009/8/18 Václav Šmilauer <email address hidden>
>
>> Thanks. Does it _really_ beahve differently with monolithic/per-class
>>
>> linkage? Is the backtrace any different?
>>
>> --
>> Script works only with linkstrategy=monolithic option
>> https://bugs.launchpad.net/bugs/415265
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>> Status in Yet Another Dynamic Engine: New
>>
>> Bug description:
>> When I start the simulation with the attached script, I get:
>>
>> gdb 6.8-debian
>> Copyright (C) 2008 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later <
>> http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
>> and "show warranty" for details.
>> This GD...

Read more...

Revision history for this message
Anton Gladky (gladky-anton) wrote : Re: Script works only with linkstrategy=monolithic option

This bug is still appears.

Seems, it first appeared a week ago probably.

summary: - Script works only with linkstrategy=monolithic option
+ Script works only with linkStrategy=monolithic option
Revision history for this message
Anton Gladky (gladky-anton) wrote :

When I delete those strings:

InteractionDispatchers(
  [ef2_Sphere_Sphere_Dem3DofGeom(distanceFactor=intRadius,label='ss2d3dg'),ef2_Facet_Sphere_Dem3DofGeom()],
  [Ip2_RpmMat_RpmMat_RpmPhys()],
  [Law2_Dem3DofGeom_RockPMPhys_Rpm()]
 ),

It does not call a crash. But it also does not work normally :)

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

Broke other examples as well, it seems. Looking at it.

Changed in yade:
importance: Undecided → Critical
milestone: none → 0.20-0
status: New → Confirmed
Revision history for this message
Václav Šmilauer (eudoxos) wrote :

Is really bug in the dispatching code, see https://lists.launchpad.net/yade-dev/msg01782.html for details

summary: - Script works only with linkStrategy=monolithic option
+ Script works only with linkStrategy=monolithic option (dispatching bug)
Changed in yade:
assignee: nobody → Janek Kozicki (cosurgi)
Revision history for this message
Janek Kozicki (cosurgi) wrote :

there may be some conflict between dispatcher code and the way of loading plugin classes. IIRC you were modifying that to allow static & monolithic builds. I need to check that

Revision history for this message
Janek Kozicki (cosurgi) wrote :

hm, I am unable to run this script pr.py:

Running script pr.py
/usr/lib/python2.5/site-packages/pytz/__init__.py:32: UserWarning: Module dateutil was already imported from /usr/lib/pymodules/python2.5/dateutil/__init__.py, but /usr/lib/pymodules/python2.5 is being added to sys.path
  from pkg_resources import resource_stream
Traceback (most recent call last):
  File "/home/janek/tmp/ZZ/BIN/lib/yade-ZZ-test-fast/gui/PythonUI_rc.py", line 128, in <module>
    execfile(runtime.script)
  File "pr.py", line 56, in <module>
    ids_spheres=O.bodies.append(pack.regularHexa(pack.inCylinder((0,0,-boxHeight/2*boxCoef),(0,0,-boxHeight/2*boxCoef+h),a),radius=radiusGrain,gap=distBetweenGrains,color=(0.282,0.875,1),exampleNumber=1,initCohesive=True,**kw))
  File "/home/janek/tmp/ZZ/BIN/lib/yade-ZZ-test-fast/py/yade/pack.py", line 172, in regularHexa
    for i,j,k in itertools.product(ii,jj,kk):
AttributeError: 'module' object has no attribute 'product'

Revision history for this message
Anton Gladky (gladky-anton) wrote :

I have just tested it again. It works.

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

OIC, itertools.product was added in python 2.6 :-|

Revision history for this message
Janek Kozicki (cosurgi) wrote :

heh, and python 2.6 is in debian experimental... Will take few months at least to get down to testing. Although I could probably port it myself. But you have just said that your new locateMultivirtualFunctor2D works?

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

I just commited that thing. Anton, how it could have worked? It wasn't commited yet. ;-)

Janek: dispatcher and loading plugins should be independent. The code in the dispatcher was really buggy. (I don't know why it worked with monolithic, though.)

Revision history for this message
Anton Gladky (gladky-anton) wrote : Re: [Bug 415265] Re: Script works only with linkStrategy=monolithic option (dispatching bug)

It worked with monolithic.

I have several installations, some of them monolithic, some not. monolithic
worked :)
______________________________
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy

2009/8/21 Václav Šmilauer <email address hidden>

> I just commited that thing. Anton, how it could have worked? It wasn't
> commited yet. ;-)
>
> Janek: dispatcher and loading plugins should be independent. The code in
> the dispatcher was really buggy. (I don't know why it worked with
> monolithic, though.)
>
> --
> Script works only with linkStrategy=monolithic option (dispatching bug)
> https://bugs.launchpad.net/bugs/415265
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Yet Another Dynamic Engine: Confirmed
>
> Bug description:
> When I start the simulation with the attached script, I get:
>
> gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> /home/gladk/.yade-current/gdb_crash_batch-pid13289:1: Error in sourced
> command file:
> ptrace: No such process.
> (gdb)
>
> But when I do the same on installation with linkstrategy=monolithic
> compilation option it works normally.
>

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

Janek, can you test with r1716? I worked around that python 2.5 error. If you find other things like that, let me know.

Revision history for this message
Janek Kozicki (cosurgi) wrote :

yes, with r1716 it works.

I'm curious to know what was the bug in dispatcher, since it worked buggy for so many years :/

Revision history for this message
Anton Gladky (gladky-anton) wrote :

r1716 works normally!

Thank you!

Changed in yade:
assignee: Janek Kozicki (cosurgi) → Václav Šmilauer (eudoxos)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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