#301 closed bug (invalid)
Crash in MUIP_DupText ?
Reported by: | Guillaume Boesel | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 4.0-2016R2 |
Component: | muimaster.library | Version: | 4.0-2016R1 |
Severity: | minor | Keywords: | |
Cc: | OS Platform: | AmigaOS4 | |
Blocked By: | Blocking: | ||
Release Notes: |
Description
Summary
Hi,
trying to insert records in a NList from a child process (CreateNewProcTags) with
DoMethod(app,MUIM_Application_PushMethod,
LV_Fichiers_NList,3,MUIM_NList_InsertSingle, &ent, MUIV_NList_Insert_Bottom);
sometimes crashs my program with
Stack trace:
native kernel module newlib.library.kmod+0x0002fed8
MUIP_Duptext()+0xb4 (section 1 @ 0x13A2C)
native kernel module intuition.library.kmod+0x00020da8
native kernel module intuition.library.kmod+0x00020f4c
native kernel module intuition.library.kmod+0x00021228
native kernel module intuition.library.kmod+0x00009b34
native kernel module intuition.library.kmod+0x00009dd4
NotifyDispatcher()+0x2a0 (section 1 @ 0x63E6C)
native kernel module intuition.library.kmod+0x00020da8
native kernel module intuition.library.kmod+0x00020f4c
native kernel module intuition.library.kmod+0x00009efc
AreaDispatcher()+0xc88 (section 1 @ 0x359F4)
native kernel module intuition.library.kmod+0x00020da8
native kernel module intuition.library.kmod+0x00020f4c
native kernel module intuition.library.kmod+0x00009efc
TextDispatcher()+0xdc (section 1 @ 0x75B70)
native kernel module intuition.library.kmod+0x00020da8
native kernel module intuition.library.kmod+0x00020f4c
native kernel module intuition.library.kmod+0x0000a044
m_Application_NewInput()+0xc28 (section 1 @ 0x289AC)
ApplicationDispatcher()+0x18d4 (section 1 @ 0x2CF68)
Could you give me an advice about this error. What can be the cause of this MUIP_Duptext() problem in my program ?
Thank you by advance.
Guillaume
Attachments (1)
Change History (6)
comment:1 Changed 49 years ago by
Status: | pending → new |
---|
Changed 3 years ago by
Attachment: | Crashlog_FastView_2016-04-05_23-25-02.txt added |
---|
comment:1 Changed 3 years ago by
Component: | undefined → muimaster.library |
---|---|
Milestone: | future release → 4.0-2016R2 |
Priority: | undecided → normal |
Status: | new → pending |
comment:2 Changed 3 years ago by
Thank you for your explanation. I thought (I don't know why…) that PushMethod waited that the Method was completed before to exit.
comment:3 Changed 3 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
No. PushMethod must be asynchronous. It can even be called from the application's main task. Imagine it would be synchronous in that situation…
You gave the cause of the crash yourself already. It is how you insert the new entry into the list:
I suppose "ent" is a local variable of one of your child process's functions containing the data to be inserted. You must keep in mind that this variable most probably does not exist anymore (i.e. the pushing function is left or the child process terminated in the meantime) at the time when MUIM_Application_PushMethod eventually executes the pushed MUIM_NList_InsertSingle method. That's what is causing the crash.
MUIP_Duptext() is a private function of muimaster.library to duplicate a text string. I cannot tell why it occurs in the stack trace, but I guess it just happens to end up there because of stale pointers and hence wrong functions being called as described above.
If you want to push methods like this for deferred execution you must ensure that the parameters and their contents stay valid until the pushed method is eventually executed.
In YAM we implemented a "method stack" for synchronous and asynchronous execution of methods from child processes: MethodStack.c. I think you will need something similar for your application.