just a guess.

EMC_TASK_SET_STATE *state_msg;

state_msg is a pointer, yet no memory allocated for it.

state_msg->state = EMC_TASK_STATE_OFF;

you try to write in a memory space that officially has no memory assigned yet.

ju


________________________________
From: emc-developers-requ...@lists.sourceforge.net 
<emc-developers-requ...@lists.sourceforge.net>
Sent: Thursday, December 19, 2019 7:13 AM
To: emc-developers@lists.sourceforge.net <emc-developers@lists.sourceforge.net>
Subject: Emc-developers Digest, Vol 164, Issue 10

Send Emc-developers mailing list submissions to
        emc-developers@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/emc-developers
or, via email, send a message with subject or body 'help' to
        emc-developers-requ...@lists.sourceforge.net

You can reach the person managing the list at
        emc-developers-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Emc-developers digest..."


Today's Topics:

   1. Re: Wrong value by M6 remap shown in gmoccapy (mydani)
   2. Linuxcnc gui on c++ gui ... segmentation error for
      EMC_TASK_SET_STATE (theman whosoldtheworld)


----------------------------------------------------------------------

Message: 1
Date: Wed, 18 Dec 2019 20:52:57 +0100
From: mydani <myd...@gmx.de>
To: linuxcnc-developers <emc-developers@lists.sourceforge.net>
Subject: Re: [Emc-developers] Wrong value by M6 remap shown in
        gmoccapy
Message-ID:
        <CAELy+69CgyNA8n11U=-aFnwD0W=ex5fxpzh9hnat03ukjuy...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

I'm sorry for bugging you guys, just shortly after sending to the list I
figured it out. But did stare a day into it before w/o reckognizing...
My branch for a "pocket based" non random toolchanger is working fine.
Tools are ordered but the changer works only based on the pockets
associated to the tool.
So tool can now be any number, as long as the pocket is valid for the
changer, it works.

Question to the dev process - is there any written rule when/how a branch
can be part of the linuxcnc github repo?

Regards,
Daniel

PS: The adaptations base on the ones from Rene and are merged on the latest
2.8 branch. You can find them here:
https://github.com/mydani/linuxcnc/tree/2.8-pocket-fix

Am Mi., 18. Dez. 2019 um 07:29 Uhr schrieb mydani <myd...@gmx.de>:

> Hello folks,
>
> I am currently playing with the recent 2.8 and merged my branch for a tool
> changer support into the C-part of linuxcnc.
> In axis all is proper, then I started to use gmoccapy and I faced a
> strange situation there.
> In my change.ngc macro, I show the interesting values by these lines:
>
> (debug, current tool: #<_current_tool>)
> (debug, current pocket: #<_current_pocket>)
> (debug, selected tool: #<_selected_tool>)
> (debug, selected pocket: #<_selected_pocket>)
>
> In my tooltable I am just using 2 tools to show the behavior. Tool 1 has
> pocket 101, tool 2 has pocket 2.
>
> Scenario 1) change from t1 to t2 => all works as expected, the values
> shown in gmoccapy are exactly what I can see in the debuggers (both C and
> python).
>
> Scenario 2) change from t2 to t1 => the pocket value for tool 1 is shown
> as -1, while it imho should be 101. In the debuggers I can see in the
> epilog, that the value of the variable is in fact 101 at that time.
> However I notized gmoccapy shows the debug messages after (!) the epilog
> function was run through. So I wonder whether a race condition could occure
> there. But then I wonder also why with smaller pocket values the issue is
> not observed.
>
> Pictures of scenario 1&2 can be found here:
> Scen1:
> https://i.ibb.co/2sDFLd2/01-Change-T1-T2-Prolog.png
> https://i.ibb.co/8YqRfhD/02-Change-T1-T2-Epilog.png
> https://i.ibb.co/zZVzv4d/03-Change-T1-T2-Gmoccapy-Debug-Msg.png
>
> Scen2:
> https://i.ibb.co/jLTx0Qg/04-Change-T2-T1-Prolog.png
> https://i.ibb.co/0Mbv5DG/05-Change-T2-T1-Epilog.png
> https://i.ibb.co/ZHS4nRV/06-Change-T2-T1-Gmoccapy-Debug-Msg.png
>
>
> Looking forward on any hint which helps me understand this.
>
>
>
>
> Thanks and regards
> Daniel
>
> PS: excuse me if I am not supposed to sent screenshots along, will do
> otherwise / store otherwhere if told so.
>


------------------------------

Message: 2
Date: Thu, 19 Dec 2019 12:59:59 +0100
From: theman whosoldtheworld <bleachk...@gmail.com>
To: EMC developers <emc-developers@lists.sourceforge.net>
Subject: [Emc-developers] Linuxcnc gui on c++ gui ... segmentation
        error for EMC_TASK_SET_STATE
Message-ID:
        <CAG9VtTM11fy9+=UJdB+TjRNj=x3jspykb_ajxmxajxdh10h...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hi at all,

after 1 or 2 years I resumed my old project to have a C ++ application made
by c++.
On my pc I have Lcnc2.8 userspace ... (no rt no preeempt, only for test).

I am willing to make my work available to everyone, also because I need
help to learn how to deal with Linuxcnc files. Now, inspired by the old
xemc.cc, I'm trying to send commands from my application to a linuxcnc
instance that runs on my pc (userspace). For debug use of course axis
launched from terminal. I have been trying to understand for two days, but
being able to draw only from the old xemc files may be that today things
have changed.

In particular I realized that the code to send commands is this for example:

                EMC_TASK_SET_STATE *state_msg;
                state_msg->state = EMC_TASK_STATE_OFF;
                state_msg->serial_number = ++emcCommandSerialNumber;
                emcCommandBuffer->write(state_msg);

Only that every time I use it I get the error segmentation error (core dump
..)
The reading part of the value of the 3 axes does not give any problem.
obviusly I'm reading "motion.traj.position.tran(x-y-z)" ... wich I think is
the value of the axis trajectory ... or is the value of the axis or the
joint? How can read the "other" values?

Real thanks for any suggestion
bkt


------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


------------------------------

End of Emc-developers Digest, Vol 164, Issue 10
***********************************************

_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to