Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

http_test crashes on mac os x

Open
#59 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start in samples/net/net_http_test.c and compare its net_http_new calls with include/net/net_http.h, then reproduce the failure with make DEBUG=1 and ./http_test. Use the reported macOS crash as the baseline; done means the HTTP sample runs without a segmentation fault and its compiler warnings are resolved.

Written by the indexing model from the issue text.

Description

pwd

../libretro-common-master/samples/net

franck-mac-book-air:net franck$ make DEBUG=1
cc -I../../include ../../net/net_http.c -c -O0 -g -Wall -pedantic -std=gnu99 -o ../../net/net_http.o
cc -I../../include ../../net/net_compat.c -c -O0 -g -Wall -pedantic -std=gnu99 -o ../../net/net_compat.o
cc -I../../include ../../net/net_socket.c -c -O0 -g -Wall -pedantic -std=gnu99 -o ../../net/net_socket.o
cc -I../../include ../../compat/compat_strl.c -c -O0 -g -Wall -pedantic -std=gnu99 -o ../../compat/compat_strl.o
cc -I../../include ../../encodings/encoding_utf.c -c -O0 -g -Wall -pedantic -std=gnu99 -o ../../encodings/encoding_utf.o
cc -I../../include ../../string/stdstring.c -c -O0 -g -Wall -pedantic -std=gnu99 -o ../../string/stdstring.o
cc -I../../include net_http_test.c -c -O0 -g -Wall -pedantic -std=gnu99 -o net_http_test.o
net_http_test.c:40:25: warning: incompatible pointer types passing 'char [89]'
to parameter of type 'struct http_connection_t *'
[-Wincompatible-pointer-types]
..."http://buildbot.libretro.com/nightly/windows/x86_64/latest/mednafen_psx_libretro.dll.zip");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/net/net_http.h:47:55: note: passing argument to parameter 'conn'
here
struct http_t *net_http_new(struct http_connection_t *conn);
^
net_http_test.c:45:25: warning: incompatible pointer types passing 'char [26]'
to parameter of type 'struct http_connection_t *'
[-Wincompatible-pointer-types]
http3 = net_http_new("http://www.wikipedia.org/");
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/net/net_http.h:47:55: note: passing argument to parameter 'conn'
here
struct http_t *net_http_new(struct http_connection_t *conn);
^
2 warnings generated.
cc -I../../include ../../net/net_http.o ../../net/net_compat.o ../../net/net_socket.o ../../compat/compat_strl.o ../../encodings/encoding_utf.o ../../string/stdstring.o net_http_test.o -O0 -g -Wall -pedantic -std=gnu99 -o http_test
cc -I../../include ../../net/net_ifinfo.c -c -O0 -g -Wall -pedantic -std=gnu99 -o ../../net/net_ifinfo.o
cc -I../../include net_ifinfo_test.c -c -O0 -g -Wall -pedantic -std=gnu99 -o net_ifinfo_test.o
cc -I../../include ../../net/net_ifinfo.o net_ifinfo_test.o -O0 -g -Wall -pedantic -std=gnu99 -o net_ifinfo
franck-mac-book-air:net franck$ ./http_test
Segmentation fault: 11
franck-mac-book-air:net franck$ lldb ./http_test
(lldb) target create "./http_test"
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in
import weakref
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Current executable set to './http_test' (x86_64).
(lldb) run
Process 28269 launched: './http_test' (x86_64)
Process 28269 stopped

  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x00007fff6aadca76 libsystem_info.dylibsi_addrinfo + 182 libsystem_info.dylibsi_addrinfo:
    -> 0x7fff6aadca76 <+182>: movsbl (%rax), %ecx
    0x7fff6aadca79 <+185>: cmpl $0x0, %ecx
    0x7fff6aadca7c <+188>: jne 0x7fff6aadca8a ; <+202>
    0x7fff6aadca82 <+194>: movq $0x0, -0x20(%rbp)
    Target 0: (http_test) stopped.
    (lldb)
Dominant language
C
Stars
182
Forks
98
Avg merge
14d 4h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libretro/libretro-common

All issues in libretro/libretro-common

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.