Bug 228981 - Crash when trying to plot implicite x^y = y^x
Summary: Crash when trying to plot implicite x^y = y^x
Status: CONFIRMED
Alias: None
Product: kmplot
Classification: Applications
Component: general (show other bugs)
Version: 1.2.1
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Klaus-Dieter M
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-28 23:51 UTC by Christoph Feck
Modified: 2020-12-13 09:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Feck 2010-02-28 23:51:12 UTC
Application: kmplot (1.2.1)
KDE Platform Version: 4.4.65 (KDE 4.4.65 (KDE 4.5 >= 20100224)) (Compiled from sources)
Qt Version: 4.6.3
Operating System: Linux 2.6.31.12-0.1-desktop i686
Distribution: "openSUSE 11.2 (i586)"

-- Information about the crash:
- What I was doing when the application crashed:
* Create implitic Plot
* Enter x^y = y^x as relation
* Press "Enter"
-> Crash

The crash can be reproduced every time.

 -- Backtrace:
Application: KmPlot (kmplot), signal: Aborted
[KCrash Handler]
#6  0xffffe424 in __kernel_vsyscall ()
#7  0xb5af40cf in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#8  0xb5af59e7 in abort () at abort.c:88
#9  0xb5aecefe in __assert_fail (assertion=0xb38f6782 "setFstrOk", file=0xb38f6584 "/local/svn/kde/trunk/KDE/kdeedu/kmplot/kmplot/view.cpp", line=1374, function=
    0xb38f74e0 "void View::drawImplicit(Function*, QPainter*)") at assert.c:78
#10 0xb38a6ff9 in View::drawImplicit (this=0x81cc0b0, function=0x9774258, painter=0xbff96cdc) at /local/svn/kde/trunk/KDE/kdeedu/kmplot/kmplot/view.cpp:1374
#11 0xb38a25ae in View::draw (this=0x81cc0b0, dev=0x81cc1cc, medium=Screen) at /local/svn/kde/trunk/KDE/kdeedu/kmplot/kmplot/view.cpp:409
#12 0xb38ae866 in View::drawPlot (this=0x81cc0b0) at /local/svn/kde/trunk/KDE/kdeedu/kmplot/kmplot/view.cpp:2975
#13 0xb3874453 in FunctionEditor::saveFunction (this=0x81d4188, tempFunction=0xbff96db8) at /local/svn/kde/trunk/KDE/kdeedu/kmplot/kmplot/functioneditor.cpp:732
#14 0xb3873f22 in FunctionEditor::saveImplicit (this=0x81d4188) at /local/svn/kde/trunk/KDE/kdeedu/kmplot/kmplot/functioneditor.cpp:678
#15 0xb3874eb2 in FunctionEditor::qt_metacall (this=0x81d4188, _c=InvokeMetaMethod, _id=13, _a=0xbff970bc) at /local/build/KDE/kdeedu/kmplot/kmplot/functioneditor.moc:106
#16 0xb696befd in QMetaObject::metacall (object=0x81d4188, cl=18374, idx=47, argv=0xbff970bc) at kernel/qmetaobject.cpp:237
#17 0xb697ad2a in QMetaObject::activate (sender=0x82743e0, m=0xb6a7e5a4, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3285
#18 0xb69cee05 in QTimer::timeout (this=0x82743e0) at .moc/release-shared/moc_qtimer.cpp:134
#19 0xb6983086 in QTimer::timerEvent (this=0x82743e0, e=0xbff97614) at kernel/qtimer.cpp:271
#20 0xb6977834 in QObject::event (this=0x82743e0, e=0x6) at kernel/qobject.cpp:1204
#21 0xb5e9a15c in QApplicationPrivate::notify_helper (this=0x807b918, receiver=0x82743e0, e=0xbff97614) at kernel/qapplication.cpp:4300
#22 0xb5ea0fa8 in QApplication::notify (this=0xbff97948, receiver=0x82743e0, e=0xbff97614) at kernel/qapplication.cpp:4183
#23 0xb6fd5dd4 in KApplication::notify (this=0xbff97948, receiver=0x82743e0, event=0xbff97614) at /local/svn/kde/trunk/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#24 0xb6966b8e in QCoreApplication::notifyInternal (this=0xbff97948, receiver=0x82743e0, event=0xbff97614) at kernel/qcoreapplication.cpp:704
#25 0xb6996d7e in sendEvent (event=<value optimized out>, receiver=<value optimized out>) at kernel/qcoreapplication.h:215
#26 QTimerInfoList::activateTimers (event=<value optimized out>, receiver=<value optimized out>) at kernel/qeventdispatcher_unix.cpp:617
#27 0xb69939e2 in timerSourceDispatch (source=0x807e780) at kernel/qeventdispatcher_glib.cpp:184
#28 0xb55784c2 in g_main_dispatch (context=<value optimized out>) at gmain.c:1960
#29 IA__g_main_context_dispatch (context=<value optimized out>) at gmain.c:2513
#30 0xb557bd98 in g_main_context_iterate (context=0x807d518, block=<value optimized out>, dispatch=1, self=0x807bab0) at gmain.c:2591
#31 0xb557bebe in IA__g_main_context_iteration (context=0x807d518, may_block=1) at gmain.c:2654
#32 0xb69936b1 in QEventDispatcherGlib::processEvents (this=0x807b8d8, flags=...) at kernel/qeventdispatcher_glib.cpp:412
#33 0xb5f5aaba in QGuiEventDispatcherGlib::processEvents (this=0x807b8d8, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#34 0xb69651fd in QEventLoop::processEvents (this=0xbff978c4, flags=) at kernel/qeventloop.cpp:149
#35 0xb6965649 in QEventLoop::exec (this=0xbff978c4, flags=...) at kernel/qeventloop.cpp:201
#36 0xb69697c0 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#37 0xb5e9a204 in QApplication::exec () at kernel/qapplication.cpp:3579
#38 0x0804fe66 in main (argc=1, argv=0xbff97ae4) at /local/svn/kde/trunk/KDE/kdeedu/kmplot/kmplot/main.cpp:79

