On 26.06.2016 18:19, meino.cra...@gmx.de wrote:
> Dan Johansson <dan.johans...@dmj.nu> [16-06-26 18:12]:
>> The following code snippet compiles find but when run it just hangs forever:
>>
>> $ cat x.c
>> #include <stdio.h>
>> #include <unistd.h>
>> #include <crypt.h>
>>
>> int main() {
>>         printf("Running test\n");
>>         char *encrypted = crypt("blablabla","ab");
>>         if(!encrypted || strcmp(encrypted,"ab.h7fshjf89f")) {
>>                 printf("Fail\n");
>>         } else {
>>                 printf("OK\n");
>>         }
>> }
>>
>> $ gcc -o xout x.c -lcrypt
>>
>> $ ./xout
>> Running test
>>
>> <here the program just hangs and needs to be killed with ^C>
>>
>> The same code runs fine on my desktop.
>> Any suggestions what could be my problem?
>>
>> -- 
> Hi Dan,
> 
> this is just a shot in the dark and most likely I will miss the
> target...but...
> 
> Off what kind of memory you are running this code?
> Das "cryot()" returns a pointer to newly acquired memory?
> May be this memory is not RAM but flash/EEPROM?
> If crypt() expects already allocated memory at the
> pointers adress this may work on a PC because its
> short and the stack is relatively large and you hit
> nothing ... so it runs accidentally (so to say) and
> fails on a Raspi...
> 
> Only some random thoughts...

It's running in "normal" RAM. And I think if it was something like that
other software would also have problem, which it has not.


-- 
Dan Johansson
***************************************************
This message is printed on 100% recycled electrons!
***************************************************

Reply via email to