Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault (core dumped) #3

Open
cfranks opened this issue May 2, 2014 · 17 comments
Open

Segmentation fault (core dumped) #3

cfranks opened this issue May 2, 2014 · 17 comments

Comments

@cfranks
Copy link

cfranks commented May 2, 2014

Segmentation fault (core dumped) when running apache2nginx -f /var/apache2/conf/httpd.conf

@avelis
Copy link

avelis commented May 11, 2014

+1 Running Mac OS X Mavericks. From what I have been reading. It would appear that the program has a bug in it. I had to compile and run it the my local hardware. I am unsure if my machine's hardware is the root of the issue or the source code itself.

@avelis
Copy link

avelis commented May 13, 2014

Ok. Upon further investigation I was able to get this tool to work. The caveat is that it has to run on a Ubuntu server or unix server. Even then I still have to compile from source and install it in /usr/local/apache2nginx as per the project page documentation. As a Mac OS X user, without a Ubuntu server ready, I had to leverage a local virtual Ubuntu server via Vagrant to convert my apache configurations. I know this isn't a solution to the problem above, but an alternative for others who might land here.

tl;dr

  1. Use Vagrant to create an Ubuntu server.
  2. Sync your Apache confs that you want to convert onto that same server.
  3. Install apache2nginx via source (Main project page provides docs to do this).
  4. Use apache2nginx to convert your confs to be nginx compliant.

@rays
Copy link

rays commented Jan 22, 2018

Tried on a Majaro system and got a core dump. What does ubuntu have that is missing in manjaro?

@gaby64
Copy link

gaby64 commented Oct 15, 2018

also getting segfault on ubuntu

@ghost
Copy link

ghost commented Dec 3, 2018

It indeed segfaults:

#0 0x00007fa44ab51676 in strlen () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x000055c4c2575a27 in apr_pstrdup (a=a@entry=0x55c4c4272128, s=0xffffffffc42728e8 <error: Cannot access memory at address 0xffffffffc42728e8>)
at strings/apr_strings.c:77
#2 0x000055c4c257a1e8 in apr_get_basedir (resolved_dir=0x7ffcf5f27ee0, filename=, p=0x55c4c4272128) at file_io/unix/filepath.c:349
#3 0x000055c4c24d1f5d in main (argc=, argv=) at main.c:304

@gaby64
Copy link

gaby64 commented Dec 6, 2018

I have a fork that works, updated apr and included Reeds mods

https://github.com/gaby64/apache2nginx

@virgilwashere
Copy link

I have a fork that works, updated apr and included Reeds mods

@gaby64 even using your repo, I kept getting libtool generated with CRLF issues (^M).
Running a recursive dos2unix -f got me a fixed libtool, and consequently a proper configure stage.

However, the end result is a compiled and working binary. Thanks!

@gaby64
Copy link

gaby64 commented Jan 17, 2019

I have a fork that works, updated apr and included Reeds mods

@gaby64 even using your repo, I kept getting libtool generated with CRLF issues (^M).
Running a recursive dos2unix -f got me a fixed libtool, and consequently a proper configure stage.

However, the end result is a compiled and working binary. Thanks!

that might be an issue with your git config, I cloned my repo an had no issue on Ubuntu 18.10

running file -- * shows no file with crlf endings

@Seegras
Copy link

Seegras commented Jan 23, 2019

This is Sooo broken.

(gdb) run -f 2.conf
Starting program: apache2nginx -f 2.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:93
93 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) bt
#0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:93
#1 0x0000555555634a97 in apr_pstrdup (a=a@entry=0x5555556b1378,
s=0x556b1b38 <error: Cannot access memory at address 0x556b1b38>)
at strings/apr_strings.c:77
#2 0x0000555555639097 in apr_get_basedir (resolved_dir=0x7fffffffe0a0,
filename=, p=0x5555556b1378) at file_io/unix/filepath.c:349
#3 0x000055555558f417 in main (argc=, argv=)
at main.c:304

@dorbsz
Copy link

dorbsz commented Mar 26, 2019

Was wishing this would work, tried everything that was commented here, was able to compile and run on ubuntu, but also got Seg Fault.
Might need to write my own in java, stay tuned.

@steelliberty
Copy link

I have a fork that works, updated apr and included Reeds mods

https://github.com/gaby64/apache2nginx

Hi gaby64 -- How can I build your solution? The READ.ME file on your fork is identical to the original -- so the the same files will be compiled.

Thank you

@gaby64
Copy link

gaby64 commented Nov 3, 2019

download source files from my fork
./configure
make && make install

@steelliberty
Copy link

download source files from my fork
./configure
make && make install

Thank you for the help .. making progress -- I am now getting the error message

bin/bash /tmp/apache2nginx/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apache2nginx/srclib/apr-util/include -I/tmp/apache2nginx/srclib/apr-util/include/private -I/tmp/apache2nginx/srclib/apr/include -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:10: fatal error: expat.h: No such file or directory
#include <expat.h>
^~~~~~~~~
compilation terminated.

@gaby64
Copy link

gaby64 commented Nov 3, 2019

run buildconf

@steelliberty
Copy link

run buildconf

Okay .. I had to install libtool and buildconf ran without errors .. then I did
./configure
make && make install

resulting in this error

/bin/bash /tmp/apache2nginx/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apache2nginx/srclib/apr-util/include -I/tmp/apache2nginx/srclib/apr-util/include/private -I/tmp/apache2nginx/srclib/apr/include -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:10: fatal error: expat.h: No such file or directory
#include <expat.h>
^~~~~~~~~
compilation terminated.
/tmp/apache2nginx/srclib/apr-util/build/rules.mk:206: recipe for target 'xml/apr_xml.lo' failed
make[3]: *** [xml/apr_xml.lo] Error 1
make[3]: Leaving directory '/tmp/apache2nginx/srclib/apr-util'
/tmp/apache2nginx/srclib/apr-util/build/rules.mk:118: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/tmp/apache2nginx/srclib/apr-util'
/tmp/apache2nginx/build/rules.mk:72: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/apache2nginx/srclib'
/tmp/apache2nginx/build/rules.mk:72: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

@gaby64
Copy link

gaby64 commented Nov 3, 2019

install expat lib or package for your distro

please do the research, I only intended to provide patched code that worked for me, not compile support. it may not even work anymore, I could check tomorrow.

@steelliberty
Copy link

steelliberty commented Nov 4, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants