Strange reset when reading strings from PROGMEM

i have the following code

#include <avr/pgmspace.h>
// The list is from http://www.cosmobrain.com/cosmobrain/res/brightstar.html
const prog_char Star01[] PROGMEM = "Sirius";
const prog_char Star02[] PROGMEM = "Canopus";
const prog_char Star03[] PROGMEM = "Arcturus";
const prog_char Star04[] PROGMEM = "RigilKentaurus";
const prog_char Star05[] PROGMEM = "Vega";
const prog_char Star06[] PROGMEM = "Capella";
const prog_char Star07[] PROGMEM = "Rigel";
const prog_char Star08[] PROGMEM = "Procyon";
const prog_char Star09[] PROGMEM = "Achernar";
const prog_char Star10[] PROGMEM = "Betelgeuse";
const prog_char Star11[] PROGMEM = "Hadar";
const prog_char Star12[] PROGMEM = "Altair";
const prog_char Star13[] PROGMEM = "Aldebaran";
const prog_char Star14[] PROGMEM = "Antares";
const prog_char Star15[] PROGMEM = "Spica";
const prog_char Star16[] PROGMEM = "Pollux";
const prog_char Star17[] PROGMEM = "Fomalhaut";
const prog_char Star18[] PROGMEM = "Mimosa";
const prog_char Star19[] PROGMEM = "Deneb";
const prog_char Star20[] PROGMEM = "Acrux";
const prog_char Star21[] PROGMEM = "Regulus";
const prog_char Star22[] PROGMEM = "Adhara";
const prog_char Star23[] PROGMEM = "Gacrux";
const prog_char Star24[] PROGMEM = "Shaula";
const prog_char Star25[] PROGMEM = "Bellatrix";
const prog_char Star26[] PROGMEM = "ElNath";
const prog_char Star27[] PROGMEM = "Miaplacidus";
const prog_char Star28[] PROGMEM = "Alnilan";
const prog_char Star29[] PROGMEM = "AlNa'ir";
const prog_char Star30[] PROGMEM = "Alioth";
const prog_char Star31[] PROGMEM = "Gama2";
const prog_char Star32[] PROGMEM = "Mirfak";
const prog_char Star33[] PROGMEM = "Dubhe";
const prog_char Star34[] PROGMEM = "Wezen";
const prog_char Star35[] PROGMEM = "KausAustralis";
const prog_char Star36[] PROGMEM = "Avior";
const prog_char Star37[] PROGMEM = "Alkaid";
const prog_char Star38[] PROGMEM = "Sargas";
const prog_char Star39[] PROGMEM = "Menkaliman";
const prog_char Star40[] PROGMEM = "Atria";
const prog_char Star41[] PROGMEM = "Alhena";
const prog_char Star42[] PROGMEM = "Peacock";
const prog_char Star43[] PROGMEM = "Delta";
const prog_char Star44[] PROGMEM = "Mirzam";
const prog_char Star45[] PROGMEM = "Castor";
const prog_char Star46[] PROGMEM = "Alphard";
const prog_char Star47[] PROGMEM = "Hamal";
const prog_char Star48[] PROGMEM = "Polaris";
const prog_char Star49[] PROGMEM = "Nunki";
const prog_char Star50[] PROGMEM = "DenebKaitos";

PGM_P StarList[] PROGMEM = 
{
Star01,Star02,Star03,Star04,Star05,Star06,Star07,Star08,
Star09,Star10,Star11,Star12,Star13,Star14,Star15,Star16,
Star17,Star18,Star19,Star20,Star21,Star22,Star23,Star24,
Star25,Star26,Star27,Star28,Star29,Star30,Star31,Star32,
Star33,Star34,Star35,Star36,Star37,Star38,Star39,Star40,
Star41,Star42,Star43,Star44,Star45,Star46,Star47,Star48,
Star49,Star50
};

char StrBuffer[14];

void setup()
{
Serial.begin(9600);
for(byte j = 0; j<20; j++)
    Serial.println(GetPrgStr(StarList[j]));
}

void loop()
{
}

char* GetPrgStr(const char* str)
{
  strcpy_P(StrBuffer, (char*)str);
  return StrBuffer;
}

the arduino uno resets each time i run this code

if i use Serial.println(GetPrgStr(LCD_List[10])); it works

What i did wrong in the loop?
Thanks

const prog_char Star04[] PROGMEM = "RigilKentaurus";

How many characters is this? Including the trailing NULL.

char StrBuffer[14];

Are they all going to fit in here?

Where is LCD_List[] defined? Am surprised that compiles.

sorry for the lecd list is StarList

i'll increase the buffer and see if it works

i’ve put the StrBuffer[40] and still doesn’t work

but this works

  for(byte j =0; j<20;j++){
    strcpy_P(StrBuffer, (char*)pgm_read_word(&(StarList[j])));
    Serial.println(StrBuffer);
    delay(1000);
}

gvi70000:
i have the following code

the arduino uno resets each time i run this code

What i did wrong in the loop?
Thanks

Here’s how I would do it:

void setup()
{
        char *buffer;

        const char *stars[50] = {
                PSTR("Sirius"),
                PSTR("Canopus"),
                PSTR("Arcturus"),
                PSTR("RigilKentaurus"),
                PSTR("Vega"),
                PSTR("Capella"),
                PSTR("Rigel"),
                PSTR("Procyon"),
                PSTR("Achernar"),
                PSTR("Betelgeuse"),
                PSTR("Hadar"),
                PSTR("Altair"),
                PSTR("Aldebaran"),
                PSTR("Antares"),
                PSTR("Spica"),
                PSTR("Pollux"),
                PSTR("Fomalhaut"),
                PSTR("Mimosa"),
                PSTR("Deneb"),
                PSTR("Acrux"),
                PSTR("Regulus"),
                PSTR("Adhara"),
                PSTR("Gacrux"),
                PSTR("Shaula"),
                PSTR("Bellatrix"),
                PSTR("ElNath"),
                PSTR("Miaplacidus"),
                PSTR("Alnilan"),
                PSTR("AlNa'ir"),
                PSTR("Alioth"),
                PSTR("Gama2"),
                PSTR("Mirfak"),
                PSTR("Dubhe"),
                PSTR("Wezen"),
                PSTR("KausAustralis"),
                PSTR("Avior"),
                PSTR("Alkaid"),
                PSTR("Sargas"),
                PSTR("Menkaliman"),
                PSTR("Atria"),
                PSTR("Alhena"),
                PSTR("Peacock"),
                PSTR("Delta"),
                PSTR("Mirzam"),
                PSTR("Castor"),
                PSTR("Alphard"),
                PSTR("Hamal"),
                PSTR("Polaris"),
                PSTR("Nunki"),
                PSTR("DenebKaitos")
        };

        Serial.begin(9600);

        buffer = (char *) malloc((64) * sizeof(char)); // 64 bytes should be enough

        if(!buffer) {
                Serial.print("Allocate buffer failed\r\n");
                return;
        }

        for(byte j = 0; j<50; j++) {
                sprintf_P(buffer, stars[j]);
                Serial.println(buffer);
        }

        free(buffer);
}

void loop()
{
}