# Posix\_GCC demo: stack smashing detected

**URL:** <https://forums.freertos.org/t/posix-gcc-demo-stack-smashing-detected/20125>\
**Category:** Kernel\
**Tags:** tutorial\
**Created:** [May 23, 2024, 3:06am UTC](https://forums.freertos.org/t/posix-gcc-demo-stack-smashing-detected/20125 "2024-05-23T03:06:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmrivas70](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jmrivas70](https://forums.freertos.org/u/jmrivas70)\
**Post date:** [May 23, 2024, 3:06am UTC](https://forums.freertos.org/t/posix-gcc-demo-stack-smashing-detected/20125/1 "2024-05-23T03:06:44Z")

</div>

Hello everyone,

I am new in FreeRTOS and I am trying to execute de Posix\_GCC on Ubuntu 22.04.4 LTS.

I am using gcc 11.4.0 and make 4.3

When I launch the ./posix\_demo I got this

```auto
[WARN] pthread_attr_setstack failed with return value: 22. Default stack will be used.
[WARN] Increase the stack size to PTHREAD_STACK_MIN.

Trace started.
The trace will be dumped to disk if a call to configASSERT() fails.
Starting full demo
***stack smashing detected*** : terminated

```

Any suggestion is really appreciated.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [May 23, 2024, 11:18am UTC](https://forums.freertos.org/t/posix-gcc-demo-stack-smashing-detected/20125/2 "2024-05-23T11:18:46Z")

</div>

Which version are you using? I tried the mainline and I do not see this crash. Here is my command history:

```auto
gh repo clone git@github.com:FreeRTOS/FreeRTOS.git
cd FreeRTOS/
git submodule update --init --recursive 
cd FreeRTOS/Demo/Posix_GCC/
make
./build/posix_demo 

```

And here is the output I see -

```auto
Trace started.
The trace will be dumped to disk if a call to configASSERT() fails.
Starting full demo
OK: No errors - tick count 10001 
OK: No errors - tick count 20001 

```

`make` and `gcc` versions are also same as yours:

```auto
$ make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

```

---

<div class="post-metadata">

**Author:** ![jmrivas70](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jmrivas70](https://forums.freertos.org/u/jmrivas70)\
**Post date:** [May 23, 2024, 2:47pm UTC](https://forums.freertos.org/t/posix-gcc-demo-stack-smashing-detected/20125/3 "2024-05-23T14:47:22Z")

</div>

Hi,

I downloaded the code from the web site, not from GIT.

I have been requested for other project for some days.

When I get round to test it, I will let you know the result

Thank you for your answer  
Jose

---

<div class="post-metadata">

**Author:** ![jmrivas70](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jmrivas70](https://forums.freertos.org/u/jmrivas70)\
**Post date:** [May 27, 2024, 2:31pm UTC](https://forums.freertos.org/t/posix-gcc-demo-stack-smashing-detected/20125/4 "2024-05-27T14:31:17Z")

</div>

> [@aggarg](#):
>
> `git submodule update --init --recursive `

It works.

What is on the website and what is on GitHub is not the same.

THANK YOU SO MUCH !!!

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [May 28, 2024, 5:04am UTC](https://forums.freertos.org/t/posix-gcc-demo-stack-smashing-detected/20125/5 "2024-05-28T05:04:10Z")

</div>

Thank you for reporting back!
