<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: map-&amp;gt;insert() it killing my process, the program just aborts in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036324#M93932</link>
    <description>&lt;P&gt;If your process aborts, you need to show a stack trace.&lt;BR /&gt;&lt;BR /&gt;typedef std::map mapamemoria;&lt;BR /&gt;typedef std::pair Map_Str_Pair;&lt;BR /&gt;&lt;BR /&gt;The last typedef is illegal. You must NOT define the pair used in a map. You must use STL typedefs to compute it:&lt;BR /&gt;typedef mapamemoria::value_type Map_Str_Pair;&lt;BR /&gt;&lt;BR /&gt;Is string the same as std::string?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;the insert() compiled successfully&lt;BR /&gt;&lt;BR /&gt;I don't see how with the wrong Map_Str_Pair.&lt;BR /&gt;&lt;BR /&gt;// attach to the segment to get a pointer to it:&lt;BR /&gt;data_ptr = (dataestrutura*)shmat(shmid,0, 0);&lt;BR /&gt;&lt;BR /&gt;Don't even think of doing this. This won't work! You'll have the same problems as in your:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1139789" target="_blank"&gt;http://h30499.www3.hp.com/t5/Languages-and-Scripting/IPC-shared-memory-with-a-linked-list-or-a-hash-table/m-p/4044982&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(Where I mention using a "STL allocator".)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;then I have to fill up the map in memory segment: WELL this it is not working, compiles but on execution kills the program&lt;BR /&gt;data_ptr-&amp;gt;mapa_mem=xmlelementos_oracle_bd;&lt;BR /&gt;&lt;BR /&gt;I'm not sure why this won't work. But it is useless. You can't have a shared pointer to private data. Only the original process can use that pointer to that map.&lt;BR /&gt;&lt;BR /&gt;A stack trace would be helpful here.&lt;/P&gt;</description>
    <pubDate>Sun, 25 Sep 2011 22:17:00 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-09-25T22:17:00Z</dc:date>
    <item>
      <title>map-&gt;insert() it killing my procees the program just aborts</title>
      <link>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036321#M93929</link>
      <description>map-&amp;gt;insert() it killing my procees the program just aborts &lt;BR /&gt;&lt;BR /&gt;typedef std::map &lt;STRING&gt; mapamemoria;&lt;BR /&gt;typedef std::pair&lt;STRING&gt; Map_Str_Pair;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void streamFileXML(const char *filename,char * tag_oracle,mapamemoria *mapa_colunas) &lt;BR /&gt;                   try&lt;BR /&gt;                      {&lt;BR /&gt;                       // mapa_colunas-&amp;gt;insert(Map_Str_Pair("sdfsdfds","uiyuiyui"));                      &lt;BR /&gt;                       (*mapa_colunas)["elemento"]="ola";                       &lt;BR /&gt;                       //(char *)namexml_temp;                                              &lt;BR /&gt;                       (*mapa_colunas)["texto"]="ole";                       &lt;BR /&gt;                       //(char *)oracle_value;                                              &lt;BR /&gt;                      }&lt;BR /&gt;                      catch(exception e)&lt;BR /&gt;                      {&lt;BR /&gt;                           sprintf(sstring, "excepcao  -- &amp;gt;%s",e.what()); &lt;BR /&gt;                        log_message(LOG_FILE,sstring); &lt;BR /&gt;                      }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;this the makefile&lt;BR /&gt;&lt;BR /&gt;# Fichero de construcción del proyecto Schengen&lt;BR /&gt;&lt;BR /&gt;DIR_ACTUAL=$(shell echo $(PWD))&lt;BR /&gt;INCLUDE=.,$(DIR_ACTUAL)/common&lt;BR /&gt;OBJS=&lt;BR /&gt;CCC=aCC&lt;BR /&gt;ICLIBHOME=/usr/local/lib/hpux32&lt;BR /&gt;ICLIBPATH=-L$(ICLIBHOME)&lt;BR /&gt;CCLIB=$(ICLIBPATH) -lxml2 -lz &lt;BR /&gt;INCLUDES=/usr/local/include/libxml2 &lt;BR /&gt;EXE=daemon&lt;BR /&gt;&lt;BR /&gt;all: exe&lt;BR /&gt;&lt;BR /&gt;daemon.o: daemon.cc&lt;BR /&gt; $(CCC) -c  daemon.cc -I$(INCLUDES)&lt;BR /&gt; cp *.o ../../obj&lt;BR /&gt; rm *.o&lt;BR /&gt; &lt;BR /&gt;exe: daemon.o&lt;BR /&gt;&lt;BR /&gt; $(CCC) -o  $(EXE) ../../obj/daemon.o $(CCLIB) &lt;BR /&gt; cp $(EXE) ../../bin&lt;BR /&gt; rm $(EXE)&lt;BR /&gt;&lt;BR /&gt;.PHONY: clean&lt;BR /&gt;clean:&lt;BR /&gt; -rm ../obj/*.o&lt;/STRING&gt;&lt;/STRING&gt;</description>
      <pubDate>Thu, 12 Jul 2007 07:05:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036321#M93929</guid>
      <dc:creator>Pedro Dinis</dc:creator>
      <dc:date>2007-07-12T07:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: map-&gt;insert() it killing my procees the program just aborts</title>
      <link>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036322#M93930</link>
      <description>the insert() compiled successfully but aborts the program&lt;BR /&gt;&lt;BR /&gt;so i have tried this  &lt;BR /&gt;&lt;BR /&gt;(*mapa_colunas)["elemento"]="ola";&lt;BR /&gt;//(char *)namexml_temp;&lt;BR /&gt;(*mapa_colunas)["texto"]="ole"; &lt;BR /&gt;&lt;BR /&gt;still does not work</description>
      <pubDate>Thu, 12 Jul 2007 07:07:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036322#M93930</guid>
      <dc:creator>Pedro Dinis</dc:creator>
      <dc:date>2007-07-12T07:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: map-&gt;insert() it killing my procees the program just aborts</title>
      <link>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036323#M93931</link>
      <description>i have made some changes in the function i am passing the address of the map&lt;BR /&gt;&lt;BR /&gt;void streamFileXML(const char *filename,char * tag_oracle,mapamemoria &amp;amp;mapa_colunas) &lt;BR /&gt;&lt;BR /&gt;                      try&lt;BR /&gt;                      {&lt;BR /&gt;                      mapa_colunas.insert(Map_Str_Pair((char *)namexml_temp,(char *)oracle_value));       &lt;BR /&gt;                                             &lt;BR /&gt;                      }&lt;BR /&gt;                      catch(exception e)&lt;BR /&gt;                      {&lt;BR /&gt;                           sprintf(sstring, "excepcao  -- &amp;gt;%s",e.what()); &lt;BR /&gt;                        log_message(LOG_FILE,sstring); &lt;BR /&gt;                      }&lt;BR /&gt;&lt;BR /&gt;this works BUT:&lt;BR /&gt;&lt;BR /&gt;i have this struct with a map inside&lt;BR /&gt;&lt;BR /&gt;typedef struct dataestrutura {&lt;BR /&gt;   mapamemoria mapa_mem;  &lt;BR /&gt;} dataestrutura;&lt;BR /&gt;&lt;BR /&gt;i have this pointer to it in the function&lt;BR /&gt;&lt;BR /&gt;   dataestrutura  *data_ptr;&lt;BR /&gt;&lt;BR /&gt;   mapamemoria xmlelementos_oracle_bd;&lt;BR /&gt;&lt;BR /&gt;     m_shmid=shmid;&lt;BR /&gt;     /* attach to the segment to get a pointer to it: */&lt;BR /&gt;     data_ptr = (dataestrutura *)shmat(shmid,0, 0);&lt;BR /&gt;     if (data_ptr  == (dataestrutura *)(-1)) &lt;BR /&gt;     {&lt;BR /&gt;       perror("shmat");&lt;BR /&gt;       exit(1);&lt;BR /&gt;     }&lt;BR /&gt;&lt;BR /&gt;i am going to fill up the map :&lt;BR /&gt;&lt;BR /&gt;streamFileXML(CONFIG_FILE_NAME,ORACLE_BD_TAG, xmlelementos_oracle_bd);    &lt;BR /&gt;&lt;BR /&gt;then i have to fill up the map in memory segment :&lt;BR /&gt;WELL this it is not working , compiles but on execution kills the program -- abort&lt;BR /&gt;data_ptr-&amp;gt;mapa_mem=xmlelementos_oracle_bd;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Jul 2007 08:45:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036323#M93931</guid>
      <dc:creator>Pedro Dinis</dc:creator>
      <dc:date>2007-07-12T08:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: map-&gt;insert() it killing my process, the program just aborts</title>
      <link>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036324#M93932</link>
      <description>&lt;P&gt;If your process aborts, you need to show a stack trace.&lt;BR /&gt;&lt;BR /&gt;typedef std::map mapamemoria;&lt;BR /&gt;typedef std::pair Map_Str_Pair;&lt;BR /&gt;&lt;BR /&gt;The last typedef is illegal. You must NOT define the pair used in a map. You must use STL typedefs to compute it:&lt;BR /&gt;typedef mapamemoria::value_type Map_Str_Pair;&lt;BR /&gt;&lt;BR /&gt;Is string the same as std::string?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;the insert() compiled successfully&lt;BR /&gt;&lt;BR /&gt;I don't see how with the wrong Map_Str_Pair.&lt;BR /&gt;&lt;BR /&gt;// attach to the segment to get a pointer to it:&lt;BR /&gt;data_ptr = (dataestrutura*)shmat(shmid,0, 0);&lt;BR /&gt;&lt;BR /&gt;Don't even think of doing this. This won't work! You'll have the same problems as in your:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1139789" target="_blank"&gt;http://h30499.www3.hp.com/t5/Languages-and-Scripting/IPC-shared-memory-with-a-linked-list-or-a-hash-table/m-p/4044982&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(Where I mention using a "STL allocator".)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;then I have to fill up the map in memory segment: WELL this it is not working, compiles but on execution kills the program&lt;BR /&gt;data_ptr-&amp;gt;mapa_mem=xmlelementos_oracle_bd;&lt;BR /&gt;&lt;BR /&gt;I'm not sure why this won't work. But it is useless. You can't have a shared pointer to private data. Only the original process can use that pointer to that map.&lt;BR /&gt;&lt;BR /&gt;A stack trace would be helpful here.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2011 22:17:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/map-gt-insert-it-killing-my-procees-the-program-just-aborts/m-p/4036324#M93932</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-25T22:17:00Z</dc:date>
    </item>
  </channel>
</rss>