Reported using DrKonqi
Comment 1 Anne-Marie Mahfouf 2010-03-02 11:10:22 UTC
No crash in 4.4 branch revision 1097441 but reproduced in trunk.
Comment 2 Anne-Marie Mahfouf 2010-03-02 18:27:12 UTC
It's x^y=1 or y^x=1 which crash for me apparently.
Christoph, no clue where I can look? (I noticed you fixed some code in KmPlot in the past)
Comment 3 Christoph Feck 2010-03-04 19:29:11 UTC
The bugs are fixed were only cosmetical and parser related. I nonetheless looked at the issue more deeply. This is what I found out:

1. You can trigger it with more simple relations, such as "x^2=y^2".
2. You can work around it by using a "fuzzy" compare, such as "x^2=y^2+0.01".
3. By gradually making the fuzzy constant smaller (e.g. 0.001 etc), you see the problem: the graph crosses itself, and the internal implicit plot algorithm does not handle this.
4. By simply removing the assert, you get wrong plots, e.g. one line stops at the subdivision quadrant where the intersection occurs.

In other words, to fix this bug requires someone familiar with both the code as well as implicit plots and its singularities handling, i.e. most probably the original author. Is he still around?

Also try "sin x+cos y=0.01", and watch the intersections when lowering the fuzzy value :)
Comment 4 eike.krumbacher 2011-11-13 15:40:46 UTC
Hi!

Works for me. 

Version 1.2.1, KDE development platform ckecked out from git. (4.7.3)

Creating an implicit plot with g(x,y) = x^y = y^x results in a correct plot.

I think we can close this bug. 

Eike
Comment 5 Christoph Feck 2011-11-14 00:45:56 UTC
The assert instruction is still in the code, and it still asserts when plotting it. You probably have not compiled in debug mode.
Comment 6 Justin Zobel 2020-12-13 02:38:03 UTC
Christoph, as it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 7 Christoph Feck 2020-12-13 09:42:34 UTC
It still crashes, just type "sin x+cos y=0" to reproduce.