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

[package] m4/1.4.19: Runtime assertion windows pops up on MSVC in Debug mode #8920

Closed
jmarrec opened this issue Jan 14, 2022 · 12 comments · Fixed by #8984
Closed

[package] m4/1.4.19: Runtime assertion windows pops up on MSVC in Debug mode #8920

jmarrec opened this issue Jan 14, 2022 · 12 comments · Fixed by #8984
Labels
bug Something isn't working

Comments

@jmarrec
Copy link
Contributor

jmarrec commented Jan 14, 2022

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: m4/1.4.19
  • Operating System+version: Windows 10
  • Compiler+version: MSVC 2017, 2019 in DEBUG
  • Conan version: conan 1.44.0
  • Python version: Python 3.9.5

I have a recipe that depends on bison. 3.7.6 gives me parse errors, so I keep it at 3.7.1. I had pinned the exact bison/3.7.1 recipe and all worked well. I am trying to update my dependencies, so I tried the newest bison/3.7.1 revision, and I am now getting an assertion popup in m4.

I have tried various combinations to see if I could pinpoint what changed. My conclusion is that it's the move from m4/1.4.18 to m4/1.4.19 (I have tried the newest recipe revision of m4/1.4.18 and it worked, and the only m4/1.4.19 available fails).

        # Latest bison/3.7.1 with m4/1.4.18
        #self.build_requires("bison/3.7.1#dcffa3dd9204cb79ac7ca09a7f19bb8b") #  Works

        # First bison/3.7.1 with m4/1.4.19
        self.build_requires("bison/3.7.1#47f49e709ddb9f8e055471c4e3c4e67d"): # Fails

        # Latest bison/3.7.1
        #self.build_requires("bison/3.7.1#ad29e804e82c8b6d58765096676b5a5e") # Fails

Screen Shot 2022-01-14 at 13 35 01

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

git clone git@github.com:NREL/conan-openstudio-ruby.git
git checkout update_ruby_installer_and_remotes

'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat' x64

conan create . openstudio_ruby/2.7.2@nrel/testing -b missing -b openstudio_ruby -s build_type=Debug

Logs (Include/Attach if Applicable)

Example of a failed run: https://github.com/NREL/conan-openstudio-ruby/runs/4787415523?check_suite_focus=true

@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 18, 2022

@madebr is this "reb" on purpose?

The 1.4.18 version has "rb" (which is familar to me, unlike reb...):

@madebr
Copy link
Contributor

madebr commented Jan 18, 2022

The patch is adding 'b' (it is already "re").
It looks like it is a GNU extension:

       e (since glibc 2.7)
              Open  the  file with the O_CLOEXEC flag.  See open(2) for more information.  This flag is ignored for
              fdopen().

The problem you're seeing with debug 2019 is probably the same we saw when adding m4/1.4.19.
See #7369 for our analysis at that time.

We have a short reproducer.

I don't remember why we didn't patch out the _close of fclose.

@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 18, 2022

I just got the same issue building bison/3.7.6 in debug FYI

image

@madebr
Copy link
Contributor

madebr commented Jan 19, 2022

The problem is with m4. The bison version is kinda irrelevant.
m4 is only used as a build requirement since it provides no library.
I think you can work around the problem by adding -s:b m4:build_type=Release.

@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 19, 2022

I'd like to do that, but unfortunately all my attemps of forcing the build_requires to be in Release mode failed when using CPT and docker (locally it works plently fine if I issue the conan create command manually)

conan-io/conan-package-tools#595 (comment)

@SSE4
Copy link
Contributor

SSE4 commented Jan 19, 2022

@jmarrec have you already tried asking in m4 mail list, as it was discussed in #7369? it seems like there is no configure option to bypass the check, and proper fix may require to patch m4 sources.

jmarrec added a commit to jmarrec/conan-center-index that referenced this issue Jan 19, 2022
jmarrec added a commit to jmarrec/conan-center-index that referenced this issue Jan 19, 2022
jmarrec added a commit to jmarrec/conan-center-index that referenced this issue Jan 19, 2022
jmarrec added a commit to jmarrec/conan-center-index that referenced this issue Jan 19, 2022
jmarrec added a commit to jmarrec/conan-center-index that referenced this issue Jan 19, 2022
@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 19, 2022

Both jmarrec@9c7fa44 and jmarrec@d5e6472 when built locally allow me to build bison/3.7.6 (both in debug) without the popup

@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 19, 2022

Not sure which solution we prefer. Perhaps combining them both actually...

@SSE4
Copy link
Contributor

SSE4 commented Jan 19, 2022

jmarrec/conan-center-index@d5e6472

I personally prefer jmarrec@d5e6472, as it doesn't require patching sources

@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 19, 2022

I'm less certain that this HAVE_MSVC_INVALID_PARAMETER_HANDLER actually fixes it in all cases though. And you wrote on #7369 (comment)

I see in m4 code they install some custom invalid parameter handler (HAVE_MSVC_INVALID_PARAMETER_HANDLER), but it doesn't seem to help...

jmarrec added a commit to jmarrec/conan-center-index that referenced this issue Jan 19, 2022
@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 19, 2022

It does seem to work. I'll open a PR

@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 19, 2022

Cf PR #8984

jmarrec added a commit to jmarrec/conan-center-index that referenced this issue Jan 24, 2022
conan-center-bot pushed a commit that referenced this issue Mar 7, 2022
…SVC in Debug mode

* #8920 - Define HAVE_MSVC_INVALID_PARAMETER_HANDLER

* #8920 - Add a patch to call _CrtSetReportMode early in main

* Wrong macro check

* HELP2MAN=/bin/true?

* - workaround make calling help2man (don't care, as we are not interested in man pages)

Signed-off-by: SSE4 <tomskside@gmail.com>

* - fix MSVC

Signed-off-by: SSE4 <tomskside@gmail.com>

Co-authored-by: SSE4 <tomskside@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants